From 012e513e1bfeb39e1ce393f5a444f772ea27e954 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Wed, 30 Aug 2017 22:36:48 +0800 Subject: btrfs: declare TRACE_DEFINE_ENUM for each of show_flush_state enum So that perf can show the state symbol. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba --- include/trace/events/btrfs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/trace/events/btrfs.h') diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index dc1d0df91e0b..77437f545c63 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -28,6 +28,13 @@ struct btrfs_qgroup_extent_record; struct btrfs_qgroup; struct prelim_ref; +TRACE_DEFINE_ENUM(FLUSH_DELAYED_ITEMS_NR); +TRACE_DEFINE_ENUM(FLUSH_DELAYED_ITEMS); +TRACE_DEFINE_ENUM(FLUSH_DELALLOC); +TRACE_DEFINE_ENUM(FLUSH_DELALLOC_WAIT); +TRACE_DEFINE_ENUM(ALLOC_CHUNK); +TRACE_DEFINE_ENUM(COMMIT_TRANS); + #define show_ref_type(type) \ __print_symbolic(type, \ { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \ -- cgit v1.2.1 From d278850eff3053ef166cf64c16f798dfe36278a2 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 29 Sep 2017 15:43:57 -0400 Subject: btrfs: remove delayed_ref_node from ref_head This is just excessive information in the ref_head, and makes the code complicated. It is a relic from when we had the heads and the refs in the same tree, which is no longer the case. With this removal I've cleaned up a bunch of the cruft around this old assumption as well. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- include/trace/events/btrfs.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'include/trace/events/btrfs.h') diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index 77437f545c63..bfe2f23b578c 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -798,11 +798,10 @@ DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref, DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, const struct btrfs_delayed_ref_head *head_ref, int action), - TP_ARGS(fs_info, ref, head_ref, action), + TP_ARGS(fs_info, head_ref, action), TP_STRUCT__entry_btrfs( __field( u64, bytenr ) @@ -812,8 +811,8 @@ DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, ), TP_fast_assign_btrfs(fs_info, - __entry->bytenr = ref->bytenr; - __entry->num_bytes = ref->num_bytes; + __entry->bytenr = head_ref->bytenr; + __entry->num_bytes = head_ref->num_bytes; __entry->action = action; __entry->is_data = head_ref->is_data; ), @@ -828,21 +827,19 @@ DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, DEFINE_EVENT(btrfs_delayed_ref_head, add_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, const struct btrfs_delayed_ref_head *head_ref, int action), - TP_ARGS(fs_info, ref, head_ref, action) + TP_ARGS(fs_info, head_ref, action) ); DEFINE_EVENT(btrfs_delayed_ref_head, run_delayed_ref_head, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, const struct btrfs_delayed_ref_head *head_ref, int action), - TP_ARGS(fs_info, ref, head_ref, action) + TP_ARGS(fs_info, head_ref, action) ); #define show_chunk_type(type) \ -- cgit v1.2.1 From dd48d4072e0cdac51edcbff66342fe2f21b5b588 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Thu, 19 Oct 2017 14:15:56 -0400 Subject: btrfs: add tracepoints for outstanding extents mods This is handy for tracing problems with modifying the outstanding extents counters. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- include/trace/events/btrfs.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/trace/events/btrfs.h') diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index bfe2f23b578c..5848ae7845da 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -1695,6 +1695,27 @@ DEFINE_EVENT(btrfs__prelim_ref, btrfs_prelim_ref_insert, TP_ARGS(fs_info, oldref, newref, tree_size) ); +TRACE_EVENT(btrfs_inode_mod_outstanding_extents, + TP_PROTO(struct btrfs_root *root, u64 ino, int mod), + + TP_ARGS(root, ino, mod), + + TP_STRUCT__entry_btrfs( + __field( u64, root_objectid ) + __field( u64, ino ) + __field( int, mod ) + ), + + TP_fast_assign_btrfs(root->fs_info, + __entry->root_objectid = root->objectid; + __entry->ino = ino; + __entry->mod = mod; + ), + + TP_printk_btrfs("root=%llu(%s) ino=%llu mod=%d", + show_root_type(__entry->root_objectid), + (unsigned long long)__entry->ino, __entry->mod) +); #endif /* _TRACE_BTRFS_H */ /* This part must be outside protection */ -- cgit v1.2.1