ASoC: SOF: trace: Add runtime trace filtering mechanism
Subsystems (3)
Kai Vehmanen
reviewerPATCH 1/1 ASoC: SOF: trace: Add runtime trace filtering mechanism
From: Karol Trzcinski <[email protected]>
The "filter" debugfs file defines the log levels used by the firmware and reported by sof-logger.
The file contains the formatted entry list, where each entry follows the following syntax in plain text:log_level uuid_id pipe_id comp_id;
This file may be updated by userspace applications such sof-logger, or directly by the user during debugging process.
An unused (wildcard) pipe_id or comp_id value should be set to -1, uuid_id is hexadecimal value, so when unused then should be set to 0.
When the file is modified, an IPC command is sent to FW with new trace levels for selected components in filter elements list.
--- include/sound/sof/header.h | 1 + include/sound/sof/trace.h | 28 +++++ sound/soc/sof/trace.c | 224 +++++++++++++++++++++++++++++++++++++ 3 files changed, 253 insertions(+)
include/sound/sof/header.h +1 -0
@@ -118,6 +118,7 @@#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001)#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002)#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003) +#define SOF_IPC_TRACE_FILTER_UPDATE SOF_CMD_TYPE(0x004)/**< ABI3.17 */ /* debug */ #define SOF_IPC_DEBUG_MEM_USAGE SOF_CMD_TYPE(0x001)
include/sound/sof/trace.h +28 -0
@@ -43,6 +43,34 @@ struct sof_ipc_dma_trace_posn {uint32_t messages;/* total trace messages */ } __packed; +/* Values used in sof_ipc_trace_filter_elem: */ + +/* bits 6..0 */ +#define SOF_IPC_TRACE_FILTER_ELEM_SET_LEVEL 0x01/**< trace level for selected components */ +#define SOF_IPC_TRACE_FILTER_ELEM_BY_UUID 0x02/**< filter by uuid key */ +#define SOF_IPC_TRACE_FILTER_ELEM_BY_PIPE 0x03/**< filter by pipeline */ +#define SOF_IPC_TRACE_FILTER_ELEM_BY_COMP 0x04/**< filter by component id */ + +/* bit 7 */ +#define SOF_IPC_TRACE_FILTER_ELEM_FIN 0x80/**< mark last filter in set */ + +/* bits 31..8: Unused */ + +/** part of sof_ipc_trace_filter, ABI3.17 */ +struct sof_ipc_trace_filter_elem { +uint32_t key;/**< SOF_IPC_TRACE_FILTER_ELEM_ {LEVEL, UUID, COMP, PIPE} */ +uint32_t value;/**< element value */ +} __packed; + +/** Runtime tracing filtration data - SOF_IPC_TRACE_FILTER_UPDATE, ABI3.17 */ +struct sof_ipc_trace_filter { +struct sof_ipc_cmd_hdr hdr;/**< IPC command header */ +uint32_t elem_cnt;/**< number of entries in elems[] array */ +uint32_t reserved[8 ];/**< reserved for future usage */ +/** variable size array with new filtering settings */ +struct sof_ipc_trace_filter_elem elems[]; +} __packed; +/* * Commom debug */
sound/soc/sof/trace.c +224 -0
240 lines not on this page · raw message
Signature · 1 line
2.28.0
Mark Brown
maintainerQuoted 8 lines · Kai Vehmanen
The "filter" debugfs file defines the log levels used by the firmware and reported by sof-logger.
The file contains the formatted entry list, where each entry follows the following syntax in plain text:
log_leveluuid_idpipe_idcomp_id;[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: trace: Add runtime trace filtering mechanism
commit: 8f6cfbb6d4272635311b4604194e39172e7719ad
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark