telemetry: add abstraction to time measurement

Adds abstract function to change time source for performance measurement
via config.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
This commit is contained in:
Tobiasz Dryjanski 2024-08-09 16:10:22 +02:00 committed by Kai Vehmanen
parent 9d1177acf4
commit 3cce247d84
1 changed files with 9 additions and 0 deletions

View File

@ -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
@ -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__ */