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
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -66,6 +66,14 @@ extern uint32_t volatile *prof_tcnt;
if(!--prof.rec) prof.elapsed -= *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 /* prof_exec(): Measure a single block of code
This operation can be used when profiling is not required, and instead 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 libprof is used to measure the performance of a single bit of code. Use it