Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 */
8
9#ifndef __INCLUDE_UAPI_SOUND_SOF_USER_TRACE_H__
10#define __INCLUDE_UAPI_SOUND_SOF_USER_TRACE_H__
11
12/*
13 * Host system time.
14 *
15 * This property is used by the driver to pass down information about
16 * current system time. It is expressed in us.
17 * FW translates timestamps (in log entries, probe pockets) to this time
18 * domain.
19 *
20 * (cavs: SystemTime).
21 */
22struct system_time {
23 uint32_t val_l; /* Lower dword of current host time value */
24 uint32_t val_u; /* Upper dword of current host time value */
25} __packed;
26
27#define LOG_ENABLE 1 /* Enable logging */
28#define LOG_DISABLE 0 /* Disable logging */
29
30#define LOG_LEVEL_CRITICAL 1 /* (FDK fatal) */
31#define LOG_LEVEL_VERBOSE 2
32
33/*
34 * Layout of a log fifo.
35 */
36struct log_buffer_layout {
37 uint32_t read_ptr; /*read pointer */
38 uint32_t write_ptr; /* write pointer */
39 uint32_t buffer[0]; /* buffer */
40} __packed;
41
42/*
43 * Log buffer status reported by FW.
44 */
45struct log_buffer_status {
46 uint32_t core_id; /* ID of core that logged to other half */
47} __packed;
48
49#define TRACE_ID_LENGTH 12
50
51/*
52 * Log entry header.
53 *
54 * The header is followed by an array of arguments (uint32_t[]).
55 * Number of arguments is specified by the params_num field of log_entry
56 */
57struct log_entry_header {
58 uint32_t id_0 : TRACE_ID_LENGTH; /* e.g. Pipeline ID */
59 uint32_t id_1 : TRACE_ID_LENGTH; /* e.g. Component ID */
60 uint32_t core_id : 8; /* Reporting core's id */
61
62 uint64_t timestamp; /* Timestamp (in dsp ticks) */
63 uint32_t log_entry_address; /* Address of log entry in ELF */
64} __packed;
65
66#endif