Cycle-counting profiler with named nodes.
More...
Cycle-counting profiler with named nodes.
A node accumulates the cycles spent between its start and stop calls. Nodes are defined next to the code they measure and collected at link time. A profiling run is reset with pbl_profiler_reset(), timed with pbl_profiler_start() and pbl_profiler_stop(), and logged with pbl_profiler_print_stats(), which shows each node's share of the run.
The node macros compile to nothing without CONFIG_PROFILER.
void prv_render(void) {
...
}
#define PBL_PROFILER_NODE_STOP(_name)
Definition profiler.h:133
#define PBL_PROFILER_NODE_START(_name)
Definition profiler.h:132
#define PBL_PROFILER_NODE_DEFINE(_name)
Definition profiler.h:130
◆ pbl_profiler_node
| Data Fields |
|
uint32_t |
count |
Stops since the last reset. |
|
const char * |
name |
Name, as shown in the stats. |
|
uint32_t |
start |
Cycle count at the last start. |
|
uint32_t |
total |
Cycles accumulated since the last reset. |
◆ PBL_PROFILER_NODE_COUNT
| #define PBL_PROFILER_NODE_COUNT |
( |
|
_name | ) |
(0U) |
◆ PBL_PROFILER_NODE_DECLARE
| #define PBL_PROFILER_NODE_DECLARE |
( |
|
_name | ) |
static_assert(true, "") |
◆ PBL_PROFILER_NODE_DEFINE
| #define PBL_PROFILER_NODE_DEFINE |
( |
|
_name | ) |
static_assert(true, "") |
◆ PBL_PROFILER_NODE_START
| #define PBL_PROFILER_NODE_START |
( |
|
_name | ) |
((void)0) |
◆ PBL_PROFILER_NODE_STOP
| #define PBL_PROFILER_NODE_STOP |
( |
|
_name | ) |
((void)0) |
◆ PBL_PROFILER_NODE_TOTAL_CYCLES
| #define PBL_PROFILER_NODE_TOTAL_CYCLES |
( |
|
_name | ) |
(0U) |
◆ PBL_PROFILER_NODE_TOTAL_US
| #define PBL_PROFILER_NODE_TOTAL_US |
( |
|
_name | ) |
(0U) |