Skip to content

File syn_task_profile.h

FileList > debug > syn_task_profile.h

Go to the source code of this file

Opt-In Task Execution & CPU Jitter Profiler. More...

  • #include "../common/syn_defs.h"
  • #include "../sched/syn_sched.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Classes

Type Name
struct SYN_TaskProfile
Task Execution Profile Metrics Structure.
struct SYN_TaskProfileManager
Task Profiler Registry / Manager Instance.

Public Functions

Type Name
void syn_task_profile_enable (SYN_TaskProfileManager * mgr, bool enable)
Enable or disable the task profiler.
SYN_Status syn_task_profile_get (const SYN_TaskProfileManager * mgr, size_t task_idx, SYN_TaskProfile * profile)
Get the profile statistics for a specific task.
SYN_Status syn_task_profile_init (SYN_TaskProfileManager * mgr)
Initialize the task execution profiler.
void syn_task_profile_step_end (SYN_TaskProfileManager * mgr, size_t task_idx, uint32_t now_us)
Record the completion / yield of a task step execution.
void syn_task_profile_step_start (SYN_TaskProfileManager * mgr, size_t task_idx, const char * task_name, uint32_t now_us)
Record the start of a task step execution.
void syn_task_profile_update (SYN_TaskProfileManager * mgr, uint32_t now_us)
Recalculate CPU utilization percentages across active tasks.

Macros

Type Name
define SYN_TASK_PROFILE_MAX_TASKS 16

Detailed Description

Provides opt-in execution duration, maximum yield latency, and CPU % utilization tracking for cooperative protothread tasks.

Public Functions Documentation

function syn_task_profile_enable

Enable or disable the task profiler.

void syn_task_profile_enable (
    SYN_TaskProfileManager * mgr,
    bool enable
) 

Parameters:

  • mgr Pointer to profile manager.
  • enable true to enable, false to disable.

function syn_task_profile_get

Get the profile statistics for a specific task.

SYN_Status syn_task_profile_get (
    const SYN_TaskProfileManager * mgr,
    size_t task_idx,
    SYN_TaskProfile * profile
) 

Parameters:

  • mgr Pointer to profile manager.
  • task_idx Task index.
  • profile Output profile metrics pointer.

Returns:

SYN_OK on success, or SYN_INVALID_PARAM.


function syn_task_profile_init

Initialize the task execution profiler.

SYN_Status syn_task_profile_init (
    SYN_TaskProfileManager * mgr
) 

Parameters:

  • mgr Pointer to task profile manager.

Returns:

SYN_OK on success.


function syn_task_profile_step_end

Record the completion / yield of a task step execution.

void syn_task_profile_step_end (
    SYN_TaskProfileManager * mgr,
    size_t task_idx,
    uint32_t now_us
) 

Parameters:

  • mgr Pointer to profile manager.
  • task_idx Index of executing task.
  • now_us Current microsecond timestamp.

function syn_task_profile_step_start

Record the start of a task step execution.

void syn_task_profile_step_start (
    SYN_TaskProfileManager * mgr,
    size_t task_idx,
    const char * task_name,
    uint32_t now_us
) 

Parameters:

  • mgr Pointer to profile manager.
  • task_idx Index of executing task.
  • task_name Task identifier name.
  • now_us Current microsecond timestamp.

function syn_task_profile_update

Recalculate CPU utilization percentages across active tasks.

void syn_task_profile_update (
    SYN_TaskProfileManager * mgr,
    uint32_t now_us
) 

Parameters:

  • mgr Pointer to profile manager.
  • now_us Current microsecond timestamp.

Macro Definition Documentation

define SYN_TASK_PROFILE_MAX_TASKS

#define SYN_TASK_PROFILE_MAX_TASKS `16`


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