Skip to contentSkip to conversation

Fix: asoc: Consolidate path trace events

PATCH New Michael Jeanson 2 participants 6 messages Jun 18, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/6 Fix: asoc: Consolidate path trace events

See upstream commit:

commit 6e588a0d839b51bae49852b68740a25cacc91978
Author: Lars-Peter Clausen <[email protected]>
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.

---
 instrumentation/events/lttng-module/asoc.h | 27 +++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/asoc.h +26 -1
index 7eee035..2e78bc3 100644
@@ -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,
Signature · 6 lines
2.17.1

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#2 lore raw

PATCH 3/6 Fix: asoc: fix printing jack name

In reply to a message not in the archive

See upstream commit:

commit f4833a519aec793cf8349bf479589d37473ef6a7
Author: Arnd Bergmann <[email protected]>
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.

---
 instrumentation/events/lttng-module/asoc.h | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
instrumentation/events/lttng-module/asoc.h +31 -0
index 2e78bc3..dd5a066 100644
@@ -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,
 
Signature · 6 lines
2.17.1

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#3 lore raw

PATCH 4/6 Fix: asoc: Remove snd_soc_cache_sync() implementation

In reply to a message not in the archive

See upstream commit:

commit 427d204c86e095bb91eb8af381bd90a48376a860
Author: Lars-Peter Clausen <[email protected]>
Date: Sat Nov 8 16:38:07 2014 +0100

ASoC: Remove snd_soc_cache_sync() implementation

This function has no more non regmap user, which means we can remove the implementation of the function and associated functions and structure fields.

For convenience we keep a static inline version of the function that forwards calls to regcache_sync() unconditionally.

---
 instrumentation/events/lttng-module/asoc.h | 4 ++++
 1 file changed, 4 insertions(+)
instrumentation/events/lttng-module/asoc.h +4 -0
index dd5a066..4c5833c 100644
@@ -13,7 +13,9 @@
 #ifndef _TRACE_ASOC_DEF
 #define _TRACE_ASOC_DEF
 struct snd_soc_jack;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
 struct snd_soc_codec;
+#endif
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
 	LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
 struct snd_soc_platform;
@@ -386,6 +388,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify,
 )
 #endif
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync,
 
 	asoc_snd_soc_cache_sync,
@@ -402,6 +405,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync,
 		ctf_integer(int, id, codec->CODEC_ID_FIELD)
 	)
 )
+#endif
 
 #endif /* LTTNG_TRACE_ASOC_H */
 
Signature · 6 lines
2.17.1

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#4 lore raw

PATCH 5/6 Fix: btrfs: use fs_info for btrfs_handle_em_exist tracepoint

In reply to a message not in the archive

See upstream commit:

commit f46b24c9457143a367c6707eac82d546e2bcf280
Author: David Sterba <[email protected]>
Date: Tue Apr 3 21:45:57 2018 +0200

btrfs: use fs_info for btrfs_handle_em_exist tracepoint

We really want to know to which filesystem the extent map events belong, but as it cannot be reached from the extent_map pointers, we need to pass it down the callchain.

---
 instrumentation/events/lttng-module/btrfs.h | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/btrfs.h +20 -1
index 20b100e..75cc73b 100644
@@ -273,7 +273,26 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
 
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
+LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
+
+	TP_PROTO(struct btrfs_fs_info *fs_info,
+		const struct extent_map *existing, const struct extent_map *map,
+		u64 start, u64 len),
+
+	TP_ARGS(fs_info, existing, map, start, len),
+
+	TP_FIELDS(
+		ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
+		ctf_integer(u64, e_start, existing->start)
+		ctf_integer(u64, e_len, existing->len)
+		ctf_integer(u64, map_start, map->start)
+		ctf_integer(u64, map_len, map->len)
+		ctf_integer(u64, start, start)
+		ctf_integer(u64, len, len)
+	)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
 LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
 
 	TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len),
Signature · 6 lines
2.17.1

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#5 lore raw

PATCH 6/6 Fix: btrfs: Remove unnecessary fs_info parameter

In reply to a message not in the archive

See upstream commit:

