KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Performance monitor

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.
 

Detailed Description

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.

Macro Definition Documentation

◆ perf_monitor

#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.

◆ perf_monitor_if

#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).

Parameters
tstThe boolean expression that is normally used inside the "if" check

Function Documentation

◆ 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()

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.

Parameters
event1The first event mode (pef_cntr_event_t).
event2The 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
fA valid file descriptor to which the messages will be printed. Use "stdout" for the standard output.