From d1442c765506cd9944e4c353e560c7f6d6f72ff3 Mon Sep 17 00:00:00 2001 From: Patrick Lipka Date: Mon, 18 Aug 2025 18:41:56 +0200 Subject: [PATCH] add missinng context initialization --- src/rvprof_context.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/rvprof_context.c b/src/rvprof_context.c index c4e5864..e80d43f 100644 --- a/src/rvprof_context.c +++ b/src/rvprof_context.c @@ -1,5 +1,23 @@ #include "rvprof_internal.h" +// initialize with basic defaults - environment variables will override these +rvprof_context_t g_rvprof = { + .config = { + .enable_hooks = 1, // Default: enable hooks + .merge_regions = 1, // Default: merge regions + .output_filename = NULL, // Auto-generate + .program_name = NULL // Auto-detect + }, + .use_cycles = 1, // Try cycle counter first + .stack_ptr = -1, // No active regions + .initialized = 0, // Not initialized + .auto_initialized = 0, // Not auto-initialized + .symbols_loaded = 0, // No symbols loaded + .total_program_time = 0, + .total_program_cycles = 0, + .total_memory_allocated = 0 +}; + void rvprof_context_cleanup(void){ if (!g_rvprof.initialized) { return;