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
15#ifndef __IPC_TRACE_H__
16#define __IPC_TRACE_H__
17
18#include <ipc/header.h>
19#include <ipc/stream.h>
20#include <stdint.h>
21
23#define SOF_TRACE_FILENAME_SIZE 32
24
33 uint32_t stream_tag;
34} __attribute__((packed, aligned(4)));
35
43 uint32_t stream_tag;
44 uint64_t timestamp_ns;
45 uint32_t reserved[8];
46} __attribute__((packed, aligned(4)));
47
54 uint32_t host_offset;
55 uint32_t overflow;
56 uint32_t messages;
57} __attribute__((packed, aligned(4)));
58
59/* Values used in sof_ipc_trace_filter_elem */
60
61/* bits 6..0 */
62#define SOF_IPC_TRACE_FILTER_ELEM_SET_LEVEL 0x01
63#define SOF_IPC_TRACE_FILTER_ELEM_BY_UUID 0x02
64#define SOF_IPC_TRACE_FILTER_ELEM_BY_COMP 0x03
65#define SOF_IPC_TRACE_FILTER_ELEM_BY_PIPE 0x04
66#define SOF_IPC_TRACE_FILTER_ELEM_TYPE_MASK 0x7F
68/* bit 7 */
69#define SOF_IPC_TRACE_FILTER_ELEM_FIN 0x80
71/* bits 31..8: Unused */
72
75 int32_t key;
76 int32_t value;
77} __attribute__((packed, aligned(4)));
78
82 uint32_t elem_cnt;
83 uint32_t reserved[8];
86} __attribute__((packed, aligned(4)));
87
88/*
89 * Commom debug
90 */
91
96#define SOF_IPC_PANIC_MAGIC 0x0dead000
97#define SOF_IPC_PANIC_MAGIC_MASK 0x0ffff000
98#define SOF_IPC_PANIC_CODE_MASK 0x00000fff
100#define SOF_IPC_PANIC_MEM (SOF_IPC_PANIC_MAGIC | 0x0)
101#define SOF_IPC_PANIC_WORK (SOF_IPC_PANIC_MAGIC | 0x1)
102#define SOF_IPC_PANIC_IPC (SOF_IPC_PANIC_MAGIC | 0x2)
103#define SOF_IPC_PANIC_ARCH (SOF_IPC_PANIC_MAGIC | 0x3)
104#define SOF_IPC_PANIC_PLATFORM (SOF_IPC_PANIC_MAGIC | 0x4)
105#define SOF_IPC_PANIC_TASK (SOF_IPC_PANIC_MAGIC | 0x5)
106#define SOF_IPC_PANIC_EXCEPTION (SOF_IPC_PANIC_MAGIC | 0x6)
107#define SOF_IPC_PANIC_DEADLOCK (SOF_IPC_PANIC_MAGIC | 0x7)
108#define SOF_IPC_PANIC_STACK (SOF_IPC_PANIC_MAGIC | 0x8)
109#define SOF_IPC_PANIC_IDLE (SOF_IPC_PANIC_MAGIC | 0x9)
110#define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa)
111#define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb)
120 uint32_t code;
122 uint32_t linenum;
123} __attribute__((packed, aligned(4)));
124
125#endif /* __IPC_TRACE_H__ */
IPC command header.
#define SOF_TRACE_FILENAME_SIZE
Maximum filename string length embedded in panic reports.
Definition trace.h:23
Command Header - Header for all IPC commands.
Definition header.h:357
Extended host DMA trace parameters payload (SOF_IPC_TRACE_DMA_PARAMS_EXT).
Definition trace.h:40
uint32_t reserved[8]
Reserved for future expansion.
Definition trace.h:45
uint32_t stream_tag
Assigned host DMA stream tag.
Definition trace.h:43
struct sof_ipc_host_buffer buffer
Host-allocated circular buffer descriptor.
Definition trace.h:42
uint64_t timestamp_ns
Host wallclock timestamp at synchronization point in ns.
Definition trace.h:44
struct sof_ipc_cmd_hdr hdr
IPC command header.
Definition trace.h:41
Legacy host DMA trace parameters payload (SOF_IPC_TRACE_DMA_PARAMS).
Definition trace.h:30
uint32_t stream_tag
Assigned host DMA stream tag.
Definition trace.h:33
struct sof_ipc_host_buffer buffer
Host-allocated circular buffer descriptor.
Definition trace.h:32
struct sof_ipc_cmd_hdr hdr
IPC command header.
Definition trace.h:31
DMA trace circular buffer position report sent to host (SOF_IPC_TRACE_DMA_POSITION).
Definition trace.h:52
struct sof_ipc_reply rhdr
IPC reply header.
Definition trace.h:53
uint32_t overflow
Cumulative count of dropped bytes due to buffer overflow.
Definition trace.h:55
uint32_t host_offset
Current write offset in host DMA buffer in bytes.
Definition trace.h:54
uint32_t messages
Total trace messages processed since boot.
Definition trace.h:56
Structure Header - Header for all IPC structures except command structs.
Definition header.h:347
Definition stream.h:63
DSP panic crash dump descriptor reported to host.
Definition trace.h:118
uint32_t code
Panic classification code (SOF_IPC_PANIC_*)
Definition trace.h:120
uint32_t linenum
Source line number where panic occurred.
Definition trace.h:122
struct sof_ipc_hdr hdr
IPC base header.
Definition trace.h:119
char filename[SOF_TRACE_FILENAME_SIZE]
Source filename where panic occurred.
Definition trace.h:121
Generic reply message.
Definition header.h:366
part of sof_ipc_trace_filter, ABI3.17
Definition trace.h:74
int32_t value
element value
Definition trace.h:76
int32_t key
SOF_IPC_TRACE_FILTER_ELEM_ {LEVEL, UUID, COMP, PIPE}.
Definition trace.h:75
Runtime tracing filtration data - SOF_IPC_TRACE_FILTER_UPDATE, ABI3.17.
Definition trace.h:80
struct sof_ipc_trace_filter_elem elems[]
variable size array with new filtering settings
Definition trace.h:85
struct sof_ipc_cmd_hdr hdr
IPC command header.
Definition trace.h:81
uint32_t elem_cnt
number of entries in elems[] array
Definition trace.h:82
uint32_t reserved[8]
reserved for future usage
Definition trace.h:83