Code performance monitor
More...
Code performance monitor
The performance monitor API is built on top of the performance counter API, and as such cannot be used at the same time. With this API, programs can set probe points in different functional blocks and later obtain statistics about the execution of said functional blocks.
◆ __perf_monitor
#define __perf_monitor |
( |
| f, |
|
|
| l ) |
Value:
__attribute__((section(".monitors"))) = { f, l, }; \
__start_perf_monitor(&__perf_monitor_##l)
void __stop_perf_monitor(struct perf_monitor **monitor)
/cond
Definition perf_monitor.h:41
◆ __perf_monitor_if
#define __perf_monitor_if |
( |
| f, |
|
|
| l, |
|
|
| tst ) |
Value: ({ \
__attribute__((section(".monitors"))) = { f, l, }; \
__perf_monitor_##l.
calls++; \
(tst) ? (__perf_monitor_##l.event1++,1) : (__perf_monitor_##l.event0++,0); \
})
uint64_t calls
Definition perf_monitor.h:44
◆ _perf_monitor
#define _perf_monitor |
( |
| f, |
|
|
| l ) |
Value:
#define __perf_monitor(f, l)
Definition perf_monitor.h:54
◆ _perf_monitor_if
#define _perf_monitor_if |
( |
| f, |
|
|
| l, |
|
|
| tst ) |
Value:
#define __perf_monitor_if(f, l, tst)
Definition perf_monitor.h:63
◆ perf_monitor
Value:
#define _perf_monitor(f, l)
Definition perf_monitor.h:61
/endcond
Register a performance monitor in the current functional block
The performance monitor will run from the moment this macro is used, till the end of the functional block.
◆ perf_monitor_if
#define perf_monitor_if |
( |
| tst | ) |
|
Value:
#define _perf_monitor_if(f, l, tst)
Definition perf_monitor.h:70
Register a performance monitor for branch likeliness analysis.
This macro is designed to be used inside an "if" expression, for instance: if (perf_monitor_if(!strcmp("test", str))) { ... }
The resulting performance monitor will measure the number of calls, and the number of times the branch was taken (in event1) and the number of time it was not (in event0).
- Parameters
-
tst | The boolean expression that is normally used inside the "if" check |
◆ __start_perf_monitor()
◆ __stop_perf_monitor()
◆ perf_monitor_exit()
void perf_monitor_exit |
( |
void | | ) |
|
De-initialize the performance monitor system.
After this function is called, the performance counter API can be used again.
◆ perf_monitor_init()
Initialize the performance monitor system.
Set up the performance monitor system. Note that using the performance monitor system will conflict with any external usage of the performance counter API.
- Parameters
-
event1 | The first event mode (pef_cntr_event_t). |
event2 | The second event mode (pef_cntr_event_t). |
◆ perf_monitor_print()
void perf_monitor_print |
( |
FILE * | f | ) |
|
Print statistics about the probe points to the given file descriptor.
- Parameters
-
f | A valid file descriptor to which the messages will be printed. Use "stdout" for the standard output. |
◆ calls
uint64_t perf_monitor::calls |
◆ event0
uint64_t perf_monitor::event0 |
◆ event0_start
uint64_t perf_monitor::event0_start |
◆ event1
uint64_t perf_monitor::event1 |
◆ event1_start
uint64_t perf_monitor::event1_start |
◆ fn
const char* perf_monitor::fn |
◆ line
unsigned int perf_monitor::line |
◆ time_ns
uint64_t perf_monitor::time_ns |
◆ time_start
uint64_t perf_monitor::time_start |