Vision Apps User Guide
Performance statistics reporting APIs

Introduction

These APIs allows user to get performance information of RTOS based remote cores.

Data Structures

struct  app_perf_stats_cpu_load_t
 Summary of CPU load. More...
 
struct  app_perf_point_t
 Performance point, all time in units of usecs. More...
 
struct  app_perf_stats_cpu_task_stats_t
 CPU task statistics information. More...
 
struct  app_perf_stats_task_stats_t
 Detailed CPU Task Stats information. More...
 
struct  app_perf_stats_mem_stats_t
 Detailed CPU Mem Stats information. More...
 
struct  app_perf_stats_hwa_load_t
 HWA load information. More...
 
struct  app_perf_stats_hwa_stats_t
 HWA load information for all HWAs. More...
 
struct  app_perf_stats_ddr_stats_t
 DDR BW information. More...
 
struct  app_perf_stats_os_stats_t
 OS Resource usage information. More...
 

Functions

int32_t appPerfStatsInit ()
 Initialize perf statistics collector module. More...
 
int32_t appPerfStatsRemoteServiceInit ()
 Initialize perf statistics collector module. More...
 
int32_t appPerfStatsCpuLoadReset (uint32_t app_cpu_id)
 Reset CPU load statistics. More...
 
int32_t appPerfStatsCpuLoadGet (uint32_t app_cpu_id, app_perf_stats_cpu_load_t *cpu_load)
 Get CPU peformance statistics. More...
 
int32_t appPerfStatsCpuTaskStatsGet (uint32_t app_cpu_id, app_perf_stats_task_stats_t *cpu_stats)
 Get CPU peformance statistics. More...
 
int32_t appPerfStatsCpuTaskStatsPrint (uint32_t app_cpu_id, app_perf_stats_task_stats_t *cpu_stats)
 Print CPU peformance statistics. More...
 
int32_t appPerfStatsCpuTaskStacksStatsGet (uint32_t app_cpu_id, app_perf_stats_task_stats_t *cpu_stats)
 Get CPU task stack statistics. More...
 
int32_t appPerfStatsCpuTaskStacksStatsPrint (uint32_t app_cpu_id, app_perf_stats_task_stats_t *cpu_stats)
 Print CPU task stack statistics. More...
 
int32_t appPerfStatsCpuMemStatsGet (uint32_t app_cpu_id, app_perf_stats_mem_stats_t *cpu_stats)
 Get Memory statistics. More...
 
int32_t appPerfStatsCpuMemStatsPrint (uint32_t app_cpu_id, app_perf_stats_mem_stats_t *cpu_stats)
 Print CPU peformance statistics. More...
 
int32_t appPerfStatsCpuLoadPrint (uint32_t app_cpu_id, app_perf_stats_cpu_load_t *cpu_load)
 Print CPU load statistics. More...
 
int32_t appPerfStatsCpuLoadPrintAll ()
 Print CPU load statistics for all enabled CPUs. More...
 
int32_t appPerfStatsCpuOsStatsGet (uint32_t app_cpu_id, app_perf_stats_os_stats_t *os_stats)
 Get CPU OS statistics. More...
 
int32_t appPerfStatsCpuOsStatsPrint (uint32_t app_cpu_id, app_perf_stats_os_stats_t *os_stats, uint32_t showPeak)
 Print CPU OS statistics. More...
 
int32_t appPerfStatsCpuStatsPrintAll ()
 Print CPU peformance statistics for all enabled CPUs. More...
 
int32_t appPerfStatsCpuLoadResetAll ()
 Reset CPU load calc for all enabled CPUs. More...
 
int32_t appPerfStatsPrintAll ()
 Print all performance related information. More...
 
int32_t appPerfStatsRegisterTask (void *task_handle, const char *name)
 Register a task for task load calculation. More...
 
int32_t appPerfStatsDeInit ()
 De-Initialize perf statistics collector module. More...
 
void appPerfPointSetName (app_perf_point_t *prm, const char *name)
 Set name for a performance point. More...
 
void appPerfPointReset (app_perf_point_t *prm)
 Reset a performance point, MUST be called once before begin/end. More...
 
void appPerfPointBegin (app_perf_point_t *prm)
 Start a performance point. More...
 
void appPerfPointEnd (app_perf_point_t *prm)
 End a performance point. More...
 
void appPerfPointPrint (app_perf_point_t *prm)
 Print a performance point. More...
 
void appPerfPointPrintFPS (app_perf_point_t *prm)
 Print a performance point in units of FPS. More...
 
