[lttng-dev] [PATCH lttng-modules 3/6] Fix: asoc: fix printing jack name

Michael Jeanson mjeanson at efficios.com
Mon Jun 18 14:53:16 EDT 2018


See upstream commit:

  commit f4833a519aec793cf8349bf479589d37473ef6a7
  Author: Arnd Bergmann <arnd at arndb.de>
  Date:   Wed Feb 24 17:38:14 2016 +0100

    ASoC: trace: fix printing jack name

    After a change to the snd_jack structure, the 'name' member
    is no longer available in all configurations, which results in a
    build failure in the tracing code:

    include/trace/events/asoc.h: In function 'trace_event_raw_event_snd_soc_jack_report':
    include/trace/events/asoc.h:240:32: error: 'struct snd_jack' has no member named 'name'

    The name field is normally initialized from the card shortname and
    the jack "id" field:

            snprintf(jack->name, sizeof(jack->name), "%s %s",
                     card->shortname, jack->id);

    This changes the tracing output to just contain the 'id' by
    itself, which slightly changes the output format but avoids the
    link error and is hopefully still enough to see what is going on.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 instrumentation/events/lttng-module/asoc.h | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/instrumentation/events/lttng-module/asoc.h b/instrumentation/events/lttng-module/asoc.h
index 2e78bc3..dd5a066 100644
--- a/instrumentation/events/lttng-module/asoc.h
+++ b/instrumentation/events/lttng-module/asoc.h
@@ -326,6 +326,36 @@ LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq,
 	)
 )
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report,
+
+	asoc_snd_soc_jack_report,
+
+	TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
+
+	TP_ARGS(jack, mask, val),
+
+	TP_FIELDS(
+		ctf_string(name, jack->jack->id)
+		ctf_integer(int, mask, mask)
+		ctf_integer(int, val, val)
+	)
+)
+
+LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify,
+
+	asoc_snd_soc_jack_notify,
+
+	TP_PROTO(struct snd_soc_jack *jack, int val),
+
+	TP_ARGS(jack, val),
+
+	TP_FIELDS(
+		ctf_string(name, jack->jack->id)
+		ctf_integer(int, val, val)
+	)
+)
+#else
 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report,
 
 	asoc_snd_soc_jack_report,
@@ -354,6 +384,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify,
 		ctf_integer(int, val, val)
 	)
 )
+#endif
 
 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync,
 
-- 
2.17.1



More information about the lttng-dev mailing list