diff --git a/libprof.h b/libprof.h index 9ce1674..123176d 100644 --- a/libprof.h +++ b/libprof.h @@ -66,6 +66,14 @@ extern uint32_t volatile *prof_tcnt; if(!--prof.rec) prof.elapsed -= *prof_tcnt; \ } +/* Variant of prof_enter()/prof_leave() for non-recursive contexts */ +#define prof_enter_norec(prof) { \ + prof.elapsed += *prof_tcnt; \ +} +#define prof_leave_norec(prof) { \ + prof.elapsed -= *prof_tcnt; \ +} + /* prof_exec(): Measure a single block of code This operation can be used when profiling is not required, and instead libprof is used to measure the performance of a single bit of code. Use it