Skip to content

File syn_profiler.c

FileList > debug > syn_profiler.c

Go to the source code of this file

Task profiler implementation.

  • #include "../util/syn_assert.h"
  • #include "../util/syn_fmt.h"
  • #include "syn_profiler.h"
  • #include <string.h>

Public Functions

Type Name
void syn_profiler_dump (const SYN_Profiler * prof, SYN_ProfilerPrintFunc print)
Dump profiler results via print callback.
void syn_profiler_enable (SYN_Profiler * prof, bool enable)
Enable/disable profiling.
void syn_profiler_init (SYN_Profiler * prof, SYN_ProfileEntry * entries, uint8_t capacity)
Initialize the profiler.
void syn_profiler_register (SYN_Profiler * prof, uint8_t index, const char * name)
Register a task for profiling.
void syn_profiler_task_begin (SYN_Profiler * prof, uint8_t index)
Mark the start of a task's execution.
void syn_profiler_task_end (SYN_Profiler * prof, uint8_t index)
Mark the end of a task's execution.
void syn_profiler_update (SYN_Profiler * prof)
Update CPU percentages and reset counters for the next period.

Public Functions Documentation

function syn_profiler_dump

Dump profiler results via print callback.

void syn_profiler_dump (
    const SYN_Profiler * prof,
    SYN_ProfilerPrintFunc print
) 

Parameters:

  • prof Profiler.
  • print Print function.

function syn_profiler_enable

Enable/disable profiling.

void syn_profiler_enable (
    SYN_Profiler * prof,
    bool enable
) 

Parameters:

  • prof Profiler.
  • enable true to enable, false to disable.

function syn_profiler_init

Initialize the profiler.

void syn_profiler_init (
    SYN_Profiler * prof,
    SYN_ProfileEntry * entries,
    uint8_t capacity
) 

Parameters:

  • prof Profiler instance.
  • entries Array of profile entries (one per task).
  • capacity Number of entries.

function syn_profiler_register

Register a task for profiling.

void syn_profiler_register (
    SYN_Profiler * prof,
    uint8_t index,
    const char * name
) 

Parameters:

  • prof Profiler.
  • index Task index (must match scheduler task index).
  • name Task name for display.

function syn_profiler_task_begin

Mark the start of a task's execution.

void syn_profiler_task_begin (
    SYN_Profiler * prof,
    uint8_t index
) 

Parameters:

  • prof Profiler.
  • index Task index.

function syn_profiler_task_end

Mark the end of a task's execution.

void syn_profiler_task_end (
    SYN_Profiler * prof,
    uint8_t index
) 

Parameters:

  • prof Profiler.
  • index Task index.

function syn_profiler_update

Update CPU percentages and reset counters for the next period.

void syn_profiler_update (
    SYN_Profiler * prof
) 

Call periodically (e.g., every 1 second).

Parameters:

  • prof Profiler.


The documentation for this class was generated from the following file src/syntropic/debug/syn_profiler.c