]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: Use trace_call__##name() at guarded tracepoint call sites
authorVineeth Pillai (Google) <vineeth@bitbyteword.org>
Mon, 23 Mar 2026 16:00:34 +0000 (12:00 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 26 Mar 2026 14:24:40 +0000 (10:24 -0400)
Replace trace_foo() with the new trace_call__foo() at sites already
guarded by trace_foo_enabled(), avoiding a redundant
static_branch_unlikely() re-evaluation inside the tracepoint.
trace_call__foo() calls the tracepoint callbacks directly without
utilizing the static branch again.

Cc: Chris Mason <clm@fb.com>
Link: https://patch.msgid.link/20260323160052.17528-16-vineeth@bitbyteword.org
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineeth Pillai (Google) <vineeth@bitbyteword.org>
Assisted-by: Claude:claude-sonnet-4-6
Acked-by: David Sterba <dsterba@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/btrfs/extent_map.c
fs/btrfs/raid56.c

index 095a561d733f0c6f5f5daac01fada717f7b52109..9284c0a81befb59602e00d7a6eae851f8e4df13e 100644 (file)
@@ -1318,7 +1318,7 @@ static void btrfs_extent_map_shrinker_worker(struct work_struct *work)
        if (trace_btrfs_extent_map_shrinker_scan_enter_enabled()) {
                s64 nr = percpu_counter_sum_positive(&fs_info->evictable_extent_maps);
 
-               trace_btrfs_extent_map_shrinker_scan_enter(fs_info, nr);
+               trace_call__btrfs_extent_map_shrinker_scan_enter(fs_info, nr);
        }
 
        while (ctx.scanned < ctx.nr_to_scan && !btrfs_fs_closing(fs_info)) {
@@ -1358,7 +1358,7 @@ static void btrfs_extent_map_shrinker_worker(struct work_struct *work)
        if (trace_btrfs_extent_map_shrinker_scan_exit_enabled()) {
                s64 nr = percpu_counter_sum_positive(&fs_info->evictable_extent_maps);
 
-               trace_btrfs_extent_map_shrinker_scan_exit(fs_info, nr_dropped, nr);
+               trace_call__btrfs_extent_map_shrinker_scan_exit(fs_info, nr_dropped, nr);
        }
 
        atomic64_set(&fs_info->em_shrinker_nr_to_scan, 0);
index 02105d68accb940edb3256a83eebe626b0d1b94c..30bd6c0fdd1f025bcfc7ea9e6d669e26e45fd9f6 100644 (file)
@@ -1743,7 +1743,7 @@ static void submit_read_wait_bio_list(struct btrfs_raid_bio *rbio,
                        struct raid56_bio_trace_info trace_info = { 0 };
 
                        bio_get_trace_info(rbio, bio, &trace_info);
-                       trace_raid56_read(rbio, bio, &trace_info);
+                       trace_call__raid56_read(rbio, bio, &trace_info);
                }
                submit_bio(bio);
        }
@@ -2428,7 +2428,7 @@ static void submit_write_bios(struct btrfs_raid_bio *rbio,
                        struct raid56_bio_trace_info trace_info = { 0 };
 
                        bio_get_trace_info(rbio, bio, &trace_info);
-                       trace_raid56_write(rbio, bio, &trace_info);
+                       trace_call__raid56_write(rbio, bio, &trace_info);
                }
                submit_bio(bio);
        }