diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-09-26 18:18:00 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-09-27 02:40:59 -0400 |
commit | 3caa05715d62b6f23a56940da4de9cbfdb5b51a7 (patch) | |
tree | 25a41b17dc972aba95589da357a63707d50b5cd7 /fs/bcachefs/alloc_foreground.c | |
parent | 1918a8728d9dd4599f5b35af023662aa723da6bf (diff) |
bcachefs: Improve bucket_alloc tracepoint
It now includes more info - whether the bucket was for metadata or data
- and also call it in the same place as the bucket_alloc_fail
tracepoint.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r-- | fs/bcachefs/alloc_foreground.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index 8d1c7797f25a..ce365fec7f41 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -268,7 +268,6 @@ static struct open_bucket *__try_alloc_bucket(struct bch_fs *c, struct bch_dev * spin_unlock(&c->freelist_lock); - trace_and_count(c, bucket_alloc, ca, bch2_alloc_reserves[reserve]); return ob; } @@ -575,7 +574,10 @@ err: if (!ob) ob = ERR_PTR(-BCH_ERR_no_buckets_found); - if (IS_ERR(ob)) + if (!IS_ERR(ob)) + trace_and_count(c, bucket_alloc, ca, bch2_alloc_reserves[reserve], + may_alloc_partial, ob->bucket); + else trace_and_count(c, bucket_alloc_fail, ca, bch2_alloc_reserves[reserve], usage.d[BCH_DATA_free].buckets, |