Skip to content

Commit 0129077

Browse files
committed
base_fw: Add perf measurement state set ipc
Adds performance measurement state ipc to change the state of performance measurement. Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
1 parent 89ebad7 commit 0129077

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/audio/base_fw.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
#if defined(CONFIG_SOC_SERIES_INTEL_ACE)
1717
#include <intel_adsp_hda.h>
1818
#endif
19-
#include <sof/debug/telemetry/telemetry.h>
2019
#include <sof/audio/module_adapter/module/generic.h>
2120
#include <sof/schedule/dp_schedule.h>
2221
#include <sof/schedule/ll_schedule.h>
22+
#ifdef CONFIG_TELEMETRY
23+
#include <sof/debug/telemetry/telemetry.h>
2324
#include "adsp_debug_window.h"
2425
#include "mem_window.h"
26+
#endif
2527

2628
#if CONFIG_ACE_V1X_ART_COUNTER || CONFIG_ACE_V1X_RTC_COUNTER
2729
#include <zephyr/device.h>
@@ -505,6 +507,30 @@ int schedulers_info_get(uint32_t *data_off_size,
505507
return 0;
506508
}
507509

510+
void set_perf_meas_state(const char *data)
511+
{
512+
#ifdef CONFIG_TELEMETRY
513+
enum ipc4_perf_measurements_state_set state = *data;
514+
515+
struct telemetry_wnd_data *wnd_data =
516+
(struct telemetry_wnd_data *)ADSP_DW->slots[DW_TELEMETRY_SLOT];
517+
struct system_tick_info *systick_info =
518+
(struct system_tick_info *)wnd_data->system_tick_info;
519+
520+
switch (state) {
521+
case IPC4_PERF_MEASUREMENTS_DISABLED:
522+
break;
523+
case IPC4_PERF_MEASUREMENTS_STOPPED:
524+
for (int i = 0; i < CONFIG_MAX_CORE_COUNT; i++)
525+
systick_info[i].peak_utilization = 0;
526+
break;
527+
case IPC4_PERF_MEASUREMENTS_STARTED:
528+
case IPC4_PERF_MEASUREMENTS_PAUSED:
529+
break;
530+
}
531+
#endif
532+
}
533+
508534
static int basefw_get_large_config(struct comp_dev *dev,
509535
uint32_t param_id,
510536
bool first_block,
@@ -580,6 +606,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
580606
case IPC4_FW_CONFIG:
581607
return basefw_set_fw_config(first_block, last_block, data_offset, data);
582608
case IPC4_PERF_MEASUREMENTS_STATE:
609+
set_perf_meas_state(data);
583610
return 0;
584611
case IPC4_SYSTEM_TIME:
585612
return basefw_set_system_time(param_id, first_block,

0 commit comments

Comments
 (0)