aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-24 02:33:31 -0400
committerBen Myers <bpm@sgi.com>2012-05-21 11:45:44 -0400
commit14c26c6a05de138a4fd9a0c05ff8e7435a618324 (patch)
treec916866e4e9ac21d5f3400edf3eb8186ea7740af /fs/xfs
parent3ba316037470bbf98c8a16c2179c02794fb8862e (diff)
xfs: add trace points for log forces
To enable easy tracing of the location of log forces and the frequency of them via perf, add a pair of trace points to the log force functions. This will help debug where excessive log forces are being issued from by simple perf commands like: # ~/perf/perf top -e xfs:xfs_log_force -G -U Which gives this sort of output: Events: 141 xfs:xfs_log_force - 100.00% [kernel] [k] xfs_log_force - xfs_log_force 87.04% xfsaild kthread kernel_thread_helper - 12.87% xfs_buf_lock _xfs_buf_find xfs_buf_get xfs_trans_get_buf xfs_da_do_buf xfs_da_get_buf xfs_dir2_data_init xfs_dir2_leaf_addname xfs_dir_createname xfs_create xfs_vn_mknod xfs_vn_create vfs_create do_last.isra.41 path_openat do_filp_open do_sys_open sys_open system_call_fastpath Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sig.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_log.c2
-rw-r--r--fs/xfs/xfs_trace.h16
2 files changed, 18 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 9b10a15295a2..6b965bf450e4 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2941,6 +2941,7 @@ xfs_log_force(
2941{ 2941{
2942 int error; 2942 int error;
2943 2943
2944 trace_xfs_log_force(mp, 0);
2944 error = _xfs_log_force(mp, flags, NULL); 2945 error = _xfs_log_force(mp, flags, NULL);
2945 if (error) 2946 if (error)
2946 xfs_warn(mp, "%s: error %d returned.", __func__, error); 2947 xfs_warn(mp, "%s: error %d returned.", __func__, error);
@@ -3089,6 +3090,7 @@ xfs_log_force_lsn(
3089{ 3090{
3090 int error; 3091 int error;
3091 3092
3093 trace_xfs_log_force(mp, lsn);
3092 error = _xfs_log_force_lsn(mp, lsn, flags, NULL); 3094 error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
3093 if (error) 3095 if (error)
3094 xfs_warn(mp, "%s: error %d returned.", __func__, error); 3096 xfs_warn(mp, "%s: error %d returned.", __func__, error);
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index febff43176f1..7cf9d3529e51 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -874,6 +874,22 @@ DECLARE_EVENT_CLASS(xfs_log_item_class,
874 __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) 874 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
875) 875)
876 876
877TRACE_EVENT(xfs_log_force,
878 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
879 TP_ARGS(mp, lsn),
880 TP_STRUCT__entry(
881 __field(dev_t, dev)
882 __field(xfs_lsn_t, lsn)
883 ),
884 TP_fast_assign(
885 __entry->dev = mp->m_super->s_dev;
886 __entry->lsn = lsn;
887 ),
888 TP_printk("dev %d:%d lsn 0x%llx",
889 MAJOR(__entry->dev), MINOR(__entry->dev),
890 __entry->lsn)
891)
892
877#define DEFINE_LOG_ITEM_EVENT(name) \ 893#define DEFINE_LOG_ITEM_EVENT(name) \
878DEFINE_EVENT(xfs_log_item_class, name, \ 894DEFINE_EVENT(xfs_log_item_class, name, \
879 TP_PROTO(struct xfs_log_item *lip), \ 895 TP_PROTO(struct xfs_log_item *lip), \