51 lines
2.4 KiB
C
51 lines
2.4 KiB
C
|
|
// hak_exit_debug.inc.h — Exit-time Tiny/SS debug dump (one-shot)
|
||
|
|
#ifndef HAK_EXIT_DEBUG_INC_H
|
||
|
|
#define HAK_EXIT_DEBUG_INC_H
|
||
|
|
|
||
|
|
static void hak_flush_tiny_exit(void) {
|
||
|
|
if (g_flush_tiny_on_exit) {
|
||
|
|
hak_tiny_magazine_flush_all();
|
||
|
|
hak_tiny_trim();
|
||
|
|
}
|
||
|
|
if (g_ultra_debug_on_exit) {
|
||
|
|
hak_tiny_ultra_debug_dump();
|
||
|
|
}
|
||
|
|
// Path debug dump (optional): HAKMEM_TINY_PATH_DEBUG=1
|
||
|
|
hak_tiny_path_debug_dump();
|
||
|
|
// Extended counters (optional): HAKMEM_TINY_COUNTERS_DUMP=1
|
||
|
|
extern void hak_tiny_debug_counters_dump(void);
|
||
|
|
hak_tiny_debug_counters_dump();
|
||
|
|
|
||
|
|
// DEBUG: Print SuperSlab accounting stats
|
||
|
|
extern _Atomic uint64_t g_ss_active_dec_calls;
|
||
|
|
extern _Atomic uint64_t g_hak_tiny_free_calls;
|
||
|
|
extern _Atomic uint64_t g_ss_remote_push_calls;
|
||
|
|
extern _Atomic uint64_t g_free_ss_enter;
|
||
|
|
extern _Atomic uint64_t g_free_local_box_calls;
|
||
|
|
extern _Atomic uint64_t g_free_remote_box_calls;
|
||
|
|
extern uint64_t g_superslabs_allocated;
|
||
|
|
extern uint64_t g_superslabs_freed;
|
||
|
|
|
||
|
|
fprintf(stderr, "\n[EXIT DEBUG] SuperSlab Accounting:\n");
|
||
|
|
fprintf(stderr, " g_superslabs_allocated = %llu\n", (unsigned long long)g_superslabs_allocated);
|
||
|
|
fprintf(stderr, " g_superslabs_freed = %llu\n", (unsigned long long)g_superslabs_freed);
|
||
|
|
fprintf(stderr, " g_hak_tiny_free_calls = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_hak_tiny_free_calls, memory_order_relaxed));
|
||
|
|
fprintf(stderr, " g_ss_remote_push_calls = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_ss_remote_push_calls, memory_order_relaxed));
|
||
|
|
fprintf(stderr, " g_ss_active_dec_calls = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_ss_active_dec_calls, memory_order_relaxed));
|
||
|
|
extern _Atomic uint64_t g_free_wrapper_calls;
|
||
|
|
fprintf(stderr, " g_free_wrapper_calls = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_free_wrapper_calls, memory_order_relaxed));
|
||
|
|
fprintf(stderr, " g_free_ss_enter = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_free_ss_enter, memory_order_relaxed));
|
||
|
|
fprintf(stderr, " g_free_local_box_calls = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_free_local_box_calls, memory_order_relaxed));
|
||
|
|
fprintf(stderr, " g_free_remote_box_calls = %llu\n",
|
||
|
|
(unsigned long long)atomic_load_explicit(&g_free_remote_box_calls, memory_order_relaxed));
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif // HAK_EXIT_DEBUG_INC_H
|
||
|
|
|