1#include <mem/slab.h>
2
3#include "internal.h"
4
5static void slab_domain_bucket_print(const struct slab_domain_bucket *bucket) {
6 printf(format: "slab_domain_bucket {\n");
7 printf(format: " alloc_calls: %zu,\n", atomic_load_rlx(&bucket->alloc_calls));
8 printf(format: " alloc_magazine_hits: %zu,\n",
9 atomic_load_rlx(&bucket->alloc_magazine_hits));
10 printf(format: " alloc_page_hits: %zu,\n",
11 atomic_load_rlx(&bucket->alloc_page_hits));
12 printf(format: " alloc_local_hits: %zu,\n",
13 atomic_load_rlx(&bucket->alloc_local_hits));
14 printf(format: " alloc_remote_hits: %zu,\n",
15 atomic_load_rlx(&bucket->alloc_remote_hits));
16 printf(format: " alloc_gc_recycle_hits: %zu,\n",
17 atomic_load_rlx(&bucket->alloc_gc_recycle_hits));
18 printf(format: " alloc_new_slab: %zu,\n",
19 atomic_load_rlx(&bucket->alloc_new_slab));
20 printf(format: " alloc_new_remote_slab: %zu\n",
21 atomic_load_rlx(&bucket->alloc_new_remote_slab));
22 printf(format: " alloc_failures: %zu,\n",
23 atomic_load_rlx(&bucket->alloc_failures));
24 printf(format: "\n");
25 printf(format: " free_calls: %zu,\n", atomic_load_rlx(&bucket->free_calls));
26 printf(format: " free_to_ring: %zu,\n", atomic_load_rlx(&bucket->free_to_ring));
27 printf(format: " free_to_local_slab: %zu,\n",
28 atomic_load_rlx(&bucket->free_to_local_slab));
29 printf(format: " free_to_remote_domain: %zu,\n",
30 atomic_load_rlx(&bucket->free_to_remote_domain));
31 printf(format: " free_to_percpu: %zu\n",
32 atomic_load_rlx(&bucket->free_to_percpu));
33 printf(format: "\n");
34 printf(format: " freequeue_enqueues: %zu,\n",
35 atomic_load_rlx(&bucket->freequeue_enqueues));
36 printf(format: " freequeue_dequeues: %zu,\n",
37 atomic_load_rlx(&bucket->freequeue_dequeues));
38 printf(format: " gc_collections: %zu,\n",
39 atomic_load_rlx(&bucket->gc_collections));
40 printf(format: " gc_objects_reclaimed: %zu\n",
41 atomic_load_rlx(&bucket->gc_objects_reclaimed));
42 printf(format: "}\n");
43}
44
45void slab_domains_print(void) {
46 for (size_t i = 0; i < global.domain_count; i++)
47 slab_domain_bucket_print(bucket: &global.domains[i]->slab_domain->aggregate);
48}
49