This RFC patchset provides a btrfs specific performance profiler. It calculates certain function duration and account the duration.
I agree we need btrfs specific performance measurements and its my list too. However my idea was to add it as a btrfs-progs subcommand such as btrfs inspect perf ... And implement by using the systemtap/perf/bpf/dtrace, as these can tap the kernel functions from the useland using which we can measure the time taken and no kernel changes will be required. But yes we need to update the btrfs-progs if we rename the kernel function, which I think is ok. I was too early trying this with bpf before, probably there are more tools now to do that same thing. Thanks, Anand