Sound Open Firmware
Loading...
Searching...
No Matches
trace.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// Copyright(c) 2020 Intel Corporation. All rights reserved.
4//
5
6#ifndef __SOF_TRACE_TRACE1_H__
7#define __SOF_TRACE_TRACE1_H__
8
9#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_H_
10#include <zephyr/logging/log.h>
11#include <zephyr/sys/printk.h>
12
13/* Level of SOF trace on Zephyr */
14#define SOF_ZEPHYR_TRACE_LEVEL LOG_LEVEL_INF
15
16#endif
17
18/* printk supports uint64_t so use it until LOG is ready */
19#define USE_PRINTK 1
20
21/* SOF trace header */
23
24struct timer;
25uint64_t platform_timer_get(struct timer *timer);
26
27/*
28 * Override SOF mtrace_printf() macro for now to support Zephyr's shared
29 * memory logger. Note the DMA trace can be copied to the shared memory
30 * too thanks to CONFIG_TRACEM.
31 */
32#undef mtrace_printf
33
34#if USE_PRINTK
35#define mtrace_printf(level, format, ...) \
36 do { \
37 if ((level) <= SOF_ZEPHYR_TRACE_LEVEL) \
38 printk("%llu: " format "\n", sof_cycle_get_64(), \
39 ##__VA_ARGS__); \
40 } while (0)
41#else
42#error "TODO: Z_LOG()"
43#endif
44
45#endif /* __INCLUDE_TRACE__ */
uint64_t platform_timer_get(struct timer *timer)