commit 3dca5c942dac60164e6a6e89172f25b86af07ce7
Author: Qu Wenruo <[email protected]>
Date: Thu Apr 26 14:24:25 2018 +0800

btrfs: trace: Remove unnecessary fs_info parameter for btrfs__reserve_extent event class

fs_info can be extracted from btrfs_block_group_cache, and all btrfs_block_group_cache is created by btrfs_create_block_group_cache() with fs_info initialized, no need to worry about NULL pointer dereference.

---
 instrumentation/events/lttng-module/btrfs.h | 54 ++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/btrfs.h +53 -1
index 75cc73b..fd1b6b8 100644
@@ -1658,8 +1658,57 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent,  btrfs_reserved_extent_f
 
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+	btrfs_find_free_extent,
+
+	TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
+		 u64 data),
+
+	TP_ARGS(info, num_bytes, empty_size, data),
+
+	TP_FIELDS(
+		ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
+		ctf_integer(u64, num_bytes, num_bytes)
+		ctf_integer(u64, empty_size, empty_size)
+		ctf_integer(u64, data, data)
+	)
+)
+
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
+
+	TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
+		 u64 len),
+
+	TP_ARGS(block_group, start, len),
+
+	TP_FIELDS(
+		ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE)
+		ctf_integer(u64, bg_objectid, block_group->key.objectid)
+		ctf_integer(u64, flags, block_group->flags)
+		ctf_integer(u64, start, start)
+		ctf_integer(u64, len, len)
+	)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
+
+	TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
+		 u64 len),
+
+	TP_ARGS(block_group, start, len)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
+
+	TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
+		 u64 len),
+
+	TP_ARGS(block_group, start, len)
+)
 
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
 
 	btrfs_find_free_extent,
@@ -1670,6 +1719,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
 	TP_ARGS(info, num_bytes, empty_size, data),
 
 	TP_FIELDS(
+		ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
 		ctf_integer(u64, num_bytes, num_bytes)
 		ctf_integer(u64, empty_size, empty_size)
 		ctf_integer(u64, data, data)
@@ -1685,6 +1735,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 	TP_ARGS(info, block_group, start, len),
 
 	TP_FIELDS(
+		ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
 		ctf_integer(u64, bg_objectid, block_group->key.objectid)
 		ctf_integer(u64, flags, block_group->flags)
 		ctf_integer(u64, start, start)
@@ -1722,6 +1773,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
 	TP_ARGS(info, num_bytes, empty_size, data),
 
 	TP_FIELDS(
+		ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
 		ctf_integer(u64, num_bytes, num_bytes)
 		ctf_integer(u64, empty_size, empty_size)
 		ctf_integer(u64, data, data)
Signature · 6 lines
2.17.1

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#6 lore raw

Re: [PATCH lttng-modules 1/6] Fix: ASoC level IO tracing removed upstream

In reply to a message not in the archive

Patches 1-6 merged into master,
Patches 1-4, 6 merged into stable-2.10,

Thanks!

Mathieu

Quoted 59 lines · ----- On Jun 18, 2018, at 2:53 PM, Michael Jeanson [email protected] wrote:

Removed in v3.16.

See upstream commits:

Author: Lars-Peter Clausen <[email protected]>
Date: Tue Apr 22 13:23:17 2014 +0200

ASoC: Remove ASoC level IO tracing

The ASoC framework is in the process of migrating all IO operations to regmap. regmap has its own more sophisticated tracing infrastructure for IO operations, which means that the ASoC level IO tracing becomes redundant, hence this patch removes them. There are still a handful of ASoC drivers left that do not use regmap yet, but hopefully the removal of the ASoC IO tracing will be an additional incentive to switch to regmap.

---
instrumentation/events/lttng-module/asoc.h | 8 ++++++--

1 file changed, 6 insertions(+), 2 deletions(-)
instrumentation/events/lttng-module/asoc.h +6 -2
index 25136ec..7eee035 100644
@@ -14,7 +14,8 @@
 #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;
@@ -30,6 +31,7 @@ struct snd_soc_dapm_widget;
 #define CODEC_ID_FIELD id
 #endif
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
 /*
 * Log register events
 */
@@ -69,8 +71,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,
--
2.17.1

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev