Skip to content

Commit

Permalink
ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value
Browse files Browse the repository at this point in the history
The string SND_SOC_DAPM_DIR_OUT is printed in the snd_soc_dapm_path trace
event instead of its value:

   (((REC->path_dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")

User space cannot parse this, as it has no idea what SND_SOC_DAPM_DIR_OUT
is. Use TRACE_DEFINE_ENUM() to convert it to its value:

   (((REC->path_dir) == 1) ? "->" : "<-")

So that user space tools, such as perf and trace-cmd, can parse it
correctly.

Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Fixes: 6e588a0 ("ASoC: dapm: Consolidate path trace events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20240416000303.04670cdf@rorschach.local.home
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
rostedt authored and broonie committed Apr 16, 2024
1 parent 62c48dd commit 58300f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/trace/events/asoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define DAPM_DIRECT "(direct)"
#define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")

TRACE_DEFINE_ENUM(SND_SOC_DAPM_DIR_OUT);

struct snd_soc_jack;
struct snd_soc_card;
struct snd_soc_dapm_widget;
Expand Down

0 comments on commit 58300f8

Please sign in to comment.