forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrace.h
More file actions
45 lines (35 loc) · 1.05 KB
/
trace.h
File metadata and controls
45 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2020 Intel Corporation. All rights reserved.
//
#ifndef __SOF_TRACE_TRACE1_H__
#define __SOF_TRACE_TRACE1_H__
#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_H_
#include <zephyr/logging/log.h>
#include <zephyr/sys/printk.h>
/* Level of SOF trace on Zephyr */
#define SOF_ZEPHYR_TRACE_LEVEL LOG_LEVEL_INF
#endif
/* printk supports uint64_t so use it until LOG is ready */
#define USE_PRINTK 1
/* SOF trace header */
#include "../../../../src/include/sof/trace/trace.h"
struct timer;
uint64_t platform_timer_get(struct timer *timer);
/*
* Override SOF mtrace_printf() macro for now to support Zephyr's shared
* memory logger. Note the DMA trace can be copied to the shared memory
* too thanks to CONFIG_TRACEM.
*/
#undef mtrace_printf
#if USE_PRINTK
#define mtrace_printf(level, format, ...) \
do { \
if ((level) <= SOF_ZEPHYR_TRACE_LEVEL) \
printk("%llu: " format "\n", sof_cycle_get_64(), \
##__VA_ARGS__); \
} while (0)
#else
#error "TODO: Z_LOG()"
#endif
#endif /* __INCLUDE_TRACE__ */