PebbleOS v4.44.0-52-gf9f287c08
Loading...
Searching...
No Matches
Profiler

Cycle-counting profiler with named nodes. More...

Data Structures

struct  pbl_profiler_node
 A profiler node. More...
 

Macros

#define PBL_PROFILER_NODE_DEFINE(_name)   static_assert(true, "")
 
#define PBL_PROFILER_NODE_DECLARE(_name)   static_assert(true, "")
 
#define PBL_PROFILER_NODE_START(_name)   ((void)0)
 
#define PBL_PROFILER_NODE_STOP(_name)   ((void)0)
 
#define PBL_PROFILER_NODE_TOTAL_CYCLES(_name)   (0U)
 
#define PBL_PROFILER_NODE_TOTAL_US(_name)   (0U)
 
#define PBL_PROFILER_NODE_COUNT(_name)   (0U)
 

Detailed Description

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

Data Structure Documentation

◆ pbl_profiler_node

struct pbl_profiler_node

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

Macro Definition Documentation

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