Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry: change performance timing method to ccount #9361

Merged
merged 5 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y
CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK=y

CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=y
CONFIG_TIMING_FUNCTIONS=y
2 changes: 2 additions & 0 deletions app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_MODULES=y
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000

CONFIG_TIMING_FUNCTIONS=y

# Temporary disabled options
CONFIG_TRACE=n
CONFIG_COMP_KPB=y
Expand Down
4 changes: 2 additions & 2 deletions src/audio/component.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ int comp_copy(struct comp_dev *dev)
#endif

#ifdef CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS
const uint32_t begin_stamp = (uint32_t)sof_cycle_get_64();
const uint32_t begin_stamp = (uint32_t)telemetry_timestamp();
#endif

ret = dev->drv->ops.copy(dev);

#ifdef CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS
const uint32_t cycles_consumed = (uint32_t)sof_cycle_get_64() - begin_stamp;
const uint32_t cycles_consumed = (uint32_t)telemetry_timestamp() - begin_stamp;

comp_update_performance_data(dev, cycles_consumed);
#endif
Expand Down
9 changes: 9 additions & 0 deletions src/include/sof/debug/telemetry/telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#define __SOF_TELEMETRY_H__

#include <ipc4/base_fw.h>
#ifdef __ZEPHYR__
#include <zephyr/timing/timing.h>
#endif

/* Slot in memory window 2 (Debug Window) to be used as telemetry slot */
#define SOF_DW_TELEMETRY_SLOT 1
Expand Down Expand Up @@ -85,4 +88,10 @@ struct telemetry_perf_queue {

void telemetry_update(uint32_t begin_ccount, uint32_t current_ccount);

#ifdef CONFIG_TIMING_FUNCTIONS
#define telemetry_timestamp timing_counter_get
#else
#define telemetry_timestamp sof_cycle_get_64
#endif

#endif /*__SOF_TELEMETRY_H__ */
4 changes: 2 additions & 2 deletions src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ static void zephyr_ll_run(void *data)
static void schedule_ll_callback(void *data)
{
#ifdef CONFIG_SOF_TELEMETRY
const uint32_t begin_stamp = (uint32_t)sof_cycle_get_64();
const uint32_t begin_stamp = (uint32_t)telemetry_timestamp();
#endif
zephyr_ll_run(data);
#ifdef CONFIG_SOF_TELEMETRY
const uint32_t current_stamp = (uint32_t)sof_cycle_get_64();
const uint32_t current_stamp = (uint32_t)telemetry_timestamp();

telemetry_update(begin_stamp, current_stamp);
#endif
Expand Down
Loading