add non-recursive, faster versions of enter/leave

This commit is contained in:
Lephenixnoir 2021-09-27 22:01:04 +02:00
parent ac348bce34
commit b6657c0834
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 8 additions and 0 deletions

View File

@ -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