[lttng-dev] [PATCH lttng-modules 2/6] Fix: asoc: Consolidate path trace events

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


See upstream commit:

  commit 6e588a0d839b51bae49852b68740a25cacc91978
  Author: Lars-Peter Clausen <lars at metafoo.de>
  Date:   Tue Aug 11 21:38:01 2015 +0200

    ASoC: dapm: Consolidate path trace events

    The snd_soc_dapm_input_path and snd_soc_dapm_output_path trace events are
    identical except for the direction. Instead of having two events have a
    single one that has a field that contains the direction.

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

diff --git a/instrumentation/events/lttng-module/asoc.h b/instrumentation/events/lttng-module/asoc.h
index 7eee035..2e78bc3 100644
--- a/instrumentation/events/lttng-module/asoc.h
+++ b/instrumentation/events/lttng-module/asoc.h
@@ -20,6 +20,9 @@ struct snd_soc_platform;
 #endif
 struct snd_soc_card;
 struct snd_soc_dapm_widget;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+struct snd_soc_dapm_path;
+#endif
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) \
@@ -236,7 +239,27 @@ LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done,
 )
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path,
+
+	asoc_snd_soc_dapm_path,
+
+	TP_PROTO(struct snd_soc_dapm_widget *widget,
+		enum snd_soc_dapm_direction dir,
+		struct snd_soc_dapm_path *path),
+
+	TP_ARGS(widget, dir, path),
+
+	TP_FIELDS(
+		ctf_string(wname, widget->name)
+		ctf_string(pname, path->name ? path->name : DAPM_DIRECT)
+		ctf_string(pnname, path->node[dir]->name)
+		ctf_integer(int, path_node, (long) path->node[dir])
+		ctf_integer(int, path_connect, path->connect)
+		ctf_integer(int, path_dir, dir)
+	)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path,
 
 	asoc_snd_soc_dapm_output_path,
@@ -272,7 +295,9 @@ LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path,
 		ctf_integer(int, path_connect, path->connect)
 	)
 )
+#endif
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected,
 
 	asoc_snd_soc_dapm_connected,
-- 
2.17.1



More information about the lttng-dev mailing list