1#include "internal.h"
2
3#define SLAB_STAT_SERIES_GENERATE(name, field) \
4 static inline size_t slab_stat_##name##_callback( \
5 struct stat_bucket *bucket) { \
6 return 0; \
7 struct slab_domain_bucket *sdb = bucket->private; \
8 atomic_fetch_add(&sdb->field, 1); \
9 struct slab_domain *dom = bucket->parent->private; \
10 atomic_fetch_add(&dom->aggregate.field, 1); \
11 return 0; \
12 } \
13 \
14 static inline void slab_stat_##name(struct slab_domain *domain) { \
15 return; \
16 stat_series_record(domain->stats, /* value = */ 1, \
17 slab_stat_##name##_callback); \
18 }
19
20SLAB_STAT_SERIES_GENERATE(alloc_call, alloc_calls);
21SLAB_STAT_SERIES_GENERATE(alloc_page_hit, alloc_page_hits);
22SLAB_STAT_SERIES_GENERATE(alloc_magazine_hit, alloc_magazine_hits);
23SLAB_STAT_SERIES_GENERATE(alloc_local_hit, alloc_local_hits);
24SLAB_STAT_SERIES_GENERATE(alloc_remote_hit, alloc_remote_hits);
25SLAB_STAT_SERIES_GENERATE(alloc_gc_recycle_hit, alloc_gc_recycle_hits);
26SLAB_STAT_SERIES_GENERATE(alloc_new_slab, alloc_new_slab);
27SLAB_STAT_SERIES_GENERATE(alloc_new_remote_slab, alloc_new_remote_slab);
28SLAB_STAT_SERIES_GENERATE(alloc_failure, alloc_failures);
29SLAB_STAT_SERIES_GENERATE(free_call, free_calls);
30SLAB_STAT_SERIES_GENERATE(free_to_ring, free_to_ring);
31SLAB_STAT_SERIES_GENERATE(free_to_local_slab, free_to_local_slab);
32SLAB_STAT_SERIES_GENERATE(free_to_remote_domain, free_to_remote_domain);
33SLAB_STAT_SERIES_GENERATE(free_to_percpu, free_to_percpu);
34SLAB_STAT_SERIES_GENERATE(freequeue_enqueue, freequeue_enqueues);
35SLAB_STAT_SERIES_GENERATE(freequeue_dequeue, freequeue_dequeues);
36SLAB_STAT_SERIES_GENERATE(gc_collection, gc_collections);
37SLAB_STAT_SERIES_GENERATE(gc_object_reclaimed, gc_objects_reclaimed);
38