From d7921a5faa41a160c2679bb130e31c79ee8641f2 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 22 Mar 2018 17:33:32 -0400 Subject: [PATCH] Fix: btrfs instrumentation namespacing Trips this warning: [ 122.301894] WARNING: CPU: 6 PID: 1654 at /home/efficios/git/lttng-modules/lttng-probes.c:99 fixup_lazy_probes+0x195/0x200 [lttng_tracer] [ 122.304974] Modules linked in: lttng_probe_compaction(O+) lttng_probe_btrfs(O) lttng_probe_block(O) lttng_ring_buffer_metadata_mmap_client(O) lttng_ring_buffer_client_mmap_overwrite(O) lttng_ring_buffer_client_mmap_discard(O) lttng_ring_buffer_metadata_client(O) lttng_ring_buffer_client_overwrite(O) lttng_ring_buffer_client_discard(O) lttng_tracer(O) lttng_statedump(O) lttng_ftrace(O) lttng_kprobes(O) lttng_clock(O) lttng_lib_ring_buffer(O) lttng_kretprobes(O) [ 122.314772] CPU: 6 PID: 1654 Comm: modprobe Tainted: G O 4.16.0-rc6+ #54 [ 122.316738] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 122.320280] RIP: 0010:fixup_lazy_probes+0x195/0x200 [lttng_tracer] [ 122.321825] RSP: 0018:ffffc90008467ca0 EFLAGS: 00010286 [ 122.323137] RAX: 00000000ffffffff RBX: ffffffffa01e7000 RCX: 0000000000000061 [ 122.324847] RDX: 0000000000000005 RSI: ffffffffa01e21ac RDI: ffffffffa01e233b [ 122.326528] RBP: ffffffffa017f078 R08: 0000000000000062 R09: 0000000000000345 [ 122.328154] R10: 0000000000000000 R11: ffffc90008467a28 R12: 0000000000000005 [ 122.329791] R13: 0000000000000010 R14: 0000000000000010 R15: 0000000000000006 [ 122.331410] FS: 00007f6c8d9a7740(0000) GS:ffff880c0fb80000(0000) knlGS:0000000000000000 [ 122.333323] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 122.334673] CR2: 00007ffcc9698ff8 CR3: 0000000c0afae004 CR4: 00000000001606e0 [ 122.336300] Call Trace: [ 122.337011] ? __event_probe__compaction_migratepages+0x250/0x250 [lttng_probe_compaction] [ 122.338901] lttng_get_probe_list_head.part.2+0x19/0x20 [lttng_tracer] [ 122.340349] lttng_probe_register+0xd5/0xe0 [lttng_tracer] [ 122.341607] ? __event_probe__compaction_migratepages+0x250/0x250 [lttng_probe_compaction] [ 122.343453] do_one_initcall+0x3d/0x16e [ 122.344383] ? _cond_resched+0x15/0x30 [ 122.345323] ? kmem_cache_alloc_trace+0xe1/0x1b0 [ 122.346394] ? do_init_module+0x22/0x20c [ 122.347329] do_init_module+0x5a/0x20c [ 122.350037] load_module+0x244f/0x2980 [ 122.350958] ? m_show+0x190/0x190 [ 122.351774] ? security_capable+0x41/0x60 [ 122.352723] SYSC_finit_module+0x80/0xb0 [ 122.353716] do_syscall_64+0x76/0x1a0 [ 122.354565] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [ 122.355669] RIP: 0033:0x7f6c8d4c73c9 [ 122.356502] RSP: 002b:00007ffcc969c248 EFLAGS: 00000206 ORIG_RAX: 0000000000000139 [ 122.358209] RAX: ffffffffffffffda RBX: 000055763df4fee9 RCX: 00007f6c8d4c73c9 [ 122.359684] RDX: 0000000000000000 RSI: 000055763df4fee9 RDI: 0000000000000004 [ 122.361182] RBP: 0000000000000000 R08: 0000000000000000 R09: 000055763f39a450 [ 122.362663] R10: 0000000000000004 R11: 0000000000000206 R12: 000055763f392400 [ 122.364144] R13: 000055763f396cb0 R14: 000055763f3925a0 R15: 0000000000040000 [ 122.365690] Code: 25 14 a0 4a 8b 04 f0 48 8b 30 31 c0 e8 25 3b 10 e1 48 8b 43 08 48 8b 33 4c 89 e2 4a 8b 04 f0 48 8b 38 e8 9f b7 b1 e1 85 c0 74 07 <0f> 0b e9 b3 fe ff ff 48 c7 c7 16 26 14 a0 e8 f8 3a 10 e1 48 8b [ 122.369348] ---[ end trace 15840f1166edf835 ]--- Signed-off-by: Mathieu Desnoyers --- instrumentation/events/lttng-module/btrfs.h | 60 +++++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h index b3bf72c1..4eb0db2f 100644 --- a/instrumentation/events/lttng-module/btrfs.h +++ b/instrumentation/events/lttng-module/btrfs.h @@ -743,7 +743,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, ) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, const struct btrfs_delayed_ref_head *head_ref, @@ -752,7 +756,11 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, TP_ARGS(fs_info, head_ref, action) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, const struct btrfs_delayed_ref_head *head_ref, @@ -780,7 +788,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, ) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, const struct btrfs_delayed_ref_node *ref, @@ -790,7 +802,11 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, TP_ARGS(fs_info, ref, head_ref, action) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, const struct btrfs_delayed_ref_node *ref, @@ -818,7 +834,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, ) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, TP_PROTO(struct btrfs_fs_info *fs_info, struct btrfs_delayed_ref_node *ref, @@ -828,7 +848,11 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, TP_ARGS(fs_info, ref, head_ref, action) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, TP_PROTO(struct btrfs_fs_info *fs_info, struct btrfs_delayed_ref_node *ref, @@ -855,7 +879,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, ) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, TP_PROTO(const struct btrfs_delayed_ref_node *ref, const struct btrfs_delayed_ref_head *head_ref, @@ -864,7 +892,11 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, TP_ARGS(ref, head_ref, action) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, TP_PROTO(const struct btrfs_delayed_ref_node *ref, const struct btrfs_delayed_ref_head *head_ref, @@ -890,7 +922,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, ) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, TP_PROTO(struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_ref_head *head_ref, @@ -899,7 +935,11 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head, TP_ARGS(ref, head_ref, action) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head, +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, TP_PROTO(struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_ref_head *head_ref, -- 2.34.1