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) 2018 Intel Corporation. All rights reserved.
4 *
5 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
6 * Keyon Jie <yang.jie@linux.intel.com>
7 */
8
16
17#ifndef __IPC_TRACE_H__
18#define __IPC_TRACE_H__
19
20#include <ipc/header.h>
21#include <ipc/stream.h>
22#include <stdint.h>
23
24/*
25 * DMA for Trace
26 */
27
28#define SOF_TRACE_FILENAME_SIZE 32
29
30/* DMA for Trace params info - SOF_IPC_TRACE_DMA_PARAMS */
31/* Deprecated - use sof_ipc_dma_trace_params_ext */
35 uint32_t stream_tag;
36} __attribute__((packed, aligned(4)));
37
38/* DMA for Trace params info - SOF_IPC_TRACE_DMA_PARAMS_EXT */
42 uint32_t stream_tag;
43 uint64_t timestamp_ns; /* in nanosecnd */
44 uint32_t reserved[8];
45} __attribute__((packed, aligned(4)));
46
47/* DMA for Trace params info - SOF_IPC_TRACE_DMA_POSITION */
50 uint32_t host_offset; /* Offset of DMA host buffer */
51 uint32_t overflow; /* overflow bytes if any */
52 uint32_t messages; /* total trace messages */
53} __attribute__((packed, aligned(4)));
54
55/* Values used in sof_ipc_trace_filter_elem */
56
57/* bits 6..0 */
58#define SOF_IPC_TRACE_FILTER_ELEM_SET_LEVEL 0x01
59#define SOF_IPC_TRACE_FILTER_ELEM_BY_UUID 0x02
60#define SOF_IPC_TRACE_FILTER_ELEM_BY_COMP 0x03
61#define SOF_IPC_TRACE_FILTER_ELEM_BY_PIPE 0x04
62#define SOF_IPC_TRACE_FILTER_ELEM_TYPE_MASK 0x7F
63
64/* bit 7 */
65#define SOF_IPC_TRACE_FILTER_ELEM_FIN 0x80
66
67/* bits 31..8: Unused */
68
71 int32_t key;
72 int32_t value;
73} __attribute__((packed, aligned(4)));
74
78 uint32_t elem_cnt;
79 uint32_t reserved[8];
82} __attribute__((packed, aligned(4)));
83
84/*
85 * Commom debug
86 */
87
88/*
89 * SOF panic codes
90 */
91#define SOF_IPC_PANIC_MAGIC 0x0dead000
92#define SOF_IPC_PANIC_MAGIC_MASK 0x0ffff000
93#define SOF_IPC_PANIC_CODE_MASK 0x00000fff
94
95#define SOF_IPC_PANIC_MEM (SOF_IPC_PANIC_MAGIC | 0x0)
96#define SOF_IPC_PANIC_WORK (SOF_IPC_PANIC_MAGIC | 0x1)
97#define SOF_IPC_PANIC_IPC (SOF_IPC_PANIC_MAGIC | 0x2)
98#define SOF_IPC_PANIC_ARCH (SOF_IPC_PANIC_MAGIC | 0x3)
99#define SOF_IPC_PANIC_PLATFORM (SOF_IPC_PANIC_MAGIC | 0x4)
100#define SOF_IPC_PANIC_TASK (SOF_IPC_PANIC_MAGIC | 0x5)
101#define SOF_IPC_PANIC_EXCEPTION (SOF_IPC_PANIC_MAGIC | 0x6)
102#define SOF_IPC_PANIC_DEADLOCK (SOF_IPC_PANIC_MAGIC | 0x7)
103#define SOF_IPC_PANIC_STACK (SOF_IPC_PANIC_MAGIC | 0x8)
104#define SOF_IPC_PANIC_IDLE (SOF_IPC_PANIC_MAGIC | 0x9)
105#define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa)
106#define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb)
107
108/* panic info include filename and line number
109 * filename array will not include null terminator if fully filled
110 */
113 uint32_t code; /* SOF_IPC_PANIC_ */
115 uint32_t linenum;
116} __attribute__((packed, aligned(4)));
117
118#endif /* __IPC_TRACE_H__ */
IPC command header.
IPC definitions for streams.
#define SOF_TRACE_FILENAME_SIZE
Definition trace.h:28
Command Header - Header for all IPC commands.
Definition header.h:357
Definition trace.h:39
uint32_t reserved[8]
Definition trace.h:44
uint32_t stream_tag
Definition trace.h:42
struct sof_ipc_host_buffer buffer
Definition trace.h:41
uint64_t timestamp_ns
Definition trace.h:43
struct sof_ipc_cmd_hdr hdr
Definition trace.h:40
Definition trace.h:32
uint32_t stream_tag
Definition trace.h:35
struct sof_ipc_host_buffer buffer
Definition trace.h:34
struct sof_ipc_cmd_hdr hdr
Definition trace.h:33
Definition trace.h:48
struct sof_ipc_reply rhdr
Definition trace.h:49
uint32_t overflow
Definition trace.h:51
uint32_t host_offset
Definition trace.h:50
uint32_t messages
Definition trace.h:52
Structure Header - Header for all IPC structures except command structs.
Definition header.h:347
Definition stream.h:63
Definition trace.h:111
uint32_t code
Definition trace.h:113
uint32_t linenum
Definition trace.h:115
struct sof_ipc_hdr hdr
Definition trace.h:112
char filename[SOF_TRACE_FILENAME_SIZE]
Definition trace.h:114
Generic reply message.
Definition header.h:366
part of sof_ipc_trace_filter, ABI3.17
Definition trace.h:70
int32_t value
element value
Definition trace.h:72
int32_t key
SOF_IPC_TRACE_FILTER_ELEM_ {LEVEL, UUID, COMP, PIPE}.
Definition trace.h:71
Runtime tracing filtration data - SOF_IPC_TRACE_FILTER_UPDATE, ABI3.17.
Definition trace.h:76
struct sof_ipc_trace_filter_elem elems[]
variable size array with new filtering settings
Definition trace.h:81
struct sof_ipc_cmd_hdr hdr
IPC command header.
Definition trace.h:77
uint32_t elem_cnt
number of entries in elems[] array
Definition trace.h:78
uint32_t reserved[8]
reserved for future usage
Definition trace.h:79