Re: [PATCH v3 02/12] btrfs: add a trace point for reserve tickets
From: David Sterba <hidden>
Date: 2021-01-27 10:11:56
On Fri, Oct 09, 2020 at 09:28:19AM -0400, Josef Bacik wrote:
quoted hunk ↗ jump to hunk
While debugging a ENOSPC related performance problem I needed to see the time difference between start and end of a reserve ticket, so add a trace point to report when we handle a reserve ticket. I opted to spit out start_ns itself without calculating the difference because there could be a gap between enabling the tracpoint and setting start_ns. Doing it this way allows us to filter on 0 start_ns so we don't get bogus entries, and we can easily calculate the time difference with bpftrace or something else. Reviewed-by: Nikolay Borisov <redacted> Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- fs/btrfs/space-info.c | 10 +++++++++- include/trace/events/btrfs.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-)diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index ba2b72409d46..ac7269cf1904 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c@@ -1224,6 +1224,7 @@ static void wait_reserve_ticket(struct btrfs_fs_info *fs_info, static int handle_reserve_ticket(struct btrfs_fs_info *fs_info, struct btrfs_space_info *space_info, struct reserve_ticket *ticket, + u64 start_ns, u64 orig_bytes,
Added + * @start_ns: timestamp when the reservation started + * @orig_bytes: amount of bytes originally reserved caught by the recently added kdoc verification.
enum btrfs_reserve_flush_enum flush)