|
16 | 16 | #if defined(CONFIG_SOC_SERIES_INTEL_ACE) |
17 | 17 | #include <intel_adsp_hda.h> |
18 | 18 | #endif |
19 | | -#include <sof/debug/telemetry/telemetry.h> |
20 | 19 | #include <sof/audio/module_adapter/module/generic.h> |
21 | 20 | #include <sof/schedule/dp_schedule.h> |
22 | 21 | #include <sof/schedule/ll_schedule.h> |
| 22 | +#ifdef CONFIG_TELEMETRY |
| 23 | +#include <sof/debug/telemetry/telemetry.h> |
23 | 24 | #include "adsp_debug_window.h" |
24 | 25 | #include "mem_window.h" |
| 26 | +#endif |
25 | 27 |
|
26 | 28 | #if CONFIG_ACE_V1X_ART_COUNTER || CONFIG_ACE_V1X_RTC_COUNTER |
27 | 29 | #include <zephyr/device.h> |
@@ -505,6 +507,30 @@ int schedulers_info_get(uint32_t *data_off_size, |
505 | 507 | return 0; |
506 | 508 | } |
507 | 509 |
|
| 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 | + |
508 | 534 | static int basefw_get_large_config(struct comp_dev *dev, |
509 | 535 | uint32_t param_id, |
510 | 536 | bool first_block, |
@@ -580,6 +606,7 @@ static int basefw_set_large_config(struct comp_dev *dev, |
580 | 606 | case IPC4_FW_CONFIG: |
581 | 607 | return basefw_set_fw_config(first_block, last_block, data_offset, data); |
582 | 608 | case IPC4_PERF_MEASUREMENTS_STATE: |
| 609 | + set_perf_meas_state(data); |
583 | 610 | return 0; |
584 | 611 | case IPC4_SYSTEM_TIME: |
585 | 612 | return basefw_set_system_time(param_id, first_block, |
|
0 commit comments