File tree Expand file tree Collapse file tree
include/sof/debug/telemetry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,3 +9,12 @@ config SOF_TELEMETRY
99 systick_info measurement which measures scheduler task performance and may
1010 slightly affect overall performance.
1111
12+ config SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS
13+ bool "enable performance measurements"
14+ default n
15+ help
16+ Enables performance measurements. Requires ADSP_MW interface. Each created component
17+ can have its performance checked by measuring execution time of copy function.
18+ Performance records are stored in the limited number of slots in Memory Window 3,
19+ so only a certain number (PERFORMANCE_DATA_ENTRIES_COUNT) of components can be measured.
20+
Original file line number Diff line number Diff line change @@ -23,11 +23,14 @@ LOG_MODULE_DECLARE(ipc, CONFIG_SOF_LOG_LEVEL);
2323
2424/* Systic variables, one set per core */
2525static int telemetry_systick_counter [CONFIG_MAX_CORE_COUNT ];
26+ #ifdef CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS
2627static int telemetry_prev_ccount [CONFIG_MAX_CORE_COUNT ];
2728static int telemetry_perf_period_sum [CONFIG_MAX_CORE_COUNT ];
2829static int telemetry_perf_period_cnt [CONFIG_MAX_CORE_COUNT ];
2930static struct telemetry_perf_queue telemetry_perf_queue [CONFIG_MAX_CORE_COUNT ];
31+ #endif
3032
33+ #ifdef CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS
3134static void telemetry_perf_queue_append (struct telemetry_perf_queue * q , size_t element )
3235{
3336 if (!q -> full ) {
@@ -59,6 +62,7 @@ static size_t telemetry_perf_queue_avg(struct telemetry_perf_queue *q)
5962 return 0 ;
6063 return q -> sum / q -> size ;
6164}
65+ #endif
6266
6367int telemetry_init (void )
6468{
@@ -107,7 +111,7 @@ void telemetry_update(uint32_t begin_stamp, uint32_t current_stamp)
107111 systick_info [prid ].max_time_elapsed );
108112 systick_info [prid ].last_ccount = current_stamp ;
109113
110- #ifdef SOF_PERFORMANCE_MEASUREMENTS
114+ #ifdef CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS
111115 const size_t measured_systick = begin_stamp - telemetry_prev_ccount [prid ];
112116
113117 telemetry_prev_ccount [prid ] = begin_stamp ;
Original file line number Diff line number Diff line change 1212#define SOF_AVG_PERF_MEAS_DEPTH 64
1313/* Number of runs taken to calculate average (algorithm resolution) */
1414#define SOF_AVG_PERF_MEAS_PERIOD 16
15- /* disables calculating systick_averages */
16- #define SOF_PERFORMANCE_MEASUREMENTS
1715
1816/* to be moved to Zephyr */
1917#define WIN3_MBASE DT_REG_ADDR(DT_PHANDLE(DT_NODELABEL(mem_window3), memory))
You can’t perform that action at this time.
0 commit comments