On 29.06.21 г. 16:59, Josef Bacik wrote: > When debugging early enospc problems it was useful to have a tracepoint > where we failed all tickets so I could check the state of the enospc > counters at failure time to validate my fixes. This adds the tracpoint > so you can easily get that information. > > Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx> > --- > fs/btrfs/space-info.c | 2 ++ > include/trace/events/btrfs.h | 6 ++++++ > 2 files changed, 8 insertions(+) > > diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c > index 392997376a1c..af161eb808a2 100644 > --- a/fs/btrfs/space-info.c > +++ b/fs/btrfs/space-info.c > @@ -825,6 +825,8 @@ static bool maybe_fail_all_tickets(struct btrfs_fs_info *fs_info, > struct reserve_ticket *ticket; > u64 tickets_id = space_info->tickets_id; > > + trace_btrfs_fail_all_tickets(fs_info, space_info); > + > if (btrfs_test_opt(fs_info, ENOSPC_DEBUG)) { > btrfs_info(fs_info, "cannot satisfy tickets, dumping space info"); > __btrfs_dump_space_info(fs_info, space_info); > diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h > index c7237317a8b9..3d81ba8c37b9 100644 > --- a/include/trace/events/btrfs.h > +++ b/include/trace/events/btrfs.h > @@ -2098,6 +2098,12 @@ DEFINE_EVENT(btrfs_dump_space_info, btrfs_done_preemptive_reclaim, > TP_ARGS(fs_info, sinfo) > ); > > +DEFINE_EVENT(btrfs_dump_space_info, btrfs_fail_all_tickets, > + TP_PROTO(const struct btrfs_fs_info *fs_info, > + const struct btrfs_space_info *sinfo), > + TP_ARGS(fs_info, sinfo) > +); General suggestion for the dump_space_info - it would be good if ordered_bytes and delalloc_bytes is also dumped in the tracepoint. > + > TRACE_EVENT(btrfs_reserve_ticket, > TP_PROTO(const struct btrfs_fs_info *fs_info, u64 flags, u64 bytes, > u64 start_ns, int flush, int error), >