Motr  M0
alloc_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from be/alloc.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "be/alloc.h"
8 #include "be/alloc_xc.h"
9 
10 #if !defined(__KERNEL__)
12 #endif
13 #if !defined(__KERNEL__)
15 #endif
16 #if !defined(__KERNEL__)
18 #endif
19 #if !defined(__KERNEL__)
21 #endif
22 
23 #if !defined(__KERNEL__)
28  ._type = {
30  .xct_name = "m0_be_allocator_call_stat",
31  .xct_sizeof = sizeof (struct m0_be_allocator_call_stat),
32  .xct_nr = 2,
33  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
34  }
35 };
36 
39  offsetof(struct m0_xcode_type, xct_child[0]));
40 #endif
41 
42 #if !defined(__KERNEL__)
47  ._type = {
49  .xct_name = "m0_be_allocator_call_stats",
50  .xct_sizeof = sizeof (struct m0_be_allocator_call_stats),
51  .xct_nr = 3,
52  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
53  }
54 };
55 
58  offsetof(struct m0_xcode_type, xct_child[0]));
59 #endif
60 
61 #if !defined(__KERNEL__)
66  ._type = {
68  .xct_name = "m0_be_alloc_zone_stats",
69  .xct_sizeof = sizeof (struct m0_be_alloc_zone_stats),
70  .xct_nr = 5,
71  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
72  }
73 };
74 
76 M0_BASSERT(offsetof(struct _m0_be_alloc_zone_stats_s, _child[0]) ==
77  offsetof(struct m0_xcode_type, xct_child[0]));
78 #endif
79 
80 #if !defined(__KERNEL__)
81 static struct _m0_be_allocator_stats_s {
83  struct m0_xcode_field _child[12];
85  ._type = {
87  .xct_name = "m0_be_allocator_stats",
88  .xct_sizeof = sizeof (struct m0_be_allocator_stats),
89  .xct_nr = 12,
90  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
91  }
92 };
93 
95 M0_BASSERT(offsetof(struct _m0_be_allocator_stats_s, _child[0]) ==
96  offsetof(struct m0_xcode_type, xct_child[0]));
97 #endif
98 
99 
100 #if !defined(__KERNEL__)
101 M0_BASSERT(sizeof(struct m0_be_allocator_call_stat) == 16U);
102 #endif
103 
104 #if !defined(__KERNEL__)
105 M0_BASSERT(sizeof ((struct m0_be_allocator_call_stat *)0)->bcs_nr == 8U);
107 #endif
108 #if !defined(__KERNEL__)
109 M0_BASSERT(sizeof ((struct m0_be_allocator_call_stat *)0)->bcs_size == 8U);
111 #endif
112 
113 #if !defined(__KERNEL__)
114 M0_BASSERT(sizeof(struct m0_be_allocator_call_stats) == 48U);
115 #endif
116 
117 #if !defined(__KERNEL__)
118 M0_BASSERT(sizeof ((struct m0_be_allocator_call_stats *)0)->bacs_alloc_success == 16U);
120 #endif
121 #if !defined(__KERNEL__)
122 M0_BASSERT(sizeof ((struct m0_be_allocator_call_stats *)0)->bacs_alloc_failure == 16U);
124 #endif
125 #if !defined(__KERNEL__)
126 M0_BASSERT(sizeof ((struct m0_be_allocator_call_stats *)0)->bacs_free == 16U);
128 #endif
129 
130 #if !defined(__KERNEL__)
131 M0_BASSERT(sizeof(struct m0_be_alloc_zone_stats) == 80U);
132 #endif
133 
134 #if !defined(__KERNEL__)
135 M0_BASSERT(sizeof ((struct m0_be_alloc_zone_stats *)0)->bzs_total == 8U);
137 #endif
138 #if !defined(__KERNEL__)
139 M0_BASSERT(sizeof ((struct m0_be_alloc_zone_stats *)0)->bzs_used == 8U);
141 #endif
142 #if !defined(__KERNEL__)
143 M0_BASSERT(sizeof ((struct m0_be_alloc_zone_stats *)0)->bzs_free == 8U);
145 #endif
146 #if !defined(__KERNEL__)
147 M0_BASSERT(sizeof ((struct m0_be_alloc_zone_stats *)0)->bzs_type == 4U);
148 M0_BASSERT(offsetof(struct m0_be_alloc_zone_stats, bzs_type) == 24U);
149 #endif
150 #if !defined(__KERNEL__)
151 M0_BASSERT(sizeof ((struct m0_be_alloc_zone_stats *)0)->bzs_stats == 48U);
153 #endif
154 
155 #if !defined(__KERNEL__)
156 M0_BASSERT(sizeof(struct m0_be_allocator_stats) == 216U);
157 #endif
158 
159 #if !defined(__KERNEL__)
160 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_chunk_overhead == 8U);
162 #endif
163 #if !defined(__KERNEL__)
164 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_space_total == 8U);
166 #endif
167 #if !defined(__KERNEL__)
168 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_space_used == 8U);
170 #endif
171 #if !defined(__KERNEL__)
172 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_space_free == 8U);
174 #endif
175 #if !defined(__KERNEL__)
176 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_stat0_boundary == 8U);
178 #endif
179 #if !defined(__KERNEL__)
180 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_chunks_nr == 8U);
182 #endif
183 #if !defined(__KERNEL__)
184 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_free_chunks_nr == 8U);
186 #endif
187 #if !defined(__KERNEL__)
188 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_total == 48U);
190 #endif
191 #if !defined(__KERNEL__)
192 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_stat0 == 48U);
194 #endif
195 #if !defined(__KERNEL__)
196 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_stat1 == 48U);
198 #endif
199 #if !defined(__KERNEL__)
200 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_print_interval == 8U);
202 #endif
203 #if !defined(__KERNEL__)
204 M0_BASSERT(sizeof ((struct m0_be_allocator_stats *)0)->bas_print_index == 8U);
206 #endif
207 
208 
210  { .xev_idx = 0, .xev_name = "M0_BAP_REPAIR", .xev_val = 0 },
211  { .xev_idx = 1, .xev_name = "M0_BAP_NORMAL", .xev_val = 1 },
212  { .xev_idx = 2, .xev_name = "M0_BAP_NR", .xev_val = 2 },
213  { .xev_idx = -1, .xev_name = "Invalid value of enum 'm0_be_alloc_zone_type'." }
214 };
215 
217  .xe_name = "m0_be_alloc_zone_type",
218  .xe_nr = 3,
219  .xe_val = m0_be_alloc_zone_type_data,
220  .xe_maxlen = 13
221 };
222 
223 #if !defined(__KERNEL__)
225 {
227  .xf_name = "bcs_nr",
228 
229  .xf_type = &M0_XT_U64,
230 
231  .xf_tag = 0,
232  .xf_opaque = NULL,
233  .xf_offset = offsetof(struct m0_be_allocator_call_stat, bcs_nr),
234  .xf_read = NULL,
235  .xf_decor = {
237  }
238  };
239  m0_xc_u64_init();
240 
242  .xf_name = "bcs_size",
243 
244  .xf_type = &M0_XT_U64,
245 
246  .xf_tag = 0,
247  .xf_opaque = NULL,
248  .xf_offset = offsetof(struct m0_be_allocator_call_stat, bcs_size),
249  .xf_read = NULL,
250  .xf_decor = {
252  }
253  };
254  m0_xc_u64_init();
255 
257 }
258 #endif
259 
260 #if !defined(__KERNEL__)
262 {
264  .xf_name = "bacs_alloc_success",
265 #ifdef __KERNEL__
266  .xf_type = &M0_XT_VOID,
267 #else
268 
269  .xf_type = m0_be_allocator_call_stat_xc,
270 #endif
271  .xf_tag = 0,
272  .xf_opaque = NULL,
274  .xf_read = NULL,
275  .xf_decor = {
277  }
278  };
279 #if !defined(__KERNEL__)
281 #endif
282 
284  .xf_name = "bacs_alloc_failure",
285 #ifdef __KERNEL__
286  .xf_type = &M0_XT_VOID,
287 #else
288 
289  .xf_type = m0_be_allocator_call_stat_xc,
290 #endif
291  .xf_tag = 0,
292  .xf_opaque = NULL,
294  .xf_read = NULL,
295  .xf_decor = {
297  }
298  };
299 #if !defined(__KERNEL__)
301 #endif
302 
304  .xf_name = "bacs_free",
305 #ifdef __KERNEL__
306  .xf_type = &M0_XT_VOID,
307 #else
308 
309  .xf_type = m0_be_allocator_call_stat_xc,
310 #endif
311  .xf_tag = 0,
312  .xf_opaque = NULL,
313  .xf_offset = offsetof(struct m0_be_allocator_call_stats, bacs_free),
314  .xf_read = NULL,
315  .xf_decor = {
317  }
318  };
319 #if !defined(__KERNEL__)
321 #endif
322 
324 }
325 #endif
326 
327 #if !defined(__KERNEL__)
329 {
331  .xf_name = "bzs_total",
332 
333  .xf_type = &M0_XT_U64,
334 
335  .xf_tag = 0,
336  .xf_opaque = NULL,
337  .xf_offset = offsetof(struct m0_be_alloc_zone_stats, bzs_total),
338  .xf_read = NULL,
339  .xf_decor = {
341  }
342  };
343  m0_xc_u64_init();
344 
346  .xf_name = "bzs_used",
347 
348  .xf_type = &M0_XT_U64,
349 
350  .xf_tag = 0,
351  .xf_opaque = NULL,
352  .xf_offset = offsetof(struct m0_be_alloc_zone_stats, bzs_used),
353  .xf_read = NULL,
354  .xf_decor = {
356  }
357  };
358  m0_xc_u64_init();
359 
361  .xf_name = "bzs_free",
362 
363  .xf_type = &M0_XT_U64,
364 
365  .xf_tag = 0,
366  .xf_opaque = NULL,
367  .xf_offset = offsetof(struct m0_be_alloc_zone_stats, bzs_free),
368  .xf_read = NULL,
369  .xf_decor = {
371  }
372  };
373  m0_xc_u64_init();
374 
376  .xf_name = "bzs_type",
377 
378  .xf_type = &M0_XT_U32,
379 
380  .xf_tag = 0,
381  .xf_opaque = NULL,
382  .xf_offset = offsetof(struct m0_be_alloc_zone_stats, bzs_type),
383  .xf_read = &m0_xcode_enum_field_read,
384  .xf_decor = {
386  }
387  };
388  m0_xc_u32_init();
389 
391  .xf_name = "bzs_stats",
392 #ifdef __KERNEL__
393  .xf_type = &M0_XT_VOID,
394 #else
395 
397 #endif
398  .xf_tag = 0,
399  .xf_opaque = NULL,
400  .xf_offset = offsetof(struct m0_be_alloc_zone_stats, bzs_stats),
401  .xf_read = NULL,
402  .xf_decor = {
404  }
405  };
406 #if !defined(__KERNEL__)
408 #endif
409 
411 }
412 #endif
413 
414 #if !defined(__KERNEL__)
416 {
418  .xf_name = "bas_chunk_overhead",
419 
420  .xf_type = &M0_XT_U64,
421 
422  .xf_tag = 0,
423  .xf_opaque = NULL,
424  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_chunk_overhead),
425  .xf_read = NULL,
426  .xf_decor = {
428  }
429  };
430  m0_xc_u64_init();
431 
433  .xf_name = "bas_space_total",
434 
435  .xf_type = &M0_XT_U64,
436 
437  .xf_tag = 0,
438  .xf_opaque = NULL,
439  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_space_total),
440  .xf_read = NULL,
441  .xf_decor = {
443  }
444  };
445  m0_xc_u64_init();
446 
448  .xf_name = "bas_space_used",
449 
450  .xf_type = &M0_XT_U64,
451 
452  .xf_tag = 0,
453  .xf_opaque = NULL,
454  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_space_used),
455  .xf_read = NULL,
456  .xf_decor = {
458  }
459  };
460  m0_xc_u64_init();
461 
463  .xf_name = "bas_space_free",
464 
465  .xf_type = &M0_XT_U64,
466 
467  .xf_tag = 0,
468  .xf_opaque = NULL,
469  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_space_free),
470  .xf_read = NULL,
471  .xf_decor = {
473  }
474  };
475  m0_xc_u64_init();
476 
478  .xf_name = "bas_stat0_boundary",
479 
480  .xf_type = &M0_XT_U64,
481 
482  .xf_tag = 0,
483  .xf_opaque = NULL,
484  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_stat0_boundary),
485  .xf_read = NULL,
486  .xf_decor = {
488  }
489  };
490  m0_xc_u64_init();
491 
493  .xf_name = "bas_chunks_nr",
494 
495  .xf_type = &M0_XT_U64,
496 
497  .xf_tag = 0,
498  .xf_opaque = NULL,
499  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_chunks_nr),
500  .xf_read = NULL,
501  .xf_decor = {
503  }
504  };
505  m0_xc_u64_init();
506 
508  .xf_name = "bas_free_chunks_nr",
509 
510  .xf_type = &M0_XT_U64,
511 
512  .xf_tag = 0,
513  .xf_opaque = NULL,
514  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_free_chunks_nr),
515  .xf_read = NULL,
516  .xf_decor = {
518  }
519  };
520  m0_xc_u64_init();
521 
523  .xf_name = "bas_total",
524 #ifdef __KERNEL__
525  .xf_type = &M0_XT_VOID,
526 #else
527 
529 #endif
530  .xf_tag = 0,
531  .xf_opaque = NULL,
532  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_total),
533  .xf_read = NULL,
534  .xf_decor = {
536  }
537  };
538 #if !defined(__KERNEL__)
540 #endif
541 
543  .xf_name = "bas_stat0",
544 #ifdef __KERNEL__
545  .xf_type = &M0_XT_VOID,
546 #else
547 
549 #endif
550  .xf_tag = 0,
551  .xf_opaque = NULL,
552  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_stat0),
553  .xf_read = NULL,
554  .xf_decor = {
556  }
557  };
558 #if !defined(__KERNEL__)
560 #endif
561 
563  .xf_name = "bas_stat1",
564 #ifdef __KERNEL__
565  .xf_type = &M0_XT_VOID,
566 #else
567 
569 #endif
570  .xf_tag = 0,
571  .xf_opaque = NULL,
572  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_stat1),
573  .xf_read = NULL,
574  .xf_decor = {
576  }
577  };
578 #if !defined(__KERNEL__)
580 #endif
581 
583  .xf_name = "bas_print_interval",
584 
585  .xf_type = &M0_XT_U64,
586 
587  .xf_tag = 0,
588  .xf_opaque = NULL,
589  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_print_interval),
590  .xf_read = NULL,
591  .xf_decor = {
593  }
594  };
595  m0_xc_u64_init();
596 
598  .xf_name = "bas_print_index",
599 
600  .xf_type = &M0_XT_U64,
601 
602  .xf_tag = 0,
603  .xf_opaque = NULL,
604  .xf_offset = offsetof(struct m0_be_allocator_stats, bas_print_index),
605  .xf_read = NULL,
606  .xf_decor = {
608  }
609  };
610  m0_xc_u64_init();
611 
613 }
614 #endif
615 
616 M0_INTERNAL void m0_xc_be_alloc_init(void)
617 {
618 #if !defined(__KERNEL__)
620 #endif
621 #if !defined(__KERNEL__)
623 #endif
624 #if !defined(__KERNEL__)
626 #endif
627 #if !defined(__KERNEL__)
629 #endif
630 }
631 
632 M0_INTERNAL void m0_xc_be_alloc_fini(void)
633 {
634 }
m0_bcount_t bas_space_total
Definition: alloc.h:1177
m0_bcount_t bzs_total
Definition: alloc.h:1176
struct m0_xcode_type * m0_be_allocator_stats_xc
Definition: alloc_xc.c:20
#define NULL
Definition: misc.h:38
struct m0_be_allocator_call_stats bas_stat1
Definition: alloc.h:1185
struct m0_xcode_field _child[12]
Definition: alloc_xc.c:83
M0_INTERNAL void m0_xc_m0_be_alloc_zone_stats_struct_init(void)
Definition: alloc_xc.c:328
m0_bcount_t bas_space_free
Definition: alloc.h:1179
struct m0_xcode_type * m0_be_alloc_zone_stats_xc
Definition: alloc_xc.c:17
static struct _m0_be_allocator_stats_s _m0_be_allocator_stats
struct m0_xcode_enum m0_xc_m0_be_alloc_zone_type_enum
Definition: alloc_xc.c:216
static struct _m0_be_allocator_call_stat_s _m0_be_allocator_call_stat
Allocator statistics.
Definition: alloc.h:114
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
m0_bcount_t bas_free_chunks_nr
Definition: alloc.h:1182
struct m0_xcode_type * m0_be_allocator_call_stats_xc
Definition: alloc_xc.c:14
struct m0_xcode_field _child[3]
Definition: alloc_xc.c:45
struct m0_be_allocator_call_stats bas_stat0
Definition: alloc.h:1184
struct m0_xcode_field _child[5]
Definition: alloc_xc.c:64
const char * xe_name
Definition: enum.h:58
struct m0_be_allocator_call_stat bacs_alloc_failure
Definition: alloc.h:1177
static struct _m0_be_alloc_zone_stats_s _m0_be_alloc_zone_stats
struct m0_xcode_type _type
Definition: alloc_xc.c:82
const struct m0_xcode_enum_val m0_be_alloc_zone_type_data[]
Definition: alloc_xc.c:209
M0_INTERNAL void m0_xc_be_alloc_fini(void)
Definition: alloc_xc.c:632
m0_bcount_t bas_space_used
Definition: alloc.h:1178
unsigned long bas_print_interval
Definition: alloc.h:1186
struct m0_be_allocator_call_stats bas_total
Definition: alloc.h:1183
struct m0_xcode_type _type
Definition: alloc_xc.c:44
m0_bcount_t bas_chunks_nr
Definition: alloc.h:1181
struct m0_xcode_type * m0_be_allocator_call_stat_xc
Definition: alloc_xc.c:11
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
struct m0_be_allocator_call_stat bacs_alloc_success
Definition: alloc.h:1176
unsigned long bas_print_index
Definition: alloc.h:1187
struct m0_xcode_type _type
Definition: alloc_xc.c:25
struct m0_be_allocator_call_stat bacs_free
Definition: alloc.h:1178
#define M0_POST(cond)
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
m0_bcount_t bzs_free
Definition: alloc.h:1178
m0_bcount_t bas_chunk_overhead
Definition: alloc.h:1176
void m0_xc_u64_init(void)
Definition: xcode.c:904
struct m0_xcode_type _type
Definition: alloc_xc.c:63
M0_INTERNAL void m0_xc_m0_be_allocator_call_stat_struct_init(void)
Definition: alloc_xc.c:224
m0_bcount_t bas_stat0_boundary
Definition: alloc.h:1180
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
M0_BASSERT(offsetof(struct _m0_be_allocator_call_stat_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
static struct _m0_be_allocator_call_stats_s _m0_be_allocator_call_stats
M0_INTERNAL void m0_xc_m0_be_allocator_call_stats_struct_init(void)
Definition: alloc_xc.c:261
M0_INTERNAL void m0_xc_m0_be_allocator_stats_struct_init(void)
Definition: alloc_xc.c:415
struct m0_xcode_field _child[2]
Definition: alloc_xc.c:26
void m0_xc_u32_init(void)
Definition: xcode.c:900
m0_bcount_t bcs_size
Definition: alloc.h:1177
struct m0_be_allocator_call_stats bzs_stats
Definition: alloc.h:1181
const char * xf_name
Definition: xcode.h:251
M0_INTERNAL void m0_xc_be_alloc_init(void)
Definition: alloc_xc.c:616
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
unsigned long bcs_nr
Definition: alloc.h:1176
#define offsetof(typ, memb)
Definition: misc.h:29
m0_bcount_t bzs_used
Definition: alloc.h:1177
M0_INTERNAL int m0_xcode_enum_field_read(const struct m0_xcode_cursor *it, struct m0_xcode_obj *obj, const char *str)
Definition: enum.c:142