KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Code performance monitor More...
Files | |
file | perf_monitor.h |
Low-level performance monitor. | |
Macros | |
#define | perf_monitor() _perf_monitor(__func__, __LINE__) |
Register a performance monitor in the current functional block. | |
#define | perf_monitor_if(tst) _perf_monitor_if(__func__, __LINE__, tst) |
Register a performance monitor for branch likeliness analysis. | |
Functions | |
void | perf_monitor_init (perf_cntr_event_t event1, perf_cntr_event_t event2) |
Initialize the performance monitor system. | |
void | perf_monitor_exit (void) |
De-initialize the performance monitor system. | |
void | perf_monitor_print (FILE *f) |
Print statistics about the probe points to the given file descriptor. | |
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.
#define perf_monitor | ( | ) | _perf_monitor(__func__, __LINE__) |
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.
#define perf_monitor_if | ( | tst | ) | _perf_monitor_if(__func__, __LINE__, tst) |
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).
tst | The boolean expression that is normally used inside the "if" check |
void perf_monitor_exit | ( | void | ) |
De-initialize the performance monitor system.
After this function is called, the performance counter API can be used again.
void perf_monitor_init | ( | perf_cntr_event_t | event1, |
perf_cntr_event_t | event2 ) |
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.
event1 | The first event mode (pef_cntr_event_t). |
event2 | The second event mode (pef_cntr_event_t). |
void perf_monitor_print | ( | FILE * | f | ) |
Print statistics about the probe points to the given file descriptor.
f | A valid file descriptor to which the messages will be printed. Use "stdout" for the standard output. |