From a66ea408500f063cdd40acf1acb88ecb96282cb7 Mon Sep 17 00:00:00 2001 From: Patrick Lipka Date: Mon, 18 Aug 2025 17:16:16 +0200 Subject: [PATCH] add signal handler --- src/rvprof_timing.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/rvprof_timing.c diff --git a/src/rvprof_timing.c b/src/rvprof_timing.c new file mode 100644 index 0000000..68c4229 --- /dev/null +++ b/src/rvprof_timing.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include "rvprof_internal.h" + +// global flag for cycle counter availability +static volatile int g_cycle_counter_available = 0; +static volatile jmp_buf g_cycle_test_jmpbuf; + +// signal handler for illegal instructions +static void sigkill_handler(int sig){ + g_cycle_counter_available = 0; + longjmp(g_cycle_test_jmpbuf, 1); +} \ No newline at end of file