11c6fdbd8SKent Overstreet /* SPDX-License-Identifier: GPL-2.0 */ 21c6fdbd8SKent Overstreet #undef TRACE_SYSTEM 31c6fdbd8SKent Overstreet #define TRACE_SYSTEM bcachefs 41c6fdbd8SKent Overstreet 51c6fdbd8SKent Overstreet #if !defined(_TRACE_BCACHEFS_H) || defined(TRACE_HEADER_MULTI_READ) 61c6fdbd8SKent Overstreet #define _TRACE_BCACHEFS_H 71c6fdbd8SKent Overstreet 81c6fdbd8SKent Overstreet #include <linux/tracepoint.h> 91c6fdbd8SKent Overstreet 109f96568cSKent Overstreet #define TRACE_BPOS_entries(name) \ 119f96568cSKent Overstreet __field(u64, name##_inode ) \ 129f96568cSKent Overstreet __field(u64, name##_offset ) \ 139f96568cSKent Overstreet __field(u32, name##_snapshot ) 149f96568cSKent Overstreet 159f96568cSKent Overstreet #define TRACE_BPOS_assign(dst, src) \ 169f96568cSKent Overstreet __entry->dst##_inode = (src).inode; \ 179f96568cSKent Overstreet __entry->dst##_offset = (src).offset; \ 189f96568cSKent Overstreet __entry->dst##_snapshot = (src).snapshot 199f96568cSKent Overstreet 201c6fdbd8SKent Overstreet DECLARE_EVENT_CLASS(bpos, 2112043cf1SKent Overstreet TP_PROTO(const struct bpos *p), 221c6fdbd8SKent Overstreet TP_ARGS(p), 231c6fdbd8SKent Overstreet 241c6fdbd8SKent Overstreet TP_STRUCT__entry( 259f96568cSKent Overstreet TRACE_BPOS_entries(p) 261c6fdbd8SKent Overstreet ), 271c6fdbd8SKent Overstreet 281c6fdbd8SKent Overstreet TP_fast_assign( 299f96568cSKent Overstreet TRACE_BPOS_assign(p, *p); 301c6fdbd8SKent Overstreet ), 311c6fdbd8SKent Overstreet 329f96568cSKent Overstreet TP_printk("%llu:%llu:%u", __entry->p_inode, __entry->p_offset, __entry->p_snapshot) 331c6fdbd8SKent Overstreet ); 341c6fdbd8SKent Overstreet 351c6fdbd8SKent Overstreet DECLARE_EVENT_CLASS(bkey, 361c6fdbd8SKent Overstreet TP_PROTO(const struct bkey *k), 371c6fdbd8SKent Overstreet TP_ARGS(k), 381c6fdbd8SKent Overstreet 391c6fdbd8SKent Overstreet TP_STRUCT__entry( 401c6fdbd8SKent Overstreet __field(u64, inode ) 411c6fdbd8SKent Overstreet __field(u64, offset ) 421c6fdbd8SKent Overstreet __field(u32, size ) 431c6fdbd8SKent Overstreet ), 441c6fdbd8SKent Overstreet 451c6fdbd8SKent Overstreet TP_fast_assign( 461c6fdbd8SKent Overstreet __entry->inode = k->p.inode; 471c6fdbd8SKent Overstreet __entry->offset = k->p.offset; 481c6fdbd8SKent Overstreet __entry->size = k->size; 491c6fdbd8SKent Overstreet ), 501c6fdbd8SKent Overstreet 511c6fdbd8SKent Overstreet TP_printk("%llu:%llu len %u", __entry->inode, 521c6fdbd8SKent Overstreet __entry->offset, __entry->size) 531c6fdbd8SKent Overstreet ); 541c6fdbd8SKent Overstreet 55674cfc26SKent Overstreet DECLARE_EVENT_CLASS(btree_node, 56674cfc26SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 57674cfc26SKent Overstreet TP_ARGS(c, b), 58674cfc26SKent Overstreet 59674cfc26SKent Overstreet TP_STRUCT__entry( 60674cfc26SKent Overstreet __field(dev_t, dev ) 61674cfc26SKent Overstreet __field(u8, level ) 62674cfc26SKent Overstreet __field(u8, btree_id ) 63674cfc26SKent Overstreet TRACE_BPOS_entries(pos) 64674cfc26SKent Overstreet ), 65674cfc26SKent Overstreet 66674cfc26SKent Overstreet TP_fast_assign( 67674cfc26SKent Overstreet __entry->dev = c->dev; 68674cfc26SKent Overstreet __entry->level = b->c.level; 69674cfc26SKent Overstreet __entry->btree_id = b->c.btree_id; 70674cfc26SKent Overstreet TRACE_BPOS_assign(pos, b->key.k.p); 71674cfc26SKent Overstreet ), 72674cfc26SKent Overstreet 73674cfc26SKent Overstreet TP_printk("%d,%d %u %s %llu:%llu:%u", 74674cfc26SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 75674cfc26SKent Overstreet __entry->level, 76674cfc26SKent Overstreet bch2_btree_ids[__entry->btree_id], 77674cfc26SKent Overstreet __entry->pos_inode, __entry->pos_offset, __entry->pos_snapshot) 78674cfc26SKent Overstreet ); 79674cfc26SKent Overstreet 801c6fdbd8SKent Overstreet DECLARE_EVENT_CLASS(bch_fs, 811c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c), 821c6fdbd8SKent Overstreet TP_ARGS(c), 831c6fdbd8SKent Overstreet 841c6fdbd8SKent Overstreet TP_STRUCT__entry( 85ddc7dd62SKent Overstreet __field(dev_t, dev ) 861c6fdbd8SKent Overstreet ), 871c6fdbd8SKent Overstreet 881c6fdbd8SKent Overstreet TP_fast_assign( 89ddc7dd62SKent Overstreet __entry->dev = c->dev; 901c6fdbd8SKent Overstreet ), 911c6fdbd8SKent Overstreet 92ddc7dd62SKent Overstreet TP_printk("%d,%d", MAJOR(__entry->dev), MINOR(__entry->dev)) 931c6fdbd8SKent Overstreet ); 941c6fdbd8SKent Overstreet 951c6fdbd8SKent Overstreet DECLARE_EVENT_CLASS(bio, 961c6fdbd8SKent Overstreet TP_PROTO(struct bio *bio), 971c6fdbd8SKent Overstreet TP_ARGS(bio), 981c6fdbd8SKent Overstreet 991c6fdbd8SKent Overstreet TP_STRUCT__entry( 1001c6fdbd8SKent Overstreet __field(dev_t, dev ) 1011c6fdbd8SKent Overstreet __field(sector_t, sector ) 1021c6fdbd8SKent Overstreet __field(unsigned int, nr_sector ) 1031c6fdbd8SKent Overstreet __array(char, rwbs, 6 ) 1041c6fdbd8SKent Overstreet ), 1051c6fdbd8SKent Overstreet 1061c6fdbd8SKent Overstreet TP_fast_assign( 1071c6fdbd8SKent Overstreet __entry->dev = bio->bi_bdev ? bio_dev(bio) : 0; 1081c6fdbd8SKent Overstreet __entry->sector = bio->bi_iter.bi_sector; 1091c6fdbd8SKent Overstreet __entry->nr_sector = bio->bi_iter.bi_size >> 9; 1101c6fdbd8SKent Overstreet blk_fill_rwbs(__entry->rwbs, bio->bi_opf); 1111c6fdbd8SKent Overstreet ), 1121c6fdbd8SKent Overstreet 1131c6fdbd8SKent Overstreet TP_printk("%d,%d %s %llu + %u", 1141c6fdbd8SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 1151c6fdbd8SKent Overstreet (unsigned long long)__entry->sector, __entry->nr_sector) 1161c6fdbd8SKent Overstreet ); 1171c6fdbd8SKent Overstreet 1184254f5bfSKent Overstreet /* super-io.c: */ 1194254f5bfSKent Overstreet TRACE_EVENT(write_super, 1204254f5bfSKent Overstreet TP_PROTO(struct bch_fs *c, unsigned long ip), 1214254f5bfSKent Overstreet TP_ARGS(c, ip), 1224254f5bfSKent Overstreet 1234254f5bfSKent Overstreet TP_STRUCT__entry( 1244254f5bfSKent Overstreet __field(dev_t, dev ) 1254254f5bfSKent Overstreet __field(unsigned long, ip ) 1264254f5bfSKent Overstreet ), 1274254f5bfSKent Overstreet 1284254f5bfSKent Overstreet TP_fast_assign( 1294254f5bfSKent Overstreet __entry->dev = c->dev; 1304254f5bfSKent Overstreet __entry->ip = ip; 1314254f5bfSKent Overstreet ), 1324254f5bfSKent Overstreet 1334254f5bfSKent Overstreet TP_printk("%d,%d for %pS", 1344254f5bfSKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 1354254f5bfSKent Overstreet (void *) __entry->ip) 1364254f5bfSKent Overstreet ); 1374254f5bfSKent Overstreet 1381c6fdbd8SKent Overstreet /* io.c: */ 1391c6fdbd8SKent Overstreet 140674cfc26SKent Overstreet DEFINE_EVENT(bio, read_promote, 1411c6fdbd8SKent Overstreet TP_PROTO(struct bio *bio), 1421c6fdbd8SKent Overstreet TP_ARGS(bio) 1431c6fdbd8SKent Overstreet ); 1441c6fdbd8SKent Overstreet 1451c6fdbd8SKent Overstreet DEFINE_EVENT(bio, read_bounce, 1461c6fdbd8SKent Overstreet TP_PROTO(struct bio *bio), 1471c6fdbd8SKent Overstreet TP_ARGS(bio) 1481c6fdbd8SKent Overstreet ); 1491c6fdbd8SKent Overstreet 150674cfc26SKent Overstreet DEFINE_EVENT(bio, read_split, 151674cfc26SKent Overstreet TP_PROTO(struct bio *bio), 152674cfc26SKent Overstreet TP_ARGS(bio) 153674cfc26SKent Overstreet ); 154674cfc26SKent Overstreet 1551c6fdbd8SKent Overstreet DEFINE_EVENT(bio, read_retry, 1561c6fdbd8SKent Overstreet TP_PROTO(struct bio *bio), 1571c6fdbd8SKent Overstreet TP_ARGS(bio) 1581c6fdbd8SKent Overstreet ); 1591c6fdbd8SKent Overstreet 160674cfc26SKent Overstreet DEFINE_EVENT(bio, read_reuse_race, 1611c6fdbd8SKent Overstreet TP_PROTO(struct bio *bio), 1621c6fdbd8SKent Overstreet TP_ARGS(bio) 1631c6fdbd8SKent Overstreet ); 1641c6fdbd8SKent Overstreet 1651c6fdbd8SKent Overstreet /* Journal */ 1661c6fdbd8SKent Overstreet 1671c6fdbd8SKent Overstreet DEFINE_EVENT(bch_fs, journal_full, 1681c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c), 1691c6fdbd8SKent Overstreet TP_ARGS(c) 1701c6fdbd8SKent Overstreet ); 1711c6fdbd8SKent Overstreet 1721c6fdbd8SKent Overstreet DEFINE_EVENT(bch_fs, journal_entry_full, 1731c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c), 1741c6fdbd8SKent Overstreet TP_ARGS(c) 1751c6fdbd8SKent Overstreet ); 1761c6fdbd8SKent Overstreet 1771c6fdbd8SKent Overstreet DEFINE_EVENT(bio, journal_write, 1781c6fdbd8SKent Overstreet TP_PROTO(struct bio *bio), 1791c6fdbd8SKent Overstreet TP_ARGS(bio) 1801c6fdbd8SKent Overstreet ); 1811c6fdbd8SKent Overstreet 1828a92e545SKent Overstreet TRACE_EVENT(journal_reclaim_start, 1831f93726eSKent Overstreet TP_PROTO(struct bch_fs *c, bool direct, bool kicked, 1841f93726eSKent Overstreet u64 min_nr, u64 min_key_cache, 1858a92e545SKent Overstreet u64 prereserved, u64 prereserved_total, 1868a92e545SKent Overstreet u64 btree_cache_dirty, u64 btree_cache_total, 1878a92e545SKent Overstreet u64 btree_key_cache_dirty, u64 btree_key_cache_total), 1881f93726eSKent Overstreet TP_ARGS(c, direct, kicked, min_nr, min_key_cache, prereserved, prereserved_total, 1898a92e545SKent Overstreet btree_cache_dirty, btree_cache_total, 1908a92e545SKent Overstreet btree_key_cache_dirty, btree_key_cache_total), 1918a92e545SKent Overstreet 1928a92e545SKent Overstreet TP_STRUCT__entry( 193ddc7dd62SKent Overstreet __field(dev_t, dev ) 1941f93726eSKent Overstreet __field(bool, direct ) 1951f93726eSKent Overstreet __field(bool, kicked ) 1968a92e545SKent Overstreet __field(u64, min_nr ) 1971f93726eSKent Overstreet __field(u64, min_key_cache ) 1988a92e545SKent Overstreet __field(u64, prereserved ) 1998a92e545SKent Overstreet __field(u64, prereserved_total ) 2008a92e545SKent Overstreet __field(u64, btree_cache_dirty ) 2018a92e545SKent Overstreet __field(u64, btree_cache_total ) 2028a92e545SKent Overstreet __field(u64, btree_key_cache_dirty ) 2038a92e545SKent Overstreet __field(u64, btree_key_cache_total ) 2048a92e545SKent Overstreet ), 2058a92e545SKent Overstreet 2068a92e545SKent Overstreet TP_fast_assign( 207ddc7dd62SKent Overstreet __entry->dev = c->dev; 2081f93726eSKent Overstreet __entry->direct = direct; 2091f93726eSKent Overstreet __entry->kicked = kicked; 2108a92e545SKent Overstreet __entry->min_nr = min_nr; 2111f93726eSKent Overstreet __entry->min_key_cache = min_key_cache; 2128a92e545SKent Overstreet __entry->prereserved = prereserved; 2138a92e545SKent Overstreet __entry->prereserved_total = prereserved_total; 2148a92e545SKent Overstreet __entry->btree_cache_dirty = btree_cache_dirty; 2158a92e545SKent Overstreet __entry->btree_cache_total = btree_cache_total; 2168a92e545SKent Overstreet __entry->btree_key_cache_dirty = btree_key_cache_dirty; 2178a92e545SKent Overstreet __entry->btree_key_cache_total = btree_key_cache_total; 2188a92e545SKent Overstreet ), 2198a92e545SKent Overstreet 2201f93726eSKent Overstreet TP_printk("%d,%d direct %u kicked %u min %llu key cache %llu prereserved %llu/%llu btree cache %llu/%llu key cache %llu/%llu", 221ddc7dd62SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 2221f93726eSKent Overstreet __entry->direct, 2231f93726eSKent Overstreet __entry->kicked, 2248a92e545SKent Overstreet __entry->min_nr, 2251f93726eSKent Overstreet __entry->min_key_cache, 2268a92e545SKent Overstreet __entry->prereserved, 2278a92e545SKent Overstreet __entry->prereserved_total, 2288a92e545SKent Overstreet __entry->btree_cache_dirty, 2298a92e545SKent Overstreet __entry->btree_cache_total, 2308a92e545SKent Overstreet __entry->btree_key_cache_dirty, 2318a92e545SKent Overstreet __entry->btree_key_cache_total) 2328a92e545SKent Overstreet ); 2338a92e545SKent Overstreet 2348a92e545SKent Overstreet TRACE_EVENT(journal_reclaim_finish, 2358a92e545SKent Overstreet TP_PROTO(struct bch_fs *c, u64 nr_flushed), 2368a92e545SKent Overstreet TP_ARGS(c, nr_flushed), 2378a92e545SKent Overstreet 2388a92e545SKent Overstreet TP_STRUCT__entry( 239ddc7dd62SKent Overstreet __field(dev_t, dev ) 2408a92e545SKent Overstreet __field(u64, nr_flushed ) 2418a92e545SKent Overstreet ), 2428a92e545SKent Overstreet 2438a92e545SKent Overstreet TP_fast_assign( 244ddc7dd62SKent Overstreet __entry->dev = c->dev; 2458a92e545SKent Overstreet __entry->nr_flushed = nr_flushed; 2468a92e545SKent Overstreet ), 2478a92e545SKent Overstreet 2481f93726eSKent Overstreet TP_printk("%d,%d flushed %llu", 249ddc7dd62SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 250ddc7dd62SKent Overstreet __entry->nr_flushed) 2518a92e545SKent Overstreet ); 2528a92e545SKent Overstreet 2531c6fdbd8SKent Overstreet /* bset.c: */ 2541c6fdbd8SKent Overstreet 2551c6fdbd8SKent Overstreet DEFINE_EVENT(bpos, bkey_pack_pos_fail, 25612043cf1SKent Overstreet TP_PROTO(const struct bpos *p), 2571c6fdbd8SKent Overstreet TP_ARGS(p) 2581c6fdbd8SKent Overstreet ); 2591c6fdbd8SKent Overstreet 260674cfc26SKent Overstreet /* Btree cache: */ 2611c6fdbd8SKent Overstreet 262674cfc26SKent Overstreet TRACE_EVENT(btree_cache_scan, 263674cfc26SKent Overstreet TP_PROTO(long nr_to_scan, long can_free, long ret), 264674cfc26SKent Overstreet TP_ARGS(nr_to_scan, can_free, ret), 2651c6fdbd8SKent Overstreet 2661c6fdbd8SKent Overstreet TP_STRUCT__entry( 267674cfc26SKent Overstreet __field(long, nr_to_scan ) 268674cfc26SKent Overstreet __field(long, can_free ) 269674cfc26SKent Overstreet __field(long, ret ) 2701c6fdbd8SKent Overstreet ), 2711c6fdbd8SKent Overstreet 2721c6fdbd8SKent Overstreet TP_fast_assign( 273674cfc26SKent Overstreet __entry->nr_to_scan = nr_to_scan; 274674cfc26SKent Overstreet __entry->can_free = can_free; 275674cfc26SKent Overstreet __entry->ret = ret; 2761c6fdbd8SKent Overstreet ), 2771c6fdbd8SKent Overstreet 278674cfc26SKent Overstreet TP_printk("scanned for %li nodes, can free %li, ret %li", 279674cfc26SKent Overstreet __entry->nr_to_scan, __entry->can_free, __entry->ret) 2801c6fdbd8SKent Overstreet ); 2811c6fdbd8SKent Overstreet 282674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_cache_reap, 2831c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 2841c6fdbd8SKent Overstreet TP_ARGS(c, b) 2851c6fdbd8SKent Overstreet ); 2861c6fdbd8SKent Overstreet 287674cfc26SKent Overstreet DEFINE_EVENT(bch_fs, btree_cache_cannibalize_lock_fail, 288674cfc26SKent Overstreet TP_PROTO(struct bch_fs *c), 289674cfc26SKent Overstreet TP_ARGS(c) 290674cfc26SKent Overstreet ); 291674cfc26SKent Overstreet 292674cfc26SKent Overstreet DEFINE_EVENT(bch_fs, btree_cache_cannibalize_lock, 293674cfc26SKent Overstreet TP_PROTO(struct bch_fs *c), 294674cfc26SKent Overstreet TP_ARGS(c) 295674cfc26SKent Overstreet ); 296674cfc26SKent Overstreet 297674cfc26SKent Overstreet DEFINE_EVENT(bch_fs, btree_cache_cannibalize, 298674cfc26SKent Overstreet TP_PROTO(struct bch_fs *c), 299674cfc26SKent Overstreet TP_ARGS(c) 300674cfc26SKent Overstreet ); 301674cfc26SKent Overstreet 302674cfc26SKent Overstreet DEFINE_EVENT(bch_fs, btree_cache_cannibalize_unlock, 303674cfc26SKent Overstreet TP_PROTO(struct bch_fs *c), 304674cfc26SKent Overstreet TP_ARGS(c) 305674cfc26SKent Overstreet ); 306674cfc26SKent Overstreet 307674cfc26SKent Overstreet /* Btree */ 308674cfc26SKent Overstreet 309674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_node_read, 310674cfc26SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 311674cfc26SKent Overstreet TP_ARGS(c, b) 312674cfc26SKent Overstreet ); 313674cfc26SKent Overstreet 314674cfc26SKent Overstreet TRACE_EVENT(btree_node_write, 3151c6fdbd8SKent Overstreet TP_PROTO(struct btree *b, unsigned bytes, unsigned sectors), 3161c6fdbd8SKent Overstreet TP_ARGS(b, bytes, sectors), 3171c6fdbd8SKent Overstreet 3181c6fdbd8SKent Overstreet TP_STRUCT__entry( 31926609b61SKent Overstreet __field(enum btree_node_type, type) 3201c6fdbd8SKent Overstreet __field(unsigned, bytes ) 3211c6fdbd8SKent Overstreet __field(unsigned, sectors ) 3221c6fdbd8SKent Overstreet ), 3231c6fdbd8SKent Overstreet 3241c6fdbd8SKent Overstreet TP_fast_assign( 3251c6fdbd8SKent Overstreet __entry->type = btree_node_type(b); 3261c6fdbd8SKent Overstreet __entry->bytes = bytes; 3271c6fdbd8SKent Overstreet __entry->sectors = sectors; 3281c6fdbd8SKent Overstreet ), 3291c6fdbd8SKent Overstreet 3301c6fdbd8SKent Overstreet TP_printk("bkey type %u bytes %u sectors %u", 3311c6fdbd8SKent Overstreet __entry->type , __entry->bytes, __entry->sectors) 3321c6fdbd8SKent Overstreet ); 3331c6fdbd8SKent Overstreet 3341c6fdbd8SKent Overstreet DEFINE_EVENT(btree_node, btree_node_alloc, 3351c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3361c6fdbd8SKent Overstreet TP_ARGS(c, b) 3371c6fdbd8SKent Overstreet ); 3381c6fdbd8SKent Overstreet 3391c6fdbd8SKent Overstreet DEFINE_EVENT(btree_node, btree_node_free, 3401c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3411c6fdbd8SKent Overstreet TP_ARGS(c, b) 3421c6fdbd8SKent Overstreet ); 3431c6fdbd8SKent Overstreet 3441c6fdbd8SKent Overstreet TRACE_EVENT(btree_reserve_get_fail, 3455f417394SKent Overstreet TP_PROTO(const char *trans_fn, 3465f417394SKent Overstreet unsigned long caller_ip, 347*adf6360bSKent Overstreet size_t required, 348*adf6360bSKent Overstreet int ret), 349*adf6360bSKent Overstreet TP_ARGS(trans_fn, caller_ip, required, ret), 3501c6fdbd8SKent Overstreet 3511c6fdbd8SKent Overstreet TP_STRUCT__entry( 3525f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 3535f417394SKent Overstreet __field(unsigned long, caller_ip ) 3541c6fdbd8SKent Overstreet __field(size_t, required ) 355*adf6360bSKent Overstreet __array(char, ret, 32 ) 3561c6fdbd8SKent Overstreet ), 3571c6fdbd8SKent Overstreet 3581c6fdbd8SKent Overstreet TP_fast_assign( 359a1019576SKent Overstreet strscpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn)); 3605f417394SKent Overstreet __entry->caller_ip = caller_ip; 3611c6fdbd8SKent Overstreet __entry->required = required; 362*adf6360bSKent Overstreet strscpy(__entry->ret, bch2_err_str(ret), sizeof(__entry->ret)); 3631c6fdbd8SKent Overstreet ), 3641c6fdbd8SKent Overstreet 365*adf6360bSKent Overstreet TP_printk("%s %pS required %zu ret %s", 3665f417394SKent Overstreet __entry->trans_fn, 3675f417394SKent Overstreet (void *) __entry->caller_ip, 368*adf6360bSKent Overstreet __entry->required, 369*adf6360bSKent Overstreet __entry->ret) 3701c6fdbd8SKent Overstreet ); 3711c6fdbd8SKent Overstreet 372674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_node_compact, 3731c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3741c6fdbd8SKent Overstreet TP_ARGS(c, b) 3751c6fdbd8SKent Overstreet ); 3761c6fdbd8SKent Overstreet 377674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_node_merge, 3781c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3791c6fdbd8SKent Overstreet TP_ARGS(c, b) 3801c6fdbd8SKent Overstreet ); 3811c6fdbd8SKent Overstreet 382674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_node_split, 3831c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3841c6fdbd8SKent Overstreet TP_ARGS(c, b) 3851c6fdbd8SKent Overstreet ); 3861c6fdbd8SKent Overstreet 387674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_node_rewrite, 3881f93726eSKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3891f93726eSKent Overstreet TP_ARGS(c, b) 3901f93726eSKent Overstreet ); 3911f93726eSKent Overstreet 392674cfc26SKent Overstreet DEFINE_EVENT(btree_node, btree_node_set_root, 3931c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, struct btree *b), 3941c6fdbd8SKent Overstreet TP_ARGS(c, b) 3951c6fdbd8SKent Overstreet ); 3961c6fdbd8SKent Overstreet 397674cfc26SKent Overstreet TRACE_EVENT(btree_path_relock_fail, 3989f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 399bc82d08bSKent Overstreet unsigned long caller_ip, 4009f96568cSKent Overstreet struct btree_path *path, 4019f96568cSKent Overstreet unsigned level), 4029f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path, level), 403bc82d08bSKent Overstreet 404bc82d08bSKent Overstreet TP_STRUCT__entry( 4055f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 4064b59a319SKent Overstreet __field(unsigned long, caller_ip ) 407bc82d08bSKent Overstreet __field(u8, btree_id ) 408367d72ddSKent Overstreet __field(u8, level ) 4099f96568cSKent Overstreet TRACE_BPOS_entries(pos) 4105f1dd9a6SKent Overstreet __array(char, node, 24 ) 411bc82d08bSKent Overstreet __field(u32, iter_lock_seq ) 412bc82d08bSKent Overstreet __field(u32, node_lock_seq ) 413bc82d08bSKent Overstreet ), 414bc82d08bSKent Overstreet 415bc82d08bSKent Overstreet TP_fast_assign( 4165f1dd9a6SKent Overstreet struct btree *b = btree_path_node(path, level); 4175f1dd9a6SKent Overstreet 418a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 4194b59a319SKent Overstreet __entry->caller_ip = caller_ip; 4209f96568cSKent Overstreet __entry->btree_id = path->btree_id; 421367d72ddSKent Overstreet __entry->level = path->level; 4229f96568cSKent Overstreet TRACE_BPOS_assign(pos, path->pos); 4235f1dd9a6SKent Overstreet if (IS_ERR(b)) 4245f1dd9a6SKent Overstreet strscpy(__entry->node, bch2_err_str(PTR_ERR(b)), sizeof(__entry->node)); 4255f1dd9a6SKent Overstreet else 4265f1dd9a6SKent Overstreet scnprintf(__entry->node, sizeof(__entry->node), "%px", b); 4279f96568cSKent Overstreet __entry->iter_lock_seq = path->l[level].lock_seq; 4289f96568cSKent Overstreet __entry->node_lock_seq = is_btree_node(path, level) ? path->l[level].b->c.lock.state.seq : 0; 429bc82d08bSKent Overstreet ), 430bc82d08bSKent Overstreet 431367d72ddSKent Overstreet TP_printk("%s %pS btree %s pos %llu:%llu:%u level %u node %s iter seq %u lock seq %u", 432bc82d08bSKent Overstreet __entry->trans_fn, 4334b59a319SKent Overstreet (void *) __entry->caller_ip, 4349f96568cSKent Overstreet bch2_btree_ids[__entry->btree_id], 435bc82d08bSKent Overstreet __entry->pos_inode, 436bc82d08bSKent Overstreet __entry->pos_offset, 437bc82d08bSKent Overstreet __entry->pos_snapshot, 438367d72ddSKent Overstreet __entry->level, 439bc82d08bSKent Overstreet __entry->node, 440bc82d08bSKent Overstreet __entry->iter_lock_seq, 441bc82d08bSKent Overstreet __entry->node_lock_seq) 442bc82d08bSKent Overstreet ); 443bc82d08bSKent Overstreet 444674cfc26SKent Overstreet TRACE_EVENT(btree_path_upgrade_fail, 4459f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 44649e401faSKent Overstreet unsigned long caller_ip, 4479f96568cSKent Overstreet struct btree_path *path, 4489f96568cSKent Overstreet unsigned level), 4499f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path, level), 45049e401faSKent Overstreet 45149e401faSKent Overstreet TP_STRUCT__entry( 4525f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 45349e401faSKent Overstreet __field(unsigned long, caller_ip ) 45449e401faSKent Overstreet __field(u8, btree_id ) 455367d72ddSKent Overstreet __field(u8, level ) 4569f96568cSKent Overstreet TRACE_BPOS_entries(pos) 45749e401faSKent Overstreet __field(u8, locked ) 45849e401faSKent Overstreet __field(u8, self_read_count ) 45949e401faSKent Overstreet __field(u8, self_intent_count) 4609f96568cSKent Overstreet __field(u8, read_count ) 46149e401faSKent Overstreet __field(u8, intent_count ) 462367d72ddSKent Overstreet __field(u32, iter_lock_seq ) 463367d72ddSKent Overstreet __field(u32, node_lock_seq ) 46449e401faSKent Overstreet ), 46549e401faSKent Overstreet 46649e401faSKent Overstreet TP_fast_assign( 4679f96568cSKent Overstreet struct six_lock_count c; 4689f96568cSKent Overstreet 469a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 47049e401faSKent Overstreet __entry->caller_ip = caller_ip; 4719f96568cSKent Overstreet __entry->btree_id = path->btree_id; 472367d72ddSKent Overstreet __entry->level = level; 4739f96568cSKent Overstreet TRACE_BPOS_assign(pos, path->pos); 4749f96568cSKent Overstreet __entry->locked = btree_node_locked(path, level); 4759f96568cSKent Overstreet 47614599cceSKent Overstreet c = bch2_btree_node_lock_counts(trans, NULL, &path->l[level].b->c, level), 477e3738c69SKent Overstreet __entry->self_read_count = c.n[SIX_LOCK_read]; 478e3738c69SKent Overstreet __entry->self_intent_count = c.n[SIX_LOCK_intent]; 4799f96568cSKent Overstreet c = six_lock_counts(&path->l[level].b->c.lock); 480e3738c69SKent Overstreet __entry->read_count = c.n[SIX_LOCK_read]; 481e3738c69SKent Overstreet __entry->intent_count = c.n[SIX_LOCK_read]; 482367d72ddSKent Overstreet __entry->iter_lock_seq = path->l[level].lock_seq; 483367d72ddSKent Overstreet __entry->node_lock_seq = is_btree_node(path, level) ? path->l[level].b->c.lock.state.seq : 0; 48449e401faSKent Overstreet ), 48549e401faSKent Overstreet 486367d72ddSKent Overstreet TP_printk("%s %pS btree %s pos %llu:%llu:%u level %u locked %u held %u:%u lock count %u:%u iter seq %u lock seq %u", 48749e401faSKent Overstreet __entry->trans_fn, 48849e401faSKent Overstreet (void *) __entry->caller_ip, 4899f96568cSKent Overstreet bch2_btree_ids[__entry->btree_id], 49049e401faSKent Overstreet __entry->pos_inode, 49149e401faSKent Overstreet __entry->pos_offset, 49249e401faSKent Overstreet __entry->pos_snapshot, 493367d72ddSKent Overstreet __entry->level, 49449e401faSKent Overstreet __entry->locked, 49549e401faSKent Overstreet __entry->self_read_count, 49649e401faSKent Overstreet __entry->self_intent_count, 49749e401faSKent Overstreet __entry->read_count, 498367d72ddSKent Overstreet __entry->intent_count, 499367d72ddSKent Overstreet __entry->iter_lock_seq, 500367d72ddSKent Overstreet __entry->node_lock_seq) 50149e401faSKent Overstreet ); 50249e401faSKent Overstreet 5031c6fdbd8SKent Overstreet /* Garbage collection */ 5041c6fdbd8SKent Overstreet 5051f93726eSKent Overstreet DEFINE_EVENT(bch_fs, gc_gens_start, 5061c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c), 5071c6fdbd8SKent Overstreet TP_ARGS(c) 5081c6fdbd8SKent Overstreet ); 5091c6fdbd8SKent Overstreet 5101f93726eSKent Overstreet DEFINE_EVENT(bch_fs, gc_gens_end, 5111c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c), 5121c6fdbd8SKent Overstreet TP_ARGS(c) 5131c6fdbd8SKent Overstreet ); 5141c6fdbd8SKent Overstreet 5151c6fdbd8SKent Overstreet /* Allocator */ 5161c6fdbd8SKent Overstreet 5171c6fdbd8SKent Overstreet DECLARE_EVENT_CLASS(bucket_alloc, 518f25d8215SKent Overstreet TP_PROTO(struct bch_dev *ca, const char *alloc_reserve, 51968b6cd19SKent Overstreet bool user, 52068b6cd19SKent Overstreet u64 bucket, 5218ef98313SKent Overstreet u64 free, 522f25d8215SKent Overstreet u64 avail, 5238ef98313SKent Overstreet u64 copygc_wait_amount, 5248ef98313SKent Overstreet s64 copygc_waiting_for, 525ae10fe01SKent Overstreet struct bucket_alloc_state *s, 526f25d8215SKent Overstreet bool nonblocking, 527615f867cSKent Overstreet const char *err), 52868b6cd19SKent Overstreet TP_ARGS(ca, alloc_reserve, user, bucket, free, avail, 52968b6cd19SKent Overstreet copygc_wait_amount, copygc_waiting_for, 530ae10fe01SKent Overstreet s, nonblocking, err), 5311c6fdbd8SKent Overstreet 5321c6fdbd8SKent Overstreet TP_STRUCT__entry( 53389baec78SKent Overstreet __field(dev_t, dev ) 5343e154711SKent Overstreet __array(char, reserve, 16 ) 53568b6cd19SKent Overstreet __field(bool, user ) 53668b6cd19SKent Overstreet __field(u64, bucket ) 5378ef98313SKent Overstreet __field(u64, free ) 538f25d8215SKent Overstreet __field(u64, avail ) 5398ef98313SKent Overstreet __field(u64, copygc_wait_amount ) 5408ef98313SKent Overstreet __field(s64, copygc_waiting_for ) 541f25d8215SKent Overstreet __field(u64, seen ) 542f25d8215SKent Overstreet __field(u64, open ) 543f25d8215SKent Overstreet __field(u64, need_journal_commit ) 544f25d8215SKent Overstreet __field(u64, nouse ) 545f25d8215SKent Overstreet __field(bool, nonblocking ) 54668b6cd19SKent Overstreet __array(char, err, 32 ) 5471c6fdbd8SKent Overstreet ), 5481c6fdbd8SKent Overstreet 5491c6fdbd8SKent Overstreet TP_fast_assign( 550eacb2574SKent Overstreet __entry->dev = ca->dev; 551a1019576SKent Overstreet strscpy(__entry->reserve, alloc_reserve, sizeof(__entry->reserve)); 55268b6cd19SKent Overstreet __entry->user = user; 55368b6cd19SKent Overstreet __entry->bucket = bucket; 5548ef98313SKent Overstreet __entry->free = free; 555f25d8215SKent Overstreet __entry->avail = avail; 5568ef98313SKent Overstreet __entry->copygc_wait_amount = copygc_wait_amount; 5578ef98313SKent Overstreet __entry->copygc_waiting_for = copygc_waiting_for; 558ae10fe01SKent Overstreet __entry->seen = s->buckets_seen; 559ae10fe01SKent Overstreet __entry->open = s->skipped_open; 560ae10fe01SKent Overstreet __entry->need_journal_commit = s->skipped_need_journal_commit; 561ae10fe01SKent Overstreet __entry->nouse = s->skipped_nouse; 562f25d8215SKent Overstreet __entry->nonblocking = nonblocking; 563a1019576SKent Overstreet strscpy(__entry->err, err, sizeof(__entry->err)); 5641c6fdbd8SKent Overstreet ), 5651c6fdbd8SKent Overstreet 56668b6cd19SKent Overstreet TP_printk("%d,%d reserve %s user %u bucket %llu free %llu avail %llu copygc_wait %llu/%lli seen %llu open %llu need_journal_commit %llu nouse %llu nonblocking %u err %s", 56789baec78SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 568f25d8215SKent Overstreet __entry->reserve, 56968b6cd19SKent Overstreet __entry->user, 57068b6cd19SKent Overstreet __entry->bucket, 5718ef98313SKent Overstreet __entry->free, 572f25d8215SKent Overstreet __entry->avail, 5738ef98313SKent Overstreet __entry->copygc_wait_amount, 5748ef98313SKent Overstreet __entry->copygc_waiting_for, 575f25d8215SKent Overstreet __entry->seen, 576f25d8215SKent Overstreet __entry->open, 577f25d8215SKent Overstreet __entry->need_journal_commit, 578f25d8215SKent Overstreet __entry->nouse, 579f25d8215SKent Overstreet __entry->nonblocking, 580615f867cSKent Overstreet __entry->err) 5811c6fdbd8SKent Overstreet ); 5821c6fdbd8SKent Overstreet 5831c6fdbd8SKent Overstreet DEFINE_EVENT(bucket_alloc, bucket_alloc, 584f25d8215SKent Overstreet TP_PROTO(struct bch_dev *ca, const char *alloc_reserve, 58568b6cd19SKent Overstreet bool user, 58668b6cd19SKent Overstreet u64 bucket, 5878ef98313SKent Overstreet u64 free, 588f25d8215SKent Overstreet u64 avail, 5898ef98313SKent Overstreet u64 copygc_wait_amount, 5908ef98313SKent Overstreet s64 copygc_waiting_for, 591ae10fe01SKent Overstreet struct bucket_alloc_state *s, 592f25d8215SKent Overstreet bool nonblocking, 593615f867cSKent Overstreet const char *err), 59468b6cd19SKent Overstreet TP_ARGS(ca, alloc_reserve, user, bucket, free, avail, 59568b6cd19SKent Overstreet copygc_wait_amount, copygc_waiting_for, 596ae10fe01SKent Overstreet s, nonblocking, err) 5971c6fdbd8SKent Overstreet ); 5981c6fdbd8SKent Overstreet 5991c6fdbd8SKent Overstreet DEFINE_EVENT(bucket_alloc, bucket_alloc_fail, 600f25d8215SKent Overstreet TP_PROTO(struct bch_dev *ca, const char *alloc_reserve, 60168b6cd19SKent Overstreet bool user, 60268b6cd19SKent Overstreet u64 bucket, 6038ef98313SKent Overstreet u64 free, 604f25d8215SKent Overstreet u64 avail, 6058ef98313SKent Overstreet u64 copygc_wait_amount, 6068ef98313SKent Overstreet s64 copygc_waiting_for, 607ae10fe01SKent Overstreet struct bucket_alloc_state *s, 608f25d8215SKent Overstreet bool nonblocking, 609615f867cSKent Overstreet const char *err), 61068b6cd19SKent Overstreet TP_ARGS(ca, alloc_reserve, user, bucket, free, avail, 61168b6cd19SKent Overstreet copygc_wait_amount, copygc_waiting_for, 612ae10fe01SKent Overstreet s, nonblocking, err) 6131c6fdbd8SKent Overstreet ); 6141c6fdbd8SKent Overstreet 6151f93726eSKent Overstreet TRACE_EVENT(discard_buckets, 6161f93726eSKent Overstreet TP_PROTO(struct bch_fs *c, u64 seen, u64 open, 617615f867cSKent Overstreet u64 need_journal_commit, u64 discarded, const char *err), 618615f867cSKent Overstreet TP_ARGS(c, seen, open, need_journal_commit, discarded, err), 6191f93726eSKent Overstreet 6201f93726eSKent Overstreet TP_STRUCT__entry( 6211f93726eSKent Overstreet __field(dev_t, dev ) 6221f93726eSKent Overstreet __field(u64, seen ) 6231f93726eSKent Overstreet __field(u64, open ) 6241f93726eSKent Overstreet __field(u64, need_journal_commit ) 6251f93726eSKent Overstreet __field(u64, discarded ) 626615f867cSKent Overstreet __array(char, err, 16 ) 6271f93726eSKent Overstreet ), 6281f93726eSKent Overstreet 6291f93726eSKent Overstreet TP_fast_assign( 6301f93726eSKent Overstreet __entry->dev = c->dev; 6311f93726eSKent Overstreet __entry->seen = seen; 6321f93726eSKent Overstreet __entry->open = open; 6331f93726eSKent Overstreet __entry->need_journal_commit = need_journal_commit; 6341f93726eSKent Overstreet __entry->discarded = discarded; 635a1019576SKent Overstreet strscpy(__entry->err, err, sizeof(__entry->err)); 6361f93726eSKent Overstreet ), 6371f93726eSKent Overstreet 638615f867cSKent Overstreet TP_printk("%d%d seen %llu open %llu need_journal_commit %llu discarded %llu err %s", 6391f93726eSKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 6401f93726eSKent Overstreet __entry->seen, 6411f93726eSKent Overstreet __entry->open, 6421f93726eSKent Overstreet __entry->need_journal_commit, 6431f93726eSKent Overstreet __entry->discarded, 644615f867cSKent Overstreet __entry->err) 6451f93726eSKent Overstreet ); 6461f93726eSKent Overstreet 647674cfc26SKent Overstreet TRACE_EVENT(bucket_invalidate, 64838585367SKent Overstreet TP_PROTO(struct bch_fs *c, unsigned dev, u64 bucket, u32 sectors), 64938585367SKent Overstreet TP_ARGS(c, dev, bucket, sectors), 6501f93726eSKent Overstreet 6511f93726eSKent Overstreet TP_STRUCT__entry( 6521f93726eSKent Overstreet __field(dev_t, dev ) 6531f93726eSKent Overstreet __field(u32, dev_idx ) 65438585367SKent Overstreet __field(u32, sectors ) 6551f93726eSKent Overstreet __field(u64, bucket ) 6561f93726eSKent Overstreet ), 6571f93726eSKent Overstreet 6581f93726eSKent Overstreet TP_fast_assign( 6591f93726eSKent Overstreet __entry->dev = c->dev; 6601f93726eSKent Overstreet __entry->dev_idx = dev; 66138585367SKent Overstreet __entry->sectors = sectors; 6621f93726eSKent Overstreet __entry->bucket = bucket; 6631f93726eSKent Overstreet ), 6641f93726eSKent Overstreet 66538585367SKent Overstreet TP_printk("%d:%d invalidated %u:%llu cached sectors %u", 6661f93726eSKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 66738585367SKent Overstreet __entry->dev_idx, __entry->bucket, 66838585367SKent Overstreet __entry->sectors) 6691f93726eSKent Overstreet ); 6701f93726eSKent Overstreet 6711c6fdbd8SKent Overstreet /* Moving IO */ 6721c6fdbd8SKent Overstreet 673674cfc26SKent Overstreet DEFINE_EVENT(bkey, move_extent_read, 6741c6fdbd8SKent Overstreet TP_PROTO(const struct bkey *k), 6751c6fdbd8SKent Overstreet TP_ARGS(k) 6761c6fdbd8SKent Overstreet ); 6771c6fdbd8SKent Overstreet 678674cfc26SKent Overstreet DEFINE_EVENT(bkey, move_extent_write, 6791c6fdbd8SKent Overstreet TP_PROTO(const struct bkey *k), 6801c6fdbd8SKent Overstreet TP_ARGS(k) 6811c6fdbd8SKent Overstreet ); 6821c6fdbd8SKent Overstreet 683674cfc26SKent Overstreet DEFINE_EVENT(bkey, move_extent_finish, 684674cfc26SKent Overstreet TP_PROTO(const struct bkey *k), 685674cfc26SKent Overstreet TP_ARGS(k) 686674cfc26SKent Overstreet ); 687674cfc26SKent Overstreet 688674cfc26SKent Overstreet DEFINE_EVENT(bkey, move_extent_fail, 689674cfc26SKent Overstreet TP_PROTO(const struct bkey *k), 690674cfc26SKent Overstreet TP_ARGS(k) 691674cfc26SKent Overstreet ); 692674cfc26SKent Overstreet 693674cfc26SKent Overstreet DEFINE_EVENT(bkey, move_extent_alloc_mem_fail, 6941c6fdbd8SKent Overstreet TP_PROTO(const struct bkey *k), 6951c6fdbd8SKent Overstreet TP_ARGS(k) 6961c6fdbd8SKent Overstreet ); 6971c6fdbd8SKent Overstreet 6981c6fdbd8SKent Overstreet TRACE_EVENT(move_data, 6991c6fdbd8SKent Overstreet TP_PROTO(struct bch_fs *c, u64 sectors_moved, 7001c6fdbd8SKent Overstreet u64 keys_moved), 7011c6fdbd8SKent Overstreet TP_ARGS(c, sectors_moved, keys_moved), 7021c6fdbd8SKent Overstreet 7031c6fdbd8SKent Overstreet TP_STRUCT__entry( 704ddc7dd62SKent Overstreet __field(dev_t, dev ) 7051c6fdbd8SKent Overstreet __field(u64, sectors_moved ) 7061c6fdbd8SKent Overstreet __field(u64, keys_moved ) 7071c6fdbd8SKent Overstreet ), 7081c6fdbd8SKent Overstreet 7091c6fdbd8SKent Overstreet TP_fast_assign( 710ddc7dd62SKent Overstreet __entry->dev = c->dev; 7111c6fdbd8SKent Overstreet __entry->sectors_moved = sectors_moved; 7121c6fdbd8SKent Overstreet __entry->keys_moved = keys_moved; 7131c6fdbd8SKent Overstreet ), 7141c6fdbd8SKent Overstreet 715ddc7dd62SKent Overstreet TP_printk("%d,%d sectors_moved %llu keys_moved %llu", 716ddc7dd62SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 717ddc7dd62SKent Overstreet __entry->sectors_moved, __entry->keys_moved) 7181c6fdbd8SKent Overstreet ); 7191c6fdbd8SKent Overstreet 7201c6fdbd8SKent Overstreet TRACE_EVENT(copygc, 721e6d11615SKent Overstreet TP_PROTO(struct bch_fs *c, 7221c6fdbd8SKent Overstreet u64 sectors_moved, u64 sectors_not_moved, 7231c6fdbd8SKent Overstreet u64 buckets_moved, u64 buckets_not_moved), 724e6d11615SKent Overstreet TP_ARGS(c, 7251c6fdbd8SKent Overstreet sectors_moved, sectors_not_moved, 7261c6fdbd8SKent Overstreet buckets_moved, buckets_not_moved), 7271c6fdbd8SKent Overstreet 7281c6fdbd8SKent Overstreet TP_STRUCT__entry( 729ddc7dd62SKent Overstreet __field(dev_t, dev ) 7301c6fdbd8SKent Overstreet __field(u64, sectors_moved ) 7311c6fdbd8SKent Overstreet __field(u64, sectors_not_moved ) 7321c6fdbd8SKent Overstreet __field(u64, buckets_moved ) 7331c6fdbd8SKent Overstreet __field(u64, buckets_not_moved ) 7341c6fdbd8SKent Overstreet ), 7351c6fdbd8SKent Overstreet 7361c6fdbd8SKent Overstreet TP_fast_assign( 737ddc7dd62SKent Overstreet __entry->dev = c->dev; 7381c6fdbd8SKent Overstreet __entry->sectors_moved = sectors_moved; 7391c6fdbd8SKent Overstreet __entry->sectors_not_moved = sectors_not_moved; 7401c6fdbd8SKent Overstreet __entry->buckets_moved = buckets_moved; 7411c6fdbd8SKent Overstreet __entry->buckets_not_moved = buckets_moved; 7421c6fdbd8SKent Overstreet ), 7431c6fdbd8SKent Overstreet 744ddc7dd62SKent Overstreet TP_printk("%d,%d sectors moved %llu remain %llu buckets moved %llu remain %llu", 745ddc7dd62SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 7461c6fdbd8SKent Overstreet __entry->sectors_moved, __entry->sectors_not_moved, 7471c6fdbd8SKent Overstreet __entry->buckets_moved, __entry->buckets_not_moved) 7481c6fdbd8SKent Overstreet ); 7491c6fdbd8SKent Overstreet 75019d2819dSKent Overstreet TRACE_EVENT(copygc_wait, 75119d2819dSKent Overstreet TP_PROTO(struct bch_fs *c, 75219d2819dSKent Overstreet u64 wait_amount, u64 until), 75319d2819dSKent Overstreet TP_ARGS(c, wait_amount, until), 75419d2819dSKent Overstreet 75519d2819dSKent Overstreet TP_STRUCT__entry( 756ddc7dd62SKent Overstreet __field(dev_t, dev ) 75719d2819dSKent Overstreet __field(u64, wait_amount ) 75819d2819dSKent Overstreet __field(u64, until ) 75919d2819dSKent Overstreet ), 76019d2819dSKent Overstreet 76119d2819dSKent Overstreet TP_fast_assign( 762ddc7dd62SKent Overstreet __entry->dev = c->dev; 76319d2819dSKent Overstreet __entry->wait_amount = wait_amount; 76419d2819dSKent Overstreet __entry->until = until; 76519d2819dSKent Overstreet ), 76619d2819dSKent Overstreet 767ddc7dd62SKent Overstreet TP_printk("%d,%u waiting for %llu sectors until %llu", 768ddc7dd62SKent Overstreet MAJOR(__entry->dev), MINOR(__entry->dev), 769ddc7dd62SKent Overstreet __entry->wait_amount, __entry->until) 77019d2819dSKent Overstreet ); 77119d2819dSKent Overstreet 77212043cf1SKent Overstreet /* btree transactions: */ 77312043cf1SKent Overstreet 7741f93726eSKent Overstreet DECLARE_EVENT_CLASS(transaction_event, 7759f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 776531a0095SKent Overstreet unsigned long caller_ip), 7779f96568cSKent Overstreet TP_ARGS(trans, caller_ip), 778ba5c6557SKent Overstreet 779ba5c6557SKent Overstreet TP_STRUCT__entry( 7805f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 781531a0095SKent Overstreet __field(unsigned long, caller_ip ) 782ba5c6557SKent Overstreet ), 783ba5c6557SKent Overstreet 784ba5c6557SKent Overstreet TP_fast_assign( 785a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 786531a0095SKent Overstreet __entry->caller_ip = caller_ip; 787ba5c6557SKent Overstreet ), 788ba5c6557SKent Overstreet 789669f87a5SKent Overstreet TP_printk("%s %pS", __entry->trans_fn, (void *) __entry->caller_ip) 790669f87a5SKent Overstreet ); 791669f87a5SKent Overstreet 7921f93726eSKent Overstreet DEFINE_EVENT(transaction_event, transaction_commit, 7939f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 794669f87a5SKent Overstreet unsigned long caller_ip), 7959f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 796ba5c6557SKent Overstreet ); 797ba5c6557SKent Overstreet 798674cfc26SKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_injected, 7999f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 800a0cb8d78SKent Overstreet unsigned long caller_ip), 8019f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 802a0cb8d78SKent Overstreet ); 803a0cb8d78SKent Overstreet 8041f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_blocked_journal_reclaim, 8059f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 806531a0095SKent Overstreet unsigned long caller_ip), 8079f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 808531a0095SKent Overstreet ); 809531a0095SKent Overstreet 8101f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_journal_res_get, 8119f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 812531a0095SKent Overstreet unsigned long caller_ip), 8139f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 814531a0095SKent Overstreet ); 815531a0095SKent Overstreet 816ce56bf7fSKent Overstreet 817ce56bf7fSKent Overstreet TRACE_EVENT(trans_restart_journal_preres_get, 8189f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 819ce56bf7fSKent Overstreet unsigned long caller_ip, 820ce56bf7fSKent Overstreet unsigned flags), 821ce56bf7fSKent Overstreet TP_ARGS(trans, caller_ip, flags), 822ce56bf7fSKent Overstreet 823ce56bf7fSKent Overstreet TP_STRUCT__entry( 824ce56bf7fSKent Overstreet __array(char, trans_fn, 32 ) 825ce56bf7fSKent Overstreet __field(unsigned long, caller_ip ) 826ce56bf7fSKent Overstreet __field(unsigned, flags ) 827ce56bf7fSKent Overstreet ), 828ce56bf7fSKent Overstreet 829ce56bf7fSKent Overstreet TP_fast_assign( 830a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 831ce56bf7fSKent Overstreet __entry->caller_ip = caller_ip; 832ce56bf7fSKent Overstreet __entry->flags = flags; 833ce56bf7fSKent Overstreet ), 834ce56bf7fSKent Overstreet 835ce56bf7fSKent Overstreet TP_printk("%s %pS %x", __entry->trans_fn, 836ce56bf7fSKent Overstreet (void *) __entry->caller_ip, 837ce56bf7fSKent Overstreet __entry->flags) 838531a0095SKent Overstreet ); 839531a0095SKent Overstreet 8401f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_journal_reclaim, 8419f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 842531a0095SKent Overstreet unsigned long caller_ip), 8439f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 844531a0095SKent Overstreet ); 845531a0095SKent Overstreet 8461f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_fault_inject, 8479f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 848531a0095SKent Overstreet unsigned long caller_ip), 8499f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 850531a0095SKent Overstreet ); 851531a0095SKent Overstreet 8521f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_traverse_all, 8539f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 854531a0095SKent Overstreet unsigned long caller_ip), 8559f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 856531a0095SKent Overstreet ); 857531a0095SKent Overstreet 8581f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_mark_replicas, 8599f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 8601f93726eSKent Overstreet unsigned long caller_ip), 8619f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 8621f93726eSKent Overstreet ); 8631f93726eSKent Overstreet 8641f93726eSKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_key_cache_raced, 8659f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 86612ce5b7dSKent Overstreet unsigned long caller_ip), 8679f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 86812ce5b7dSKent Overstreet ); 86912ce5b7dSKent Overstreet 8700990efaeSKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_too_many_iters, 8719f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 8720990efaeSKent Overstreet unsigned long caller_ip), 8739f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 8740990efaeSKent Overstreet ); 8750990efaeSKent Overstreet 876531a0095SKent Overstreet DECLARE_EVENT_CLASS(transaction_restart_iter, 8779f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 878531a0095SKent Overstreet unsigned long caller_ip, 8799f96568cSKent Overstreet struct btree_path *path), 8809f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path), 881531a0095SKent Overstreet 882531a0095SKent Overstreet TP_STRUCT__entry( 8835f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 8844b59a319SKent Overstreet __field(unsigned long, caller_ip ) 885531a0095SKent Overstreet __field(u8, btree_id ) 8869f96568cSKent Overstreet TRACE_BPOS_entries(pos) 887531a0095SKent Overstreet ), 888531a0095SKent Overstreet 889531a0095SKent Overstreet TP_fast_assign( 890a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 8914b59a319SKent Overstreet __entry->caller_ip = caller_ip; 8929f96568cSKent Overstreet __entry->btree_id = path->btree_id; 8939f96568cSKent Overstreet TRACE_BPOS_assign(pos, path->pos) 894531a0095SKent Overstreet ), 895531a0095SKent Overstreet 8969f96568cSKent Overstreet TP_printk("%s %pS btree %s pos %llu:%llu:%u", 897669f87a5SKent Overstreet __entry->trans_fn, 8984b59a319SKent Overstreet (void *) __entry->caller_ip, 8999f96568cSKent Overstreet bch2_btree_ids[__entry->btree_id], 900531a0095SKent Overstreet __entry->pos_inode, 901531a0095SKent Overstreet __entry->pos_offset, 902531a0095SKent Overstreet __entry->pos_snapshot) 903531a0095SKent Overstreet ); 904531a0095SKent Overstreet 905531a0095SKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_btree_node_reused, 9069f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 907531a0095SKent Overstreet unsigned long caller_ip, 9089f96568cSKent Overstreet struct btree_path *path), 9099f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 910531a0095SKent Overstreet ); 911531a0095SKent Overstreet 912531a0095SKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_btree_node_split, 9139f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 914531a0095SKent Overstreet unsigned long caller_ip, 9159f96568cSKent Overstreet struct btree_path *path), 9169f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 917531a0095SKent Overstreet ); 918531a0095SKent Overstreet 919367d72ddSKent Overstreet TRACE_EVENT(trans_restart_upgrade, 9209f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 921531a0095SKent Overstreet unsigned long caller_ip, 922367d72ddSKent Overstreet struct btree_path *path, 923367d72ddSKent Overstreet unsigned old_locks_want, 924367d72ddSKent Overstreet unsigned new_locks_want), 925367d72ddSKent Overstreet TP_ARGS(trans, caller_ip, path, old_locks_want, new_locks_want), 926531a0095SKent Overstreet 927367d72ddSKent Overstreet TP_STRUCT__entry( 928367d72ddSKent Overstreet __array(char, trans_fn, 32 ) 929367d72ddSKent Overstreet __field(unsigned long, caller_ip ) 930367d72ddSKent Overstreet __field(u8, btree_id ) 931367d72ddSKent Overstreet __field(u8, old_locks_want ) 932367d72ddSKent Overstreet __field(u8, new_locks_want ) 933367d72ddSKent Overstreet TRACE_BPOS_entries(pos) 934367d72ddSKent Overstreet ), 935367d72ddSKent Overstreet 936367d72ddSKent Overstreet TP_fast_assign( 937a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 938367d72ddSKent Overstreet __entry->caller_ip = caller_ip; 939367d72ddSKent Overstreet __entry->btree_id = path->btree_id; 940367d72ddSKent Overstreet __entry->old_locks_want = old_locks_want; 941367d72ddSKent Overstreet __entry->new_locks_want = new_locks_want; 942367d72ddSKent Overstreet TRACE_BPOS_assign(pos, path->pos) 943367d72ddSKent Overstreet ), 944367d72ddSKent Overstreet 945367d72ddSKent Overstreet TP_printk("%s %pS btree %s pos %llu:%llu:%u locks_want %u -> %u", 946367d72ddSKent Overstreet __entry->trans_fn, 947367d72ddSKent Overstreet (void *) __entry->caller_ip, 948367d72ddSKent Overstreet bch2_btree_ids[__entry->btree_id], 949367d72ddSKent Overstreet __entry->pos_inode, 950367d72ddSKent Overstreet __entry->pos_offset, 951367d72ddSKent Overstreet __entry->pos_snapshot, 952367d72ddSKent Overstreet __entry->old_locks_want, 953367d72ddSKent Overstreet __entry->new_locks_want) 954531a0095SKent Overstreet ); 955531a0095SKent Overstreet 956531a0095SKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock, 9579f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 958531a0095SKent Overstreet unsigned long caller_ip, 9599f96568cSKent Overstreet struct btree_path *path), 9609f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 961531a0095SKent Overstreet ); 962531a0095SKent Overstreet 963bc82d08bSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_next_node, 9649f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 965bc82d08bSKent Overstreet unsigned long caller_ip, 9669f96568cSKent Overstreet struct btree_path *path), 9679f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 968bc82d08bSKent Overstreet ); 969bc82d08bSKent Overstreet 970bc82d08bSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_parent_for_fill, 9719f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 972bc82d08bSKent Overstreet unsigned long caller_ip, 9739f96568cSKent Overstreet struct btree_path *path), 9749f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 975bc82d08bSKent Overstreet ); 976bc82d08bSKent Overstreet 977bc82d08bSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_after_fill, 9789f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 979bc82d08bSKent Overstreet unsigned long caller_ip, 9809f96568cSKent Overstreet struct btree_path *path), 9819f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 982bc82d08bSKent Overstreet ); 983bc82d08bSKent Overstreet 984674cfc26SKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_key_cache_upgrade, 9859f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 98649e401faSKent Overstreet unsigned long caller_ip), 9879f96568cSKent Overstreet TP_ARGS(trans, caller_ip) 98849e401faSKent Overstreet ); 98949e401faSKent Overstreet 990bc82d08bSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_key_cache_fill, 9919f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 992bc82d08bSKent Overstreet unsigned long caller_ip, 9939f96568cSKent Overstreet struct btree_path *path), 9949f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 995bc82d08bSKent Overstreet ); 996bc82d08bSKent Overstreet 997bc82d08bSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_path, 9989f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 999bc82d08bSKent Overstreet unsigned long caller_ip, 10009f96568cSKent Overstreet struct btree_path *path), 10019f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 1002bc82d08bSKent Overstreet ); 1003bc82d08bSKent Overstreet 1004bc82d08bSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_relock_path_intent, 10059f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 1006bc82d08bSKent Overstreet unsigned long caller_ip, 10079f96568cSKent Overstreet struct btree_path *path), 10089f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 1009bc82d08bSKent Overstreet ); 1010bc82d08bSKent Overstreet 1011531a0095SKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_traverse, 10129f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 1013531a0095SKent Overstreet unsigned long caller_ip, 10149f96568cSKent Overstreet struct btree_path *path), 10159f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 1016531a0095SKent Overstreet ); 1017531a0095SKent Overstreet 10188f9ad91aSKent Overstreet DEFINE_EVENT(transaction_restart_iter, trans_restart_memory_allocation_failure, 10199f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 10208f9ad91aSKent Overstreet unsigned long caller_ip, 10219f96568cSKent Overstreet struct btree_path *path), 10229f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path) 10238f9ad91aSKent Overstreet ); 10248f9ad91aSKent Overstreet 10250d7009d7SKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_would_deadlock, 10269f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 10270d7009d7SKent Overstreet unsigned long caller_ip), 10280d7009d7SKent Overstreet TP_ARGS(trans, caller_ip) 1029ba5c6557SKent Overstreet ); 1030ba5c6557SKent Overstreet 103133bd5d06SKent Overstreet DEFINE_EVENT(transaction_event, trans_restart_would_deadlock_recursion_limit, 103233bd5d06SKent Overstreet TP_PROTO(struct btree_trans *trans, 103333bd5d06SKent Overstreet unsigned long caller_ip), 103433bd5d06SKent Overstreet TP_ARGS(trans, caller_ip) 103533bd5d06SKent Overstreet ); 103633bd5d06SKent Overstreet 1037caaa66aaSKent Overstreet TRACE_EVENT(trans_restart_would_deadlock_write, 10389f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans), 10399f96568cSKent Overstreet TP_ARGS(trans), 1040caaa66aaSKent Overstreet 1041caaa66aaSKent Overstreet TP_STRUCT__entry( 10425f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 1043caaa66aaSKent Overstreet ), 1044caaa66aaSKent Overstreet 1045caaa66aaSKent Overstreet TP_fast_assign( 1046a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 1047caaa66aaSKent Overstreet ), 1048caaa66aaSKent Overstreet 1049669f87a5SKent Overstreet TP_printk("%s", __entry->trans_fn) 1050caaa66aaSKent Overstreet ); 1051caaa66aaSKent Overstreet 105220bceecbSKent Overstreet TRACE_EVENT(trans_restart_mem_realloced, 10539f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 1054669f87a5SKent Overstreet unsigned long caller_ip, 105573a117d2SKent Overstreet unsigned long bytes), 10569f96568cSKent Overstreet TP_ARGS(trans, caller_ip, bytes), 105720bceecbSKent Overstreet 105820bceecbSKent Overstreet TP_STRUCT__entry( 10595f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 106073a117d2SKent Overstreet __field(unsigned long, caller_ip ) 106120bceecbSKent Overstreet __field(unsigned long, bytes ) 106220bceecbSKent Overstreet ), 106320bceecbSKent Overstreet 106420bceecbSKent Overstreet TP_fast_assign( 1065a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 106673a117d2SKent Overstreet __entry->caller_ip = caller_ip; 106720bceecbSKent Overstreet __entry->bytes = bytes; 106820bceecbSKent Overstreet ), 106920bceecbSKent Overstreet 1070669f87a5SKent Overstreet TP_printk("%s %pS bytes %lu", 1071669f87a5SKent Overstreet __entry->trans_fn, 107273a117d2SKent Overstreet (void *) __entry->caller_ip, 107373a117d2SKent Overstreet __entry->bytes) 1074ba5c6557SKent Overstreet ); 1075ba5c6557SKent Overstreet 10763a306f3cSKent Overstreet TRACE_EVENT(trans_restart_key_cache_key_realloced, 10779f96568cSKent Overstreet TP_PROTO(struct btree_trans *trans, 1078ddf11d8cSKent Overstreet unsigned long caller_ip, 10799f96568cSKent Overstreet struct btree_path *path, 10803a306f3cSKent Overstreet unsigned old_u64s, 10813a306f3cSKent Overstreet unsigned new_u64s), 10829f96568cSKent Overstreet TP_ARGS(trans, caller_ip, path, old_u64s, new_u64s), 10833a306f3cSKent Overstreet 10843a306f3cSKent Overstreet TP_STRUCT__entry( 10855f1dd9a6SKent Overstreet __array(char, trans_fn, 32 ) 10863a306f3cSKent Overstreet __field(unsigned long, caller_ip ) 10873a306f3cSKent Overstreet __field(enum btree_id, btree_id ) 10889f96568cSKent Overstreet TRACE_BPOS_entries(pos) 10893a306f3cSKent Overstreet __field(u32, old_u64s ) 10903a306f3cSKent Overstreet __field(u32, new_u64s ) 10913a306f3cSKent Overstreet ), 10923a306f3cSKent Overstreet 10933a306f3cSKent Overstreet TP_fast_assign( 1094a1019576SKent Overstreet strscpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn)); 10953a306f3cSKent Overstreet __entry->caller_ip = caller_ip; 10969f96568cSKent Overstreet 10979f96568cSKent Overstreet __entry->btree_id = path->btree_id; 10989f96568cSKent Overstreet TRACE_BPOS_assign(pos, path->pos); 10993a306f3cSKent Overstreet __entry->old_u64s = old_u64s; 11003a306f3cSKent Overstreet __entry->new_u64s = new_u64s; 11013a306f3cSKent Overstreet ), 11023a306f3cSKent Overstreet 11033a306f3cSKent Overstreet TP_printk("%s %pS btree %s pos %llu:%llu:%u old_u64s %u new_u64s %u", 11043a306f3cSKent Overstreet __entry->trans_fn, 11053a306f3cSKent Overstreet (void *) __entry->caller_ip, 11063a306f3cSKent Overstreet bch2_btree_ids[__entry->btree_id], 110749e401faSKent Overstreet __entry->pos_inode, 110849e401faSKent Overstreet __entry->pos_offset, 11099f96568cSKent Overstreet __entry->pos_snapshot, 11109f96568cSKent Overstreet __entry->old_u64s, 11119f96568cSKent Overstreet __entry->new_u64s) 111249e401faSKent Overstreet ); 111349e401faSKent Overstreet 11141c6fdbd8SKent Overstreet #endif /* _TRACE_BCACHEFS_H */ 11151c6fdbd8SKent Overstreet 11161c6fdbd8SKent Overstreet /* This part must be outside protection */ 11171c6fdbd8SKent Overstreet #undef TRACE_INCLUDE_PATH 11181c6fdbd8SKent Overstreet #define TRACE_INCLUDE_PATH ../../fs/bcachefs 11191c6fdbd8SKent Overstreet 11201c6fdbd8SKent Overstreet #undef TRACE_INCLUDE_FILE 11211c6fdbd8SKent Overstreet #define TRACE_INCLUDE_FILE trace 11221c6fdbd8SKent Overstreet 11231c6fdbd8SKent Overstreet #include <trace/define_trace.h> 1124