Files
hakmem/core/tiny_debug_ring.h
Moe Charm (CI) 862e8ea7db Infrastructure and build updates
- Update build configuration and flags
- Add missing header files and dependencies
- Update TLS list implementation with proper scoping
- Fix various compilation warnings and issues
- Update debug ring and tiny allocation infrastructure
- Update benchmark results documentation

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-11-11 21:49:05 +09:00

53 lines
1.6 KiB
C

#ifndef TINY_DEBUG_RING_H
#define TINY_DEBUG_RING_H
#include <stdint.h>
#include <stddef.h>
#include "hakmem_build_flags.h"
// Tiny Debug Ring Trace (Phase 8 tooling)
// Environment: HAKMEM_TINY_TRACE_RING=1 to enable
// Records recent alloc/free events and dumps them on SIGSEGV.
enum {
TINY_RING_EVENT_ALLOC_ENTER = 1,
TINY_RING_EVENT_ALLOC_SUCCESS,
TINY_RING_EVENT_ALLOC_NULL,
TINY_RING_EVENT_ALLOC_REFILL_START,
TINY_RING_EVENT_ALLOC_REFILL_NULL,
TINY_RING_EVENT_ALLOC_BIND,
TINY_RING_EVENT_FREE_ENTER,
TINY_RING_EVENT_FREE_FAST,
TINY_RING_EVENT_FREE_REMOTE,
TINY_RING_EVENT_FREE_LOCAL,
TINY_RING_EVENT_FREE_RETURN_MAG,
TINY_RING_EVENT_SUPERSLAB_ADOPT,
TINY_RING_EVENT_SUPERSLAB_ALLOC,
TINY_RING_EVENT_SUPERSLAB_PUBLISH,
TINY_RING_EVENT_SUPERSLAB_ADOPT_FAIL,
TINY_RING_EVENT_REMOTE_PUSH,
TINY_RING_EVENT_REMOTE_INVALID,
TINY_RING_EVENT_REMOTE_DRAIN,
TINY_RING_EVENT_OWNER_ACQUIRE,
TINY_RING_EVENT_OWNER_RELEASE,
TINY_RING_EVENT_FRONT_BYPASS,
TINY_RING_EVENT_MAILBOX_PUBLISH,
TINY_RING_EVENT_MAILBOX_FETCH,
TINY_RING_EVENT_MAILBOX_FETCH_NULL,
TINY_RING_EVENT_ROUTE
};
#if HAKMEM_BUILD_RELEASE && !HAKMEM_DEBUG_VERBOSE
static inline void tiny_debug_ring_init(void) {
(void)0;
}
static inline void tiny_debug_ring_record(uint16_t event, uint16_t class_idx, void* ptr, uintptr_t aux) {
(void)event; (void)class_idx; (void)ptr; (void)aux;
}
#else
void tiny_debug_ring_init(void);
void tiny_debug_ring_record(uint16_t event, uint16_t class_idx, void* ptr, uintptr_t aux);
#endif
#endif // TINY_DEBUG_RING_H