2017-03-17 06:18:50 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM bcachefs
|
|
|
|
|
|
|
|
#if !defined(_TRACE_BCACHEFS_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_BCACHEFS_H
|
|
|
|
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(bpos,
|
|
|
|
TP_PROTO(struct bpos *p),
|
|
|
|
TP_ARGS(p),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u64, inode )
|
|
|
|
__field(u64, offset )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->inode = p->inode;
|
|
|
|
__entry->offset = p->offset;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%llu:%llu", __entry->inode, __entry->offset)
|
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(bkey,
|
|
|
|
TP_PROTO(const struct bkey *k),
|
|
|
|
TP_ARGS(k),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u64, inode )
|
|
|
|
__field(u64, offset )
|
|
|
|
__field(u32, size )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->inode = k->p.inode;
|
|
|
|
__entry->offset = k->p.offset;
|
|
|
|
__entry->size = k->size;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%llu:%llu len %u", __entry->inode,
|
|
|
|
__entry->offset, __entry->size)
|
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(bch_fs,
|
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
2017-03-17 06:18:50 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
2017-03-17 06:18:50 +00:00
|
|
|
),
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
TP_printk("%d,%d", MAJOR(__entry->dev), MINOR(__entry->dev))
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(bio,
|
|
|
|
TP_PROTO(struct bio *bio),
|
|
|
|
TP_ARGS(bio),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev )
|
|
|
|
__field(sector_t, sector )
|
|
|
|
__field(unsigned int, nr_sector )
|
|
|
|
__array(char, rwbs, 6 )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = bio->bi_bdev ? bio_dev(bio) : 0;
|
|
|
|
__entry->sector = bio->bi_iter.bi_sector;
|
|
|
|
__entry->nr_sector = bio->bi_iter.bi_size >> 9;
|
|
|
|
blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%d,%d %s %llu + %u",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
|
|
|
|
(unsigned long long)__entry->sector, __entry->nr_sector)
|
|
|
|
);
|
|
|
|
|
2022-04-03 19:13:20 +00:00
|
|
|
/* super-io.c: */
|
|
|
|
TRACE_EVENT(write_super,
|
|
|
|
TP_PROTO(struct bch_fs *c, unsigned long ip),
|
|
|
|
TP_ARGS(c, ip),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev )
|
|
|
|
__field(unsigned long, ip )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = c->dev;
|
|
|
|
__entry->ip = ip;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%d,%d for %pS",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(void *) __entry->ip)
|
|
|
|
);
|
|
|
|
|
2017-03-17 06:18:50 +00:00
|
|
|
/* io.c: */
|
|
|
|
|
|
|
|
DEFINE_EVENT(bio, read_split,
|
|
|
|
TP_PROTO(struct bio *bio),
|
|
|
|
TP_ARGS(bio)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bio, read_bounce,
|
|
|
|
TP_PROTO(struct bio *bio),
|
|
|
|
TP_ARGS(bio)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bio, read_retry,
|
|
|
|
TP_PROTO(struct bio *bio),
|
|
|
|
TP_ARGS(bio)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bio, promote,
|
|
|
|
TP_PROTO(struct bio *bio),
|
|
|
|
TP_ARGS(bio)
|
|
|
|
);
|
|
|
|
|
|
|
|
/* Journal */
|
|
|
|
|
|
|
|
DEFINE_EVENT(bch_fs, journal_full,
|
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bch_fs, journal_entry_full,
|
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bio, journal_write,
|
|
|
|
TP_PROTO(struct bio *bio),
|
|
|
|
TP_ARGS(bio)
|
|
|
|
);
|
|
|
|
|
2020-11-20 00:54:40 +00:00
|
|
|
TRACE_EVENT(journal_reclaim_start,
|
2022-04-17 22:06:31 +00:00
|
|
|
TP_PROTO(struct bch_fs *c, bool direct, bool kicked,
|
|
|
|
u64 min_nr, u64 min_key_cache,
|
2020-11-20 00:54:40 +00:00
|
|
|
u64 prereserved, u64 prereserved_total,
|
|
|
|
u64 btree_cache_dirty, u64 btree_cache_total,
|
|
|
|
u64 btree_key_cache_dirty, u64 btree_key_cache_total),
|
2022-04-17 22:06:31 +00:00
|
|
|
TP_ARGS(c, direct, kicked, min_nr, min_key_cache, prereserved, prereserved_total,
|
2020-11-20 00:54:40 +00:00
|
|
|
btree_cache_dirty, btree_cache_total,
|
|
|
|
btree_key_cache_dirty, btree_key_cache_total),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
2022-04-17 22:06:31 +00:00
|
|
|
__field(bool, direct )
|
|
|
|
__field(bool, kicked )
|
2020-11-20 00:54:40 +00:00
|
|
|
__field(u64, min_nr )
|
2022-04-17 22:06:31 +00:00
|
|
|
__field(u64, min_key_cache )
|
2020-11-20 00:54:40 +00:00
|
|
|
__field(u64, prereserved )
|
|
|
|
__field(u64, prereserved_total )
|
|
|
|
__field(u64, btree_cache_dirty )
|
|
|
|
__field(u64, btree_cache_total )
|
|
|
|
__field(u64, btree_key_cache_dirty )
|
|
|
|
__field(u64, btree_key_cache_total )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
2022-04-17 22:06:31 +00:00
|
|
|
__entry->direct = direct;
|
|
|
|
__entry->kicked = kicked;
|
2020-11-20 00:54:40 +00:00
|
|
|
__entry->min_nr = min_nr;
|
2022-04-17 22:06:31 +00:00
|
|
|
__entry->min_key_cache = min_key_cache;
|
2020-11-20 00:54:40 +00:00
|
|
|
__entry->prereserved = prereserved;
|
|
|
|
__entry->prereserved_total = prereserved_total;
|
|
|
|
__entry->btree_cache_dirty = btree_cache_dirty;
|
|
|
|
__entry->btree_cache_total = btree_cache_total;
|
|
|
|
__entry->btree_key_cache_dirty = btree_key_cache_dirty;
|
|
|
|
__entry->btree_key_cache_total = btree_key_cache_total;
|
|
|
|
),
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
TP_printk("%d,%d direct %u kicked %u min %llu key cache %llu prereserved %llu/%llu btree cache %llu/%llu key cache %llu/%llu",
|
2021-05-27 23:15:44 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
2022-04-17 22:06:31 +00:00
|
|
|
__entry->direct,
|
|
|
|
__entry->kicked,
|
2020-11-20 00:54:40 +00:00
|
|
|
__entry->min_nr,
|
2022-04-17 22:06:31 +00:00
|
|
|
__entry->min_key_cache,
|
2020-11-20 00:54:40 +00:00
|
|
|
__entry->prereserved,
|
|
|
|
__entry->prereserved_total,
|
|
|
|
__entry->btree_cache_dirty,
|
|
|
|
__entry->btree_cache_total,
|
|
|
|
__entry->btree_key_cache_dirty,
|
|
|
|
__entry->btree_key_cache_total)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(journal_reclaim_finish,
|
|
|
|
TP_PROTO(struct bch_fs *c, u64 nr_flushed),
|
|
|
|
TP_ARGS(c, nr_flushed),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
|
|
|
__field(u64, nr_flushed )
|
2020-11-20 00:54:40 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
|
|
|
__entry->nr_flushed = nr_flushed;
|
2020-11-20 00:54:40 +00:00
|
|
|
),
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
TP_printk("%d,%d flushed %llu",
|
2021-05-27 23:15:44 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->nr_flushed)
|
2020-11-20 00:54:40 +00:00
|
|
|
);
|
|
|
|
|
2022-02-10 09:32:19 +00:00
|
|
|
/* allocator: */
|
|
|
|
|
2017-03-17 06:18:50 +00:00
|
|
|
/* bset.c: */
|
|
|
|
|
|
|
|
DEFINE_EVENT(bpos, bkey_pack_pos_fail,
|
|
|
|
TP_PROTO(struct bpos *p),
|
|
|
|
TP_ARGS(p)
|
|
|
|
);
|
|
|
|
|
|
|
|
/* Btree */
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(btree_node,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
2017-03-17 06:18:50 +00:00
|
|
|
__field(u8, level )
|
|
|
|
__field(u8, id )
|
|
|
|
__field(u64, inode )
|
|
|
|
__field(u64, offset )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
2020-06-06 16:28:01 +00:00
|
|
|
__entry->level = b->c.level;
|
|
|
|
__entry->id = b->c.btree_id;
|
2017-03-17 06:18:50 +00:00
|
|
|
__entry->inode = b->key.k.p.inode;
|
|
|
|
__entry->offset = b->key.k.p.offset;
|
|
|
|
),
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
TP_printk("%d,%d %u id %u %llu:%llu",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->level, __entry->id,
|
2017-03-17 06:18:50 +00:00
|
|
|
__entry->inode, __entry->offset)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_read,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(btree_write,
|
|
|
|
TP_PROTO(struct btree *b, unsigned bytes, unsigned sectors),
|
|
|
|
TP_ARGS(b, bytes, sectors),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2018-11-01 19:10:01 +00:00
|
|
|
__field(enum btree_node_type, type)
|
2017-03-17 06:18:50 +00:00
|
|
|
__field(unsigned, bytes )
|
|
|
|
__field(unsigned, sectors )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->type = btree_node_type(b);
|
|
|
|
__entry->bytes = bytes;
|
|
|
|
__entry->sectors = sectors;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("bkey type %u bytes %u sectors %u",
|
|
|
|
__entry->type , __entry->bytes, __entry->sectors)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_node_alloc,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_node_free,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_node_reap,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
DEFINE_EVENT(bch_fs, btree_node_cannibalize_lock_fail,
|
2017-03-17 06:18:50 +00:00
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
DEFINE_EVENT(bch_fs, btree_node_cannibalize_lock,
|
2017-03-17 06:18:50 +00:00
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
DEFINE_EVENT(bch_fs, btree_node_cannibalize,
|
2017-03-17 06:18:50 +00:00
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bch_fs, btree_node_cannibalize_unlock,
|
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(btree_reserve_get_fail,
|
2022-01-12 04:24:43 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
size_t required),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, required),
|
2017-03-17 06:18:50 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-12 04:24:43 +00:00
|
|
|
__array(char, trans_fn, 24 )
|
|
|
|
__field(unsigned long, caller_ip )
|
2017-03-17 06:18:50 +00:00
|
|
|
__field(size_t, required )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-12 04:24:43 +00:00
|
|
|
strlcpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
|
|
|
__entry->caller_ip = caller_ip;
|
|
|
|
__entry->required = required;
|
2017-03-17 06:18:50 +00:00
|
|
|
),
|
|
|
|
|
2022-01-12 04:24:43 +00:00
|
|
|
TP_printk("%s %pS required %zu",
|
|
|
|
__entry->trans_fn,
|
|
|
|
(void *) __entry->caller_ip,
|
|
|
|
__entry->required)
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_split,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_compact,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(btree_node, btree_merge,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(btree_node, btree_rewrite,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
2017-03-17 06:18:50 +00:00
|
|
|
DEFINE_EVENT(btree_node, btree_set_root,
|
|
|
|
TP_PROTO(struct bch_fs *c, struct btree *b),
|
|
|
|
TP_ARGS(c, b)
|
|
|
|
);
|
|
|
|
|
2021-12-28 01:45:07 +00:00
|
|
|
TRACE_EVENT(btree_cache_scan,
|
2022-04-04 00:36:32 +00:00
|
|
|
TP_PROTO(long nr_to_scan, long can_free, long ret),
|
|
|
|
TP_ARGS(nr_to_scan, can_free, ret),
|
2021-12-28 01:45:07 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-04-04 00:36:32 +00:00
|
|
|
__field(long, nr_to_scan )
|
|
|
|
__field(long, can_free )
|
|
|
|
__field(long, ret )
|
2021-12-28 01:45:07 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-04-04 00:36:32 +00:00
|
|
|
__entry->nr_to_scan = nr_to_scan;
|
|
|
|
__entry->can_free = can_free;
|
|
|
|
__entry->ret = ret;
|
2021-12-28 01:45:07 +00:00
|
|
|
),
|
|
|
|
|
2022-04-04 00:36:32 +00:00
|
|
|
TP_printk("scanned for %li nodes, can free %li, ret %li",
|
|
|
|
__entry->nr_to_scan, __entry->can_free, __entry->ret)
|
2021-12-28 01:45:07 +00:00
|
|
|
);
|
|
|
|
|
2022-01-09 03:59:58 +00:00
|
|
|
TRACE_EVENT(btree_node_relock_fail,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos,
|
|
|
|
unsigned long node,
|
|
|
|
u32 iter_lock_seq,
|
|
|
|
u32 node_lock_seq),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos, node, iter_lock_seq, node_lock_seq),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__array(char, trans_fn, 24 )
|
2022-02-16 05:42:34 +00:00
|
|
|
__field(unsigned long, caller_ip )
|
2022-01-09 03:59:58 +00:00
|
|
|
__field(u8, btree_id )
|
|
|
|
__field(u64, pos_inode )
|
|
|
|
__field(u64, pos_offset )
|
|
|
|
__field(u32, pos_snapshot )
|
|
|
|
__field(unsigned long, node )
|
|
|
|
__field(u32, iter_lock_seq )
|
|
|
|
__field(u32, node_lock_seq )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
2022-02-16 05:42:34 +00:00
|
|
|
__entry->caller_ip = caller_ip;
|
2022-01-09 03:59:58 +00:00
|
|
|
__entry->btree_id = btree_id;
|
|
|
|
__entry->pos_inode = pos->inode;
|
|
|
|
__entry->pos_offset = pos->offset;
|
|
|
|
__entry->pos_snapshot = pos->snapshot;
|
|
|
|
__entry->node = node;
|
|
|
|
__entry->iter_lock_seq = iter_lock_seq;
|
|
|
|
__entry->node_lock_seq = node_lock_seq;
|
|
|
|
),
|
|
|
|
|
2022-02-16 05:42:34 +00:00
|
|
|
TP_printk("%s %pS btree %u pos %llu:%llu:%u, node %lu iter seq %u lock seq %u",
|
2022-01-09 03:59:58 +00:00
|
|
|
__entry->trans_fn,
|
2022-02-16 05:42:34 +00:00
|
|
|
(void *) __entry->caller_ip,
|
2022-01-09 03:59:58 +00:00
|
|
|
__entry->btree_id,
|
|
|
|
__entry->pos_inode,
|
|
|
|
__entry->pos_offset,
|
|
|
|
__entry->pos_snapshot,
|
|
|
|
__entry->node,
|
|
|
|
__entry->iter_lock_seq,
|
|
|
|
__entry->node_lock_seq)
|
|
|
|
);
|
|
|
|
|
2017-03-17 06:18:50 +00:00
|
|
|
/* Garbage collection */
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(bch_fs, gc_gens_start,
|
2017-03-17 06:18:50 +00:00
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(bch_fs, gc_gens_end,
|
2017-03-17 06:18:50 +00:00
|
|
|
TP_PROTO(struct bch_fs *c),
|
|
|
|
TP_ARGS(c)
|
|
|
|
);
|
|
|
|
|
|
|
|
/* Allocator */
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(bucket_alloc,
|
2022-01-10 01:48:31 +00:00
|
|
|
TP_PROTO(struct bch_dev *ca, const char *alloc_reserve,
|
2022-07-18 01:40:39 +00:00
|
|
|
u64 free,
|
2022-01-10 01:48:31 +00:00
|
|
|
u64 avail,
|
2022-07-18 01:40:39 +00:00
|
|
|
u64 copygc_wait_amount,
|
|
|
|
s64 copygc_waiting_for,
|
2022-01-10 01:48:31 +00:00
|
|
|
u64 seen,
|
|
|
|
u64 open,
|
|
|
|
u64 need_journal_commit,
|
|
|
|
u64 nouse,
|
|
|
|
bool nonblocking,
|
|
|
|
int ret),
|
2022-07-18 01:40:39 +00:00
|
|
|
TP_ARGS(ca, alloc_reserve, free, avail, copygc_wait_amount, copygc_waiting_for,
|
|
|
|
seen, open, need_journal_commit, nouse, nonblocking, ret),
|
2017-03-17 06:18:50 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-10 01:48:31 +00:00
|
|
|
__field(dev_t, dev )
|
|
|
|
__array(char, reserve, 16 )
|
2022-07-18 01:40:39 +00:00
|
|
|
__field(u64, free )
|
2022-01-10 01:48:31 +00:00
|
|
|
__field(u64, avail )
|
2022-07-18 01:40:39 +00:00
|
|
|
__field(u64, copygc_wait_amount )
|
|
|
|
__field(s64, copygc_waiting_for )
|
2022-01-10 01:48:31 +00:00
|
|
|
__field(u64, seen )
|
|
|
|
__field(u64, open )
|
|
|
|
__field(u64, need_journal_commit )
|
|
|
|
__field(u64, nouse )
|
|
|
|
__field(bool, nonblocking )
|
|
|
|
__field(int, ret )
|
2017-03-17 06:18:50 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-03 02:45:35 +00:00
|
|
|
__entry->dev = ca->dev;
|
2022-03-13 23:27:55 +00:00
|
|
|
strlcpy(__entry->reserve, alloc_reserve, sizeof(__entry->reserve));
|
2022-07-18 01:40:39 +00:00
|
|
|
__entry->free = free;
|
2022-01-10 01:48:31 +00:00
|
|
|
__entry->avail = avail;
|
2022-07-18 01:40:39 +00:00
|
|
|
__entry->copygc_wait_amount = copygc_wait_amount;
|
|
|
|
__entry->copygc_waiting_for = copygc_waiting_for;
|
2022-01-10 01:48:31 +00:00
|
|
|
__entry->seen = seen;
|
|
|
|
__entry->open = open;
|
|
|
|
__entry->need_journal_commit = need_journal_commit;
|
|
|
|
__entry->nouse = nouse;
|
|
|
|
__entry->nonblocking = nonblocking;
|
|
|
|
__entry->ret = ret;
|
2017-03-17 06:18:50 +00:00
|
|
|
),
|
|
|
|
|
2022-07-18 01:40:39 +00:00
|
|
|
TP_printk("%d,%d reserve %s free %llu avail %llu copygc_wait %llu/%lli seen %llu open %llu need_journal_commit %llu nouse %llu nonblocking %u ret %i",
|
2021-04-18 00:37:04 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
2022-01-10 01:48:31 +00:00
|
|
|
__entry->reserve,
|
2022-07-18 01:40:39 +00:00
|
|
|
__entry->free,
|
2022-01-10 01:48:31 +00:00
|
|
|
__entry->avail,
|
2022-07-18 01:40:39 +00:00
|
|
|
__entry->copygc_wait_amount,
|
|
|
|
__entry->copygc_waiting_for,
|
2022-01-10 01:48:31 +00:00
|
|
|
__entry->seen,
|
|
|
|
__entry->open,
|
|
|
|
__entry->need_journal_commit,
|
|
|
|
__entry->nouse,
|
|
|
|
__entry->nonblocking,
|
|
|
|
__entry->ret)
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bucket_alloc, bucket_alloc,
|
2022-01-10 01:48:31 +00:00
|
|
|
TP_PROTO(struct bch_dev *ca, const char *alloc_reserve,
|
2022-07-18 01:40:39 +00:00
|
|
|
u64 free,
|
2022-01-10 01:48:31 +00:00
|
|
|
u64 avail,
|
2022-07-18 01:40:39 +00:00
|
|
|
u64 copygc_wait_amount,
|
|
|
|
s64 copygc_waiting_for,
|
2022-01-10 01:48:31 +00:00
|
|
|
u64 seen,
|
|
|
|
u64 open,
|
|
|
|
u64 need_journal_commit,
|
|
|
|
u64 nouse,
|
|
|
|
bool nonblocking,
|
|
|
|
int ret),
|
2022-07-18 01:40:39 +00:00
|
|
|
TP_ARGS(ca, alloc_reserve, free, avail, copygc_wait_amount, copygc_waiting_for,
|
|
|
|
seen, open, need_journal_commit, nouse, nonblocking, ret)
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bucket_alloc, bucket_alloc_fail,
|
2022-01-10 01:48:31 +00:00
|
|
|
TP_PROTO(struct bch_dev *ca, const char *alloc_reserve,
|
2022-07-18 01:40:39 +00:00
|
|
|
u64 free,
|
2022-01-10 01:48:31 +00:00
|
|
|
u64 avail,
|
2022-07-18 01:40:39 +00:00
|
|
|
u64 copygc_wait_amount,
|
|
|
|
s64 copygc_waiting_for,
|
2022-01-10 01:48:31 +00:00
|
|
|
u64 seen,
|
|
|
|
u64 open,
|
|
|
|
u64 need_journal_commit,
|
|
|
|
u64 nouse,
|
|
|
|
bool nonblocking,
|
|
|
|
int ret),
|
2022-07-18 01:40:39 +00:00
|
|
|
TP_ARGS(ca, alloc_reserve, free, avail, copygc_wait_amount, copygc_waiting_for,
|
|
|
|
seen, open, need_journal_commit, nouse, nonblocking, ret)
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
TRACE_EVENT(discard_buckets,
|
|
|
|
TP_PROTO(struct bch_fs *c, u64 seen, u64 open,
|
|
|
|
u64 need_journal_commit, u64 discarded, int ret),
|
|
|
|
TP_ARGS(c, seen, open, need_journal_commit, discarded, ret),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev )
|
|
|
|
__field(u64, seen )
|
|
|
|
__field(u64, open )
|
|
|
|
__field(u64, need_journal_commit )
|
|
|
|
__field(u64, discarded )
|
|
|
|
__field(int, ret )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = c->dev;
|
|
|
|
__entry->seen = seen;
|
|
|
|
__entry->open = open;
|
|
|
|
__entry->need_journal_commit = need_journal_commit;
|
|
|
|
__entry->discarded = discarded;
|
|
|
|
__entry->ret = ret;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%d%d seen %llu open %llu need_journal_commit %llu discarded %llu ret %i",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->seen,
|
|
|
|
__entry->open,
|
|
|
|
__entry->need_journal_commit,
|
|
|
|
__entry->discarded,
|
|
|
|
__entry->ret)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(invalidate_bucket,
|
2022-06-21 02:26:41 +00:00
|
|
|
TP_PROTO(struct bch_fs *c, unsigned dev, u64 bucket, u32 sectors),
|
|
|
|
TP_ARGS(c, dev, bucket, sectors),
|
2022-04-17 22:06:31 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev )
|
|
|
|
__field(u32, dev_idx )
|
2022-06-21 02:26:41 +00:00
|
|
|
__field(u32, sectors )
|
2022-04-17 22:06:31 +00:00
|
|
|
__field(u64, bucket )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = c->dev;
|
|
|
|
__entry->dev_idx = dev;
|
2022-06-21 02:26:41 +00:00
|
|
|
__entry->sectors = sectors;
|
2022-04-17 22:06:31 +00:00
|
|
|
__entry->bucket = bucket;
|
|
|
|
),
|
|
|
|
|
2022-06-21 02:26:41 +00:00
|
|
|
TP_printk("%d:%d invalidated %u:%llu cached sectors %u",
|
2022-04-17 22:06:31 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
2022-06-21 02:26:41 +00:00
|
|
|
__entry->dev_idx, __entry->bucket,
|
|
|
|
__entry->sectors)
|
2022-04-17 22:06:31 +00:00
|
|
|
);
|
|
|
|
|
2017-03-17 06:18:50 +00:00
|
|
|
/* Moving IO */
|
|
|
|
|
|
|
|
DEFINE_EVENT(bkey, move_extent,
|
|
|
|
TP_PROTO(const struct bkey *k),
|
|
|
|
TP_ARGS(k)
|
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(bkey, move_alloc_mem_fail,
|
2017-03-17 06:18:50 +00:00
|
|
|
TP_PROTO(const struct bkey *k),
|
|
|
|
TP_ARGS(k)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(bkey, move_race,
|
|
|
|
TP_PROTO(const struct bkey *k),
|
|
|
|
TP_ARGS(k)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(move_data,
|
|
|
|
TP_PROTO(struct bch_fs *c, u64 sectors_moved,
|
|
|
|
u64 keys_moved),
|
|
|
|
TP_ARGS(c, sectors_moved, keys_moved),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
2017-03-17 06:18:50 +00:00
|
|
|
__field(u64, sectors_moved )
|
|
|
|
__field(u64, keys_moved )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
2017-03-17 06:18:50 +00:00
|
|
|
__entry->sectors_moved = sectors_moved;
|
|
|
|
__entry->keys_moved = keys_moved;
|
|
|
|
),
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
TP_printk("%d,%d sectors_moved %llu keys_moved %llu",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->sectors_moved, __entry->keys_moved)
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(copygc,
|
2020-07-11 20:28:54 +00:00
|
|
|
TP_PROTO(struct bch_fs *c,
|
2017-03-17 06:18:50 +00:00
|
|
|
u64 sectors_moved, u64 sectors_not_moved,
|
|
|
|
u64 buckets_moved, u64 buckets_not_moved),
|
2020-07-11 20:28:54 +00:00
|
|
|
TP_ARGS(c,
|
2017-03-17 06:18:50 +00:00
|
|
|
sectors_moved, sectors_not_moved,
|
|
|
|
buckets_moved, buckets_not_moved),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
2017-03-17 06:18:50 +00:00
|
|
|
__field(u64, sectors_moved )
|
|
|
|
__field(u64, sectors_not_moved )
|
|
|
|
__field(u64, buckets_moved )
|
|
|
|
__field(u64, buckets_not_moved )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
2017-03-17 06:18:50 +00:00
|
|
|
__entry->sectors_moved = sectors_moved;
|
|
|
|
__entry->sectors_not_moved = sectors_not_moved;
|
|
|
|
__entry->buckets_moved = buckets_moved;
|
|
|
|
__entry->buckets_not_moved = buckets_moved;
|
|
|
|
),
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
TP_printk("%d,%d sectors moved %llu remain %llu buckets moved %llu remain %llu",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->sectors_moved, __entry->sectors_not_moved,
|
|
|
|
__entry->buckets_moved, __entry->buckets_not_moved)
|
2017-03-17 06:18:50 +00:00
|
|
|
);
|
|
|
|
|
2021-05-26 05:03:35 +00:00
|
|
|
TRACE_EVENT(copygc_wait,
|
|
|
|
TP_PROTO(struct bch_fs *c,
|
|
|
|
u64 wait_amount, u64 until),
|
|
|
|
TP_ARGS(c, wait_amount, until),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2021-05-27 23:15:44 +00:00
|
|
|
__field(dev_t, dev )
|
2021-05-26 05:03:35 +00:00
|
|
|
__field(u64, wait_amount )
|
|
|
|
__field(u64, until )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2021-05-27 23:15:44 +00:00
|
|
|
__entry->dev = c->dev;
|
2021-05-26 05:03:35 +00:00
|
|
|
__entry->wait_amount = wait_amount;
|
|
|
|
__entry->until = until;
|
|
|
|
),
|
|
|
|
|
2021-05-27 23:15:44 +00:00
|
|
|
TP_printk("%d,%u waiting for %llu sectors until %llu",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->wait_amount, __entry->until)
|
2021-05-26 05:03:35 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DECLARE_EVENT_CLASS(transaction_event,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip),
|
2019-04-23 04:10:08 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-04 05:33:52 +00:00
|
|
|
__array(char, trans_fn, 24 )
|
2021-06-04 19:18:10 +00:00
|
|
|
__field(unsigned long, caller_ip )
|
2019-04-23 04:10:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-04 05:33:52 +00:00
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
2021-06-04 19:18:10 +00:00
|
|
|
__entry->caller_ip = caller_ip;
|
2019-04-23 04:10:08 +00:00
|
|
|
),
|
|
|
|
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_printk("%s %pS", __entry->trans_fn, (void *) __entry->caller_ip)
|
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, transaction_commit,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip),
|
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_event, transaction_restart_ip,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip),
|
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2019-04-23 04:10:08 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_blocked_journal_reclaim,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2019-04-23 04:10:08 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_restart_journal_res_get,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_restart_journal_preres_get,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_restart_journal_reclaim,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_restart_fault_inject,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_traverse_all,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_restart_mark_replicas,
|
2022-01-12 06:14:47 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip),
|
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
|
|
|
);
|
|
|
|
|
2022-04-17 22:06:31 +00:00
|
|
|
DEFINE_EVENT(transaction_event, trans_restart_key_cache_raced,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(transaction_restart_iter,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos),
|
2021-06-04 19:18:10 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-04 05:33:52 +00:00
|
|
|
__array(char, trans_fn, 24 )
|
2022-02-16 05:42:34 +00:00
|
|
|
__field(unsigned long, caller_ip )
|
2021-06-04 19:18:10 +00:00
|
|
|
__field(u8, btree_id )
|
|
|
|
__field(u64, pos_inode )
|
|
|
|
__field(u64, pos_offset )
|
|
|
|
__field(u32, pos_snapshot )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-04 05:33:52 +00:00
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
2022-02-16 05:42:34 +00:00
|
|
|
__entry->caller_ip = caller_ip;
|
2021-06-04 19:18:10 +00:00
|
|
|
__entry->btree_id = btree_id;
|
|
|
|
__entry->pos_inode = pos->inode;
|
|
|
|
__entry->pos_offset = pos->offset;
|
|
|
|
__entry->pos_snapshot = pos->snapshot;
|
|
|
|
),
|
|
|
|
|
2022-02-16 05:42:34 +00:00
|
|
|
TP_printk("%s %pS btree %u pos %llu:%llu:%u",
|
2022-01-04 05:33:52 +00:00
|
|
|
__entry->trans_fn,
|
2022-02-16 05:42:34 +00:00
|
|
|
(void *) __entry->caller_ip,
|
2021-06-04 19:18:10 +00:00
|
|
|
__entry->btree_id,
|
|
|
|
__entry->pos_inode,
|
|
|
|
__entry->pos_offset,
|
|
|
|
__entry->pos_snapshot)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_btree_node_reused,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_btree_node_split,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_upgrade,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_iter_upgrade,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-01-09 03:59:58 +00:00
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_next_node,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_parent_for_fill,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_after_fill,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_key_cache_fill,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_path,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_path_intent,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
2021-06-04 19:18:10 +00:00
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_traverse,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2021-06-04 19:18:10 +00:00
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
2021-06-04 19:18:10 +00:00
|
|
|
);
|
|
|
|
|
2022-02-18 05:47:45 +00:00
|
|
|
DEFINE_EVENT(transaction_restart_iter, trans_restart_memory_allocation_failure,
|
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
|
|
|
struct bpos *pos),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos)
|
|
|
|
);
|
|
|
|
|
2020-10-28 18:17:46 +00:00
|
|
|
TRACE_EVENT(trans_restart_would_deadlock,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
2020-10-28 18:17:46 +00:00
|
|
|
unsigned long caller_ip,
|
2021-04-14 17:26:15 +00:00
|
|
|
bool in_traverse_all,
|
2020-10-28 18:17:46 +00:00
|
|
|
unsigned reason,
|
|
|
|
enum btree_id have_btree_id,
|
|
|
|
unsigned have_iter_type,
|
2021-04-14 17:26:15 +00:00
|
|
|
struct bpos *have_pos,
|
2020-10-28 18:17:46 +00:00
|
|
|
enum btree_id want_btree_id,
|
2021-04-14 17:26:15 +00:00
|
|
|
unsigned want_iter_type,
|
|
|
|
struct bpos *want_pos),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, in_traverse_all, reason,
|
2021-04-14 17:26:15 +00:00
|
|
|
have_btree_id, have_iter_type, have_pos,
|
|
|
|
want_btree_id, want_iter_type, want_pos),
|
2020-10-28 18:17:46 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-04 05:33:52 +00:00
|
|
|
__array(char, trans_fn, 24 )
|
2020-10-28 18:17:46 +00:00
|
|
|
__field(unsigned long, caller_ip )
|
2021-04-14 17:26:15 +00:00
|
|
|
__field(u8, in_traverse_all )
|
2020-10-28 18:17:46 +00:00
|
|
|
__field(u8, reason )
|
|
|
|
__field(u8, have_btree_id )
|
|
|
|
__field(u8, have_iter_type )
|
|
|
|
__field(u8, want_btree_id )
|
|
|
|
__field(u8, want_iter_type )
|
2021-04-14 17:26:15 +00:00
|
|
|
|
|
|
|
__field(u64, have_pos_inode )
|
|
|
|
__field(u64, have_pos_offset )
|
|
|
|
__field(u32, have_pos_snapshot)
|
|
|
|
__field(u32, want_pos_snapshot)
|
|
|
|
__field(u64, want_pos_inode )
|
|
|
|
__field(u64, want_pos_offset )
|
2020-10-28 18:17:46 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-04 05:33:52 +00:00
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
2020-10-28 18:17:46 +00:00
|
|
|
__entry->caller_ip = caller_ip;
|
2021-04-14 17:26:15 +00:00
|
|
|
__entry->in_traverse_all = in_traverse_all;
|
2020-10-28 18:17:46 +00:00
|
|
|
__entry->reason = reason;
|
|
|
|
__entry->have_btree_id = have_btree_id;
|
|
|
|
__entry->have_iter_type = have_iter_type;
|
|
|
|
__entry->want_btree_id = want_btree_id;
|
|
|
|
__entry->want_iter_type = want_iter_type;
|
2021-04-14 17:26:15 +00:00
|
|
|
|
|
|
|
__entry->have_pos_inode = have_pos->inode;
|
|
|
|
__entry->have_pos_offset = have_pos->offset;
|
|
|
|
__entry->have_pos_snapshot = have_pos->snapshot;
|
|
|
|
|
|
|
|
__entry->want_pos_inode = want_pos->inode;
|
|
|
|
__entry->want_pos_offset = want_pos->offset;
|
|
|
|
__entry->want_pos_snapshot = want_pos->snapshot;
|
2020-10-28 18:17:46 +00:00
|
|
|
),
|
|
|
|
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_printk("%s %pS traverse_all %u because %u have %u:%u %llu:%llu:%u want %u:%u %llu:%llu:%u",
|
|
|
|
__entry->trans_fn,
|
2020-10-28 18:17:46 +00:00
|
|
|
(void *) __entry->caller_ip,
|
2021-04-14 17:26:15 +00:00
|
|
|
__entry->in_traverse_all,
|
2020-10-28 18:17:46 +00:00
|
|
|
__entry->reason,
|
|
|
|
__entry->have_btree_id,
|
|
|
|
__entry->have_iter_type,
|
2021-04-14 17:26:15 +00:00
|
|
|
__entry->have_pos_inode,
|
|
|
|
__entry->have_pos_offset,
|
|
|
|
__entry->have_pos_snapshot,
|
2020-10-28 18:17:46 +00:00
|
|
|
__entry->want_btree_id,
|
2021-04-14 17:26:15 +00:00
|
|
|
__entry->want_iter_type,
|
|
|
|
__entry->want_pos_inode,
|
|
|
|
__entry->want_pos_offset,
|
|
|
|
__entry->want_pos_snapshot)
|
2019-04-23 04:10:08 +00:00
|
|
|
);
|
|
|
|
|
2021-09-08 01:25:32 +00:00
|
|
|
TRACE_EVENT(trans_restart_would_deadlock_write,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn),
|
|
|
|
TP_ARGS(trans_fn),
|
2021-09-08 01:25:32 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-04 05:33:52 +00:00
|
|
|
__array(char, trans_fn, 24 )
|
2021-09-08 01:25:32 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-04 05:33:52 +00:00
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
2021-09-08 01:25:32 +00:00
|
|
|
),
|
|
|
|
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_printk("%s", __entry->trans_fn)
|
2021-09-08 01:25:32 +00:00
|
|
|
);
|
|
|
|
|
2019-05-15 14:54:43 +00:00
|
|
|
TRACE_EVENT(trans_restart_mem_realloced,
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
2021-04-15 16:50:09 +00:00
|
|
|
unsigned long bytes),
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_ARGS(trans_fn, caller_ip, bytes),
|
2019-05-15 14:54:43 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-01-04 05:33:52 +00:00
|
|
|
__array(char, trans_fn, 24 )
|
2021-04-15 16:50:09 +00:00
|
|
|
__field(unsigned long, caller_ip )
|
|
|
|
__field(unsigned long, bytes )
|
2019-05-15 14:54:43 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-01-04 05:33:52 +00:00
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
2021-04-15 16:50:09 +00:00
|
|
|
__entry->caller_ip = caller_ip;
|
|
|
|
__entry->bytes = bytes;
|
2019-05-15 14:54:43 +00:00
|
|
|
),
|
|
|
|
|
2022-01-04 05:33:52 +00:00
|
|
|
TP_printk("%s %pS bytes %lu",
|
|
|
|
__entry->trans_fn,
|
2021-04-15 16:50:09 +00:00
|
|
|
(void *) __entry->caller_ip,
|
|
|
|
__entry->bytes)
|
2019-04-23 04:10:08 +00:00
|
|
|
);
|
|
|
|
|
2022-03-18 01:35:51 +00:00
|
|
|
TRACE_EVENT(trans_restart_key_cache_key_realloced,
|
2022-02-27 16:34:21 +00:00
|
|
|
TP_PROTO(const char *trans_fn,
|
|
|
|
unsigned long caller_ip,
|
|
|
|
enum btree_id btree_id,
|
2022-03-18 01:35:51 +00:00
|
|
|
struct bpos *pos,
|
|
|
|
unsigned old_u64s,
|
|
|
|
unsigned new_u64s),
|
|
|
|
TP_ARGS(trans_fn, caller_ip, btree_id, pos, old_u64s, new_u64s),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__array(char, trans_fn, 24 )
|
|
|
|
__field(unsigned long, caller_ip )
|
|
|
|
__field(enum btree_id, btree_id )
|
|
|
|
__field(u64, inode )
|
|
|
|
__field(u64, offset )
|
|
|
|
__field(u32, snapshot )
|
|
|
|
__field(u32, old_u64s )
|
|
|
|
__field(u32, new_u64s )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
strncpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn));
|
|
|
|
__entry->caller_ip = caller_ip;
|
|
|
|
__entry->btree_id = btree_id;
|
|
|
|
__entry->inode = pos->inode;
|
|
|
|
__entry->offset = pos->offset;
|
|
|
|
__entry->snapshot = pos->snapshot;
|
|
|
|
__entry->old_u64s = old_u64s;
|
|
|
|
__entry->new_u64s = new_u64s;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s %pS btree %s pos %llu:%llu:%u old_u64s %u new_u64s %u",
|
|
|
|
__entry->trans_fn,
|
|
|
|
(void *) __entry->caller_ip,
|
|
|
|
bch2_btree_ids[__entry->btree_id],
|
|
|
|
__entry->inode,
|
|
|
|
__entry->offset,
|
|
|
|
__entry->snapshot,
|
|
|
|
__entry->old_u64s,
|
|
|
|
__entry->new_u64s)
|
2022-02-27 16:34:21 +00:00
|
|
|
);
|
|
|
|
|
2017-03-17 06:18:50 +00:00
|
|
|
#endif /* _TRACE_BCACHEFS_H */
|
|
|
|
|
|
|
|
/* This part must be outside protection */
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#define TRACE_INCLUDE_PATH ../../fs/bcachefs
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_FILE
|
|
|
|
#define TRACE_INCLUDE_FILE trace
|
|
|
|
|
|
|
|
#include <trace/define_trace.h>
|