FILE * appPerfStatsExportOpenFile (const char *output_file_path, const char *output_file_prefix)
 Opens a .md file and returns the pointer to application. More...
 
int32_t appPerfStatsExportAll (FILE *fp, app_perf_point_t *perf_points[], uint32_t num_points)
 Exports the performance to a .md file. More...
 
int32_t appPerfStatsExportCloseFile (FILE *fp)
 Closes performance file opened by appPerfStatsExportOpenFile. More...
 
void appPerfStatsHwaUpdateLoad (app_perf_hwa_id_t id, uint32_t active_time_in_usecs, uint32_t pixels_processed)
 Update load numbers against a HWA. More...
 
int32_t appPerfStatsHwaStatsGet (uint32_t app_cpu_id, app_perf_stats_hwa_stats_t *hwa_stats)
 Get HWA peformance statistics. More...
 
int32_t appPerfStatsHwaLoadPrint (app_perf_stats_hwa_stats_t *hwa_load)
 Print HWA load statistics. More...
 
int32_t appPerfStatsHwaLoadPrintAll ()
 Print HWA load statistics for all enabled CPUs. More...
 
int32_t appPerfStatsHwaLoadResetAll ()
 Reset HWA load calc for all HWAs. More...
 
char * appPerfStatsGetHwaName (app_perf_hwa_id_t hwa_id)
 Get HWA name. More...
 
int32_t appPerfStatsDdrStatsGet (app_perf_stats_ddr_stats_t *ddr_stats)
 Get DDR BW statistics. More...
 
int32_t appPerfStatsDdrStatsPrint (app_perf_stats_ddr_stats_t *ddr_load)
 Print DDR BW statistics. More...
 
int32_t appPerfStatsDdrStatsPrintAll ()
 Print DDR BW statistics. More...
 
int32_t appPerfStatsDdrStatsResetAll ()
 Reset DDR BW statistics. More...
 
void appPerfStatsResetAll ()
 Reset all perf stats. More...
 

Enumerations

enum  app_perf_hwa_id_t {
  APP_PERF_HWA_VPAC1_VISS,
  APP_PERF_HWA_VPAC1_LDC,
  APP_PERF_HWA_VPAC1_NF,
  APP_PERF_HWA_VPAC1_MSC0,
  APP_PERF_HWA_VPAC1_MSC1,
  APP_PERF_HWA_DOF,
  APP_PERF_HWA_SDE,
  APP_PERF_HWA_GPU,
  APP_PERF_HWA_MAX
}
 HWA ID. More...
 

Macros

#define APP_PERF_STATS_TASK_NAME_MAX   (12u)
 Max size of task name string. More...
 
#define APP_PERF_STATS_TASK_MAX   (24u)
 Max number of tasks whoose information can be retrived. More...
 
#define APP_PERF_POINT_NAME_MAX   (16u)
 Max size of performance point name string. More...
 
#define APP_PERF_POINT_MAX_FILENAME   (256u)
 Max file name size for output. More...
 
#define APP_PERF_MAX_LINE_SIZE   (1024u)
 Max file line size for output. More...
 

Macro Definition Documentation

◆ APP_PERF_STATS_TASK_NAME_MAX

#define APP_PERF_STATS_TASK_NAME_MAX   (12u)

Max size of task name string.

◆ APP_PERF_STATS_TASK_MAX

#define APP_PERF_STATS_TASK_MAX   (24u)

Max number of tasks whoose information can be retrived.

◆ APP_PERF_POINT_NAME_MAX

#define APP_PERF_POINT_NAME_MAX   (16u)

Max size of performance point name string.

◆ APP_PERF_POINT_MAX_FILENAME

#define APP_PERF_POINT_MAX_FILENAME   (256u)

Max file name size for output.

◆ APP_PERF_MAX_LINE_SIZE

#define APP_PERF_MAX_LINE_SIZE   (1024u)

Max file line size for output.

Enumeration Type Documentation

◆ app_perf_hwa_id_t

HWA ID.

Enumerator
APP_PERF_HWA_VPAC1_VISS 
APP_PERF_HWA_VPAC1_LDC 
APP_PERF_HWA_VPAC1_NF 
APP_PERF_HWA_VPAC1_MSC0 
APP_PERF_HWA_VPAC1_MSC1 
APP_PERF_HWA_DOF 
APP_PERF_HWA_SDE 
APP_PERF_HWA_GPU 
APP_PERF_HWA_MAX 

Function Documentation

◆ appPerfStatsInit()

int32_t appPerfStatsInit ( )

Initialize perf statistics collector module.

RTOS only API MUST be called before any other API

