diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-05-15 17:54:43 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:22 +0300 |
commit | 20bceecb3159bbe06a26fc6747457d9de02ec227 (patch) | |
tree | 19d2b024b5aa994eabad46adead2a7f7719305db /fs/bcachefs/trace.h | |
parent | 7d825866604b34ba02b4c286c6fd6d232fd06cd0 (diff) | |
download | linux-20bceecb3159bbe06a26fc6747457d9de02ec227.tar.xz |
bcachefs: More work to avoid transaction restarts
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/trace.h')
-rw-r--r-- | fs/bcachefs/trace.h | 90 |
1 files changed, 56 insertions, 34 deletions
diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h index 86f58206365d..a9fcb5442186 100644 --- a/fs/bcachefs/trace.h +++ b/fs/bcachefs/trace.h @@ -500,16 +500,14 @@ TRACE_EVENT(copygc, ); DECLARE_EVENT_CLASS(transaction_restart, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip), + TP_PROTO(unsigned long ip), + TP_ARGS(ip), TP_STRUCT__entry( - __array(char, name, 16) __field(unsigned long, ip ) ), TP_fast_assign( - memcpy(__entry->name, c->name, 16); __entry->ip = ip; ), @@ -517,73 +515,97 @@ DECLARE_EVENT_CLASS(transaction_restart, ); DEFINE_EVENT(transaction_restart, trans_restart_btree_node_reused, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_would_deadlock, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); -DEFINE_EVENT(transaction_restart, trans_restart_iters_realloced, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) +TRACE_EVENT(trans_restart_iters_realloced, + TP_PROTO(unsigned long ip, unsigned nr), + TP_ARGS(ip, nr), + + TP_STRUCT__entry( + __field(unsigned long, ip ) + __field(unsigned, nr ) + ), + + TP_fast_assign( + __entry->ip = ip; + __entry->nr = nr; + ), + + TP_printk("%pS nr %u", (void *) __entry->ip, __entry->nr) ); -DEFINE_EVENT(transaction_restart, trans_restart_mem_realloced, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) +TRACE_EVENT(trans_restart_mem_realloced, + TP_PROTO(unsigned long ip, unsigned long bytes), + TP_ARGS(ip, bytes), + + TP_STRUCT__entry( + __field(unsigned long, ip ) + __field(unsigned long, bytes ) + ), + + TP_fast_assign( + __entry->ip = ip; + __entry->bytes = bytes; + ), + + TP_printk("%pS bytes %lu", (void *) __entry->ip, __entry->bytes) ); DEFINE_EVENT(transaction_restart, trans_restart_journal_res_get, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_journal_preres_get, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_mark_replicas, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_fault_inject, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_btree_node_split, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_mark, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_upgrade, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_iter_upgrade, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_traverse, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DEFINE_EVENT(transaction_restart, trans_restart_atomic, - TP_PROTO(struct bch_fs *c, unsigned long ip), - TP_ARGS(c, ip) + TP_PROTO(unsigned long ip), + TP_ARGS(ip) ); DECLARE_EVENT_CLASS(node_lock_fail, |