From f858647ad1204b5d246def6a8c18bce7b9b5b774 Mon Sep 17 00:00:00 2001 From: Patrick Lipka Date: Thu, 7 Aug 2025 16:15:44 +0200 Subject: [PATCH] add global context struct --- src/rvprof_internal.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/rvprof_internal.h b/src/rvprof_internal.h index 1174808..767b449 100644 --- a/src/rvprof_internal.h +++ b/src/rvprof_internal.h @@ -98,6 +98,33 @@ typedef struct { char* program_name; } rvprof_config_t; +// global context +typedef struct{ + rvprof_config_t config; + + // cycle counter info + int use_cycles; + int cycles_avaiable; + + // dynamic arrays + region_array_t regions; + stack_info_array_t stacks; + symbol_array_t symbols; + + // state + int initialized; + int auto_initialized; + int symbols_loaded; + int stack_ptr; + FILE* output_file; + + // statistics + uint64_t total_program_tiem; + uint64_t total_program_cycles; + size_t total_memory_allocated; + +} rvprof_context_t; + #ifdef __cplusplus } #endif