◆ appPerfStatsRemoteServiceInit()

int32_t appPerfStatsRemoteServiceInit ( )

Initialize perf statistics collector module.

RTOS only API MUST be called after IPC init

◆ appPerfStatsCpuLoadReset()

int32_t appPerfStatsCpuLoadReset ( uint32_t  app_cpu_id)

Reset CPU load statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID

◆ appPerfStatsCpuLoadGet()

int32_t appPerfStatsCpuLoadGet ( uint32_t  app_cpu_id,
app_perf_stats_cpu_load_t cpu_load 
)

Get CPU peformance statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_load[out] CPU performance statistics

◆ appPerfStatsCpuTaskStatsGet()

int32_t appPerfStatsCpuTaskStatsGet ( uint32_t  app_cpu_id,
app_perf_stats_task_stats_t cpu_stats 
)

Get CPU peformance statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_stats[out] CPU task performance statistics
Returns
0 on success

◆ appPerfStatsCpuTaskStatsPrint()

int32_t appPerfStatsCpuTaskStatsPrint ( uint32_t  app_cpu_id,
app_perf_stats_task_stats_t cpu_stats 
)

Print CPU peformance statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_stats[in] Detailed CPU task performance statistics
Returns
0 on success

◆ appPerfStatsCpuTaskStacksStatsGet()

int32_t appPerfStatsCpuTaskStacksStatsGet ( uint32_t  app_cpu_id,
app_perf_stats_task_stats_t cpu_stats 
)

Get CPU task stack statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_stats[out] CPU task stack statistics
Returns
0 on success

◆ appPerfStatsCpuTaskStacksStatsPrint()

int32_t appPerfStatsCpuTaskStacksStatsPrint ( uint32_t  app_cpu_id,
app_perf_stats_task_stats_t cpu_stats 
)

Print CPU task stack statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_stats[in] Detailed CPU task stack statistics
Returns
0 on success

◆ appPerfStatsCpuMemStatsGet()

int32_t appPerfStatsCpuMemStatsGet ( uint32_t  app_cpu_id,
app_perf_stats_mem_stats_t cpu_stats 
)

Get Memory statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_stats[out] CPU mem performance statistics
Returns
0 on success

◆ appPerfStatsCpuMemStatsPrint()

int32_t appPerfStatsCpuMemStatsPrint ( uint32_t  app_cpu_id,
app_perf_stats_mem_stats_t cpu_stats 
)

Print CPU peformance statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_stats[in] Detailed CPU mem performance statistics
Returns
0 on success

◆ appPerfStatsCpuLoadPrint()

int32_t appPerfStatsCpuLoadPrint ( uint32_t  app_cpu_id,
app_perf_stats_cpu_load_t cpu_load 
)

Print CPU load statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
cpu_load[in] CPU load statistics
Returns
0 on success

◆ appPerfStatsCpuLoadPrintAll()

int32_t appPerfStatsCpuLoadPrintAll ( )

Print CPU load statistics for all enabled CPUs.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsCpuOsStatsGet()

int32_t appPerfStatsCpuOsStatsGet ( uint32_t  app_cpu_id,
app_perf_stats_os_stats_t os_stats 
)

Get CPU OS statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
os_stats[out] CPU os static memory statistics
Returns
0 on success

◆ appPerfStatsCpuOsStatsPrint()

int32_t appPerfStatsCpuOsStatsPrint ( uint32_t  app_cpu_id,
app_perf_stats_os_stats_t os_stats,
uint32_t  showPeak 
)

Print CPU OS statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
os_stats[in] Detailed CPU os memory statistics
showPeak[in] flag to print peak numbers or not
Returns
0 on success

◆ appPerfStatsCpuStatsPrintAll()

int32_t appPerfStatsCpuStatsPrintAll ( )

Print CPU peformance statistics for all enabled CPUs.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsCpuLoadResetAll()

int32_t appPerfStatsCpuLoadResetAll ( )

Reset CPU load calc for all enabled CPUs.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsPrintAll()

int32_t appPerfStatsPrintAll ( )

Print all performance related information.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsRegisterTask()

int32_t appPerfStatsRegisterTask ( void *  task_handle,
const char *  name 
)

Register a task for task load calculation.

Linux, RTOS only API For linux, this API does nothing as of now For RTOS, task_handle MUST point to BIOS Task_Handle

Returns
0 on success

◆ appPerfStatsDeInit()

int32_t appPerfStatsDeInit ( )

De-Initialize perf statistics collector module.

RTOS only API

