| 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 | |
| 20 | SLAB_STAT_SERIES_GENERATE(alloc_call, alloc_calls); |
| 21 | SLAB_STAT_SERIES_GENERATE(alloc_page_hit, alloc_page_hits); |
| 22 | SLAB_STAT_SERIES_GENERATE(alloc_magazine_hit, alloc_magazine_hits); |
| 23 | SLAB_STAT_SERIES_GENERATE(alloc_local_hit, alloc_local_hits); |
| 24 | SLAB_STAT_SERIES_GENERATE(alloc_remote_hit, alloc_remote_hits); |
| 25 | SLAB_STAT_SERIES_GENERATE(alloc_gc_recycle_hit, alloc_gc_recycle_hits); |
| 26 | SLAB_STAT_SERIES_GENERATE(alloc_new_slab, alloc_new_slab); |
| 27 | SLAB_STAT_SERIES_GENERATE(alloc_new_remote_slab, alloc_new_remote_slab); |
| 28 | SLAB_STAT_SERIES_GENERATE(alloc_failure, alloc_failures); |
| 29 | SLAB_STAT_SERIES_GENERATE(free_call, free_calls); |
| 30 | SLAB_STAT_SERIES_GENERATE(free_to_ring, free_to_ring); |
| 31 | SLAB_STAT_SERIES_GENERATE(free_to_local_slab, free_to_local_slab); |
| 32 | SLAB_STAT_SERIES_GENERATE(free_to_remote_domain, free_to_remote_domain); |
| 33 | SLAB_STAT_SERIES_GENERATE(free_to_percpu, free_to_percpu); |
| 34 | SLAB_STAT_SERIES_GENERATE(freequeue_enqueue, freequeue_enqueues); |
| 35 | SLAB_STAT_SERIES_GENERATE(freequeue_dequeue, freequeue_dequeues); |
| 36 | SLAB_STAT_SERIES_GENERATE(gc_collection, gc_collections); |
| 37 | SLAB_STAT_SERIES_GENERATE(gc_object_reclaimed, gc_objects_reclaimed); |
| 38 | |