Instruments the allocator to record allocation statistics.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #229
}
map_alloc(b, (uintptr_t)alloc_ch, 1UL << order);
+ uk_alloc_stats_count_palloc(a, (void *) alloc_ch, num_pages);
return ((void *)alloc_ch);
no_memory:
uk_pr_warn("%"__PRIuptr": Cannot handle palloc request of order %"__PRIsz": Out of memory\n",
(uintptr_t)a, order);
+
+ uk_alloc_stats_count_penomem(a, num_pages);
errno = ENOMEM;
return NULL;
}
unsigned long mask;
UK_ASSERT(a != NULL);
+
+ uk_alloc_stats_count_pfree(a, obj, num_pages);
b = (struct uk_bbpalloc *)&a->priv;
size_t order = (size_t)num_pages_to_order(num_pages);