Returns
0 on success

◆ appPerfPointSetName()

void appPerfPointSetName ( app_perf_point_t prm,
const char *  name 
)

Set name for a performance point.

Also resets the performance point.

Parameters
prm[out] performance point
name[out] name of this profile point

◆ appPerfPointReset()

void appPerfPointReset ( app_perf_point_t prm)

Reset a performance point, MUST be called once before begin/end.

Parameters
prm[out] performance point

◆ appPerfPointBegin()

void appPerfPointBegin ( app_perf_point_t prm)

Start a performance point.

Parameters
prm[out] performance point

◆ appPerfPointEnd()

void appPerfPointEnd ( app_perf_point_t prm)

End a performance point.

Parameters
prm[out] performance point

◆ appPerfPointPrint()

void appPerfPointPrint ( app_perf_point_t prm)

Print a performance point.

Parameters
prm[in] performance point

◆ appPerfPointPrintFPS()

void appPerfPointPrintFPS ( app_perf_point_t prm)

Print a performance point in units of FPS.

Parameters
prm[in] performance point

◆ appPerfStatsExportOpenFile()

FILE* appPerfStatsExportOpenFile ( const char *  output_file_path,
const char *  output_file_prefix 
)

Opens a .md file and returns the pointer to application.

Parameters
output_file_path[in] path to output file
output_file_prefix[in] name of output file (function will append .md)

◆ appPerfStatsExportAll()

int32_t appPerfStatsExportAll ( FILE *  fp,
app_perf_point_t perf_points[],
uint32_t  num_points 
)

Exports the performance to a .md file.

Parameters
fp[in] file pointer to .md performance file
perf_points[in] array of performance points
num_points[in] number of points in array
Returns
0 on success

◆ appPerfStatsExportCloseFile()

int32_t appPerfStatsExportCloseFile ( FILE *  fp)

Closes performance file opened by appPerfStatsExportOpenFile.

Parameters
fp[in] file pointer to .md performance file
Returns
0 on success

◆ appPerfStatsHwaUpdateLoad()

void appPerfStatsHwaUpdateLoad ( app_perf_hwa_id_t  id,
uint32_t  active_time_in_usecs,
uint32_t  pixels_processed 
)

Update load numbers against a HWA.

Parameters
id[in] HWA ID
active_time_in_usecs[in] Time the HWA was active
pixels_processed[in] Number of pixels processed in this duration

◆ appPerfStatsHwaStatsGet()

int32_t appPerfStatsHwaStatsGet ( uint32_t  app_cpu_id,
app_perf_stats_hwa_stats_t hwa_stats 
)

Get HWA peformance statistics.

Linux, RTOS API

Parameters
app_cpu_id[in] CPU ID
hwa_stats[out] HWA performance statistics
Returns
0 on success

◆ appPerfStatsHwaLoadPrint()

int32_t appPerfStatsHwaLoadPrint ( app_perf_stats_hwa_stats_t hwa_load)

Print HWA load statistics.

Linux, RTOS API

Parameters
hwa_load[in] HWA load statistics
Returns
0 on success

◆ appPerfStatsHwaLoadPrintAll()

int32_t appPerfStatsHwaLoadPrintAll ( )

Print HWA load statistics for all enabled CPUs.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsHwaLoadResetAll()

int32_t appPerfStatsHwaLoadResetAll ( )

Reset HWA load calc for all HWAs.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsGetHwaName()

char* appPerfStatsGetHwaName ( app_perf_hwa_id_t  hwa_id)

Get HWA name.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsDdrStatsGet()

int32_t appPerfStatsDdrStatsGet ( app_perf_stats_ddr_stats_t ddr_stats)

Get DDR BW statistics.

Linux, RTOS API

Parameters
ddr_stats[out] DDR performance statistics
Returns
0 on success

◆ appPerfStatsDdrStatsPrint()

int32_t appPerfStatsDdrStatsPrint ( app_perf_stats_ddr_stats_t ddr_load)

Print DDR BW statistics.

Linux, RTOS API

Parameters
ddr_load[out] DDR performance statistics
Returns
0 on success

◆ appPerfStatsDdrStatsPrintAll()

int32_t appPerfStatsDdrStatsPrintAll ( )

Print DDR BW statistics.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsDdrStatsResetAll()

int32_t appPerfStatsDdrStatsResetAll ( )

Reset DDR BW statistics.

Linux, RTOS API

Returns
0 on success

◆ appPerfStatsResetAll()

void appPerfStatsResetAll ( )

Reset all perf stats.

Linux, RTOS API

Returns
0 on success