Skip to content

Commit 3cce247

Browse files
tobonexkv2019i
authored andcommitted
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>
1 parent 9d1177a commit 3cce247

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/include/sof/debug/telemetry/telemetry.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#define __SOF_TELEMETRY_H__
88

99
#include <ipc4/base_fw.h>
10+
#ifdef __ZEPHYR__
11+
#include <zephyr/timing/timing.h>
12+
#endif
1013

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

8689
void telemetry_update(uint32_t begin_ccount, uint32_t current_ccount);
8790

91+
#ifdef CONFIG_TIMING_FUNCTIONS
92+
#define telemetry_timestamp timing_counter_get
93+
#else
94+
#define telemetry_timestamp sof_cycle_get_64
95+
#endif
96+
8897
#endif /*__SOF_TELEMETRY_H__ */

0 commit comments

Comments
 (0)