Fix: asoc: Consolidate path trace events
[lttng-modules.git] / instrumentation / events / lttng-module / asoc.h
index 09e1fe272e8e1b92fc70f5cd83bf11b8efbf575c..2e78bc3f6ec6160a052bd2b30deae624f4dbe4ac 100644 (file)
 #define _TRACE_ASOC_DEF
 struct snd_soc_jack;
 struct snd_soc_codec;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
+       LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
 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))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) \
+       || LTTNG_RHEL_KERNEL_RANGE(3,10,0,514,0,0, 3,11,0,0,0,0))
 #define CODEC_NAME_FIELD component.name
 #define CODEC_ID_FIELD component.id
 #else
@@ -29,6 +34,7 @@ struct snd_soc_dapm_widget;
 #define CODEC_ID_FIELD id
 #endif
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
 /*
  * Log register events
  */
@@ -68,8 +74,10 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_read,
        TP_ARGS(codec, reg, val)
 
 )
+#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
+       LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_preg,
 
        TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
@@ -231,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,
@@ -267,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,
This page took 0.026169 seconds and 4 git commands to generate.