All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@linux.ibm.com>
To: linux-ext4@vger.kernel.org
Cc: Harshad Shirwadkar <harshadshirwadkar@gmail.com>,
	"Theodore Ts'o" <tytso@mit.edu>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ritesh Harjani <riteshh@linux.ibm.com>
Subject: [RFC 6/9] ext4: Add commit tid info in ext4_fc_commit_start/stop trace events
Date: Wed, 23 Feb 2022 02:04:14 +0530	[thread overview]
Message-ID: <dbc43257b4039b4bdba5613cd31fe65528721f3a.1645558375.git.riteshh@linux.ibm.com> (raw)
In-Reply-To: <cover.1645558375.git.riteshh@linux.ibm.com>

This adds commit_tid info in ext4_fc_commit_start/stop which is helpful
in debugging fast_commit issues.

For e.g. issues where due to jbd2 journal full commit, FC miss to commit
updates to a file.

Also improves TP_prink format string i.e. all ext4 and jbd2 trace events
starts with "dev MAjOR,MINOR". Let's follow the same convention while we
are still at it.

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
 fs/ext4/fast_commit.c       |  4 ++--
 include/trace/events/ext4.h | 21 +++++++++++++--------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index ee32aac0cbbf..8803ba087b07 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -1150,7 +1150,7 @@ static void ext4_fc_update_stats(struct super_block *sb, int status,
 	} else {
 		stats->fc_skipped_commits++;
 	}
-	trace_ext4_fc_commit_stop(sb, nblks, status);
+	trace_ext4_fc_commit_stop(sb, nblks, status, commit_tid);
 }
 
 /*
@@ -1171,7 +1171,7 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
 	if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
 		return jbd2_complete_transaction(journal, commit_tid);
 
-	trace_ext4_fc_commit_start(sb);
+	trace_ext4_fc_commit_start(sb, commit_tid);
 
 	start_time = ktime_get();
 
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index cd09dccea502..6e66cb7ce624 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -2685,26 +2685,29 @@ TRACE_EVENT(ext4_fc_replay,
 );
 
 TRACE_EVENT(ext4_fc_commit_start,
-	TP_PROTO(struct super_block *sb),
+	TP_PROTO(struct super_block *sb, tid_t commit_tid),
 
-	TP_ARGS(sb),
+	TP_ARGS(sb, commit_tid),
 
 	TP_STRUCT__entry(
 		__field(dev_t, dev)
+		__field(tid_t, tid)
 	),
 
 	TP_fast_assign(
 		__entry->dev = sb->s_dev;
+		__entry->tid = commit_tid;
 	),
 
-	TP_printk("fast_commit started on dev %d,%d",
-		  MAJOR(__entry->dev), MINOR(__entry->dev))
+	TP_printk("dev %d,%d tid %u", MAJOR(__entry->dev), MINOR(__entry->dev),
+		  __entry->tid)
 );
 
 TRACE_EVENT(ext4_fc_commit_stop,
-	    TP_PROTO(struct super_block *sb, int nblks, int reason),
+	    TP_PROTO(struct super_block *sb, int nblks, int reason,
+		     tid_t commit_tid),
 
-	TP_ARGS(sb, nblks, reason),
+	TP_ARGS(sb, nblks, reason, commit_tid),
 
 	TP_STRUCT__entry(
 		__field(dev_t, dev)
@@ -2713,6 +2716,7 @@ TRACE_EVENT(ext4_fc_commit_stop,
 		__field(int, num_fc)
 		__field(int, num_fc_ineligible)
 		__field(int, nblks_agg)
+		__field(tid_t, tid)
 	),
 
 	TP_fast_assign(
@@ -2723,12 +2727,13 @@ TRACE_EVENT(ext4_fc_commit_stop,
 		__entry->num_fc_ineligible =
 			EXT4_SB(sb)->s_fc_stats.fc_ineligible_commits;
 		__entry->nblks_agg = EXT4_SB(sb)->s_fc_stats.fc_numblks;
+		__entry->tid = commit_tid;
 	),
 
-	TP_printk("fc on [%d,%d] nblks %d, reason %d, fc = %d, ineligible = %d, agg_nblks %d",
+	TP_printk("dev %d,%d nblks %d, reason %d, fc = %d, ineligible = %d, agg_nblks %d, tid %u",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->nblks, __entry->reason, __entry->num_fc,
-		  __entry->num_fc_ineligible, __entry->nblks_agg)
+		  __entry->num_fc_ineligible, __entry->nblks_agg, __entry->tid)
 );
 
 #define FC_REASON_NAME_STAT(reason)					\
-- 
2.31.1


  parent reply	other threads:[~2022-02-22 20:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 20:34 [RFC 0/9] ext4: Improve FC trace events and discuss one FC failure Ritesh Harjani
2022-02-22 20:34 ` [RFC 1/9] ext4: Remove unused enum EXT4_FC_COMMIT_FAILED Ritesh Harjani
2022-02-23  9:37   ` Jan Kara
2022-02-27 18:27     ` harshad shirwadkar
2022-02-22 20:34 ` [RFC 2/9] ext4: Fix ext4_fc_stats trace point Ritesh Harjani
2022-02-22 20:52   ` Steven Rostedt
2022-02-23  9:54   ` Jan Kara
2022-02-27 18:29     ` harshad shirwadkar
2022-02-22 20:34 ` [RFC 3/9] ext4: Add couple of more fast_commit tracepoints Ritesh Harjani
2022-02-23  9:40   ` Jan Kara
2022-02-23 10:11     ` Ritesh Harjani
2022-02-23 11:53       ` Jan Kara
2022-02-23 12:04         ` Ritesh Harjani
2022-02-22 20:34 ` [RFC 4/9] ext4: Do not call FC trace event if FS does not support FC Ritesh Harjani
2022-02-23  9:41   ` Jan Kara
2022-02-27 18:30     ` harshad shirwadkar
2022-02-22 20:34 ` [RFC 5/9] ext4: Add commit_tid info in jbd debug log Ritesh Harjani
2022-02-23  9:42   ` Jan Kara
2022-02-27 18:31     ` harshad shirwadkar
2022-02-22 20:34 ` Ritesh Harjani [this message]
2022-02-23  9:44   ` [RFC 6/9] ext4: Add commit tid info in ext4_fc_commit_start/stop trace events Jan Kara
2022-02-27 18:31     ` harshad shirwadkar
2022-02-22 20:34 ` [RFC 7/9] ext4: Fix remaining two trace events to use same printk convention Ritesh Harjani
2022-02-23  9:45   ` Jan Kara
2022-02-27 18:32     ` harshad shirwadkar
2022-02-22 20:34 ` [RFC 8/9] ext4: Convert ext4_fc_track_dentry type events to use event class Ritesh Harjani
2022-02-23  9:49   ` Jan Kara
2022-02-27 18:35     ` harshad shirwadkar
2022-02-22 20:34 ` [RFC 9/9] ext4: fast_commit missing tracking updates to a file Ritesh Harjani
2022-02-23  3:50   ` [External] " Xin Yin
2022-02-23 13:58     ` Ritesh Harjani
2022-02-24 11:43       ` Xin Yin
2022-02-27 20:51         ` harshad shirwadkar
2022-03-09 17:48 ` [RFC 0/9] ext4: Improve FC trace events and discuss one FC failure Theodore Ts'o
2022-03-10  1:22   ` Ritesh Harjani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbc43257b4039b4bdba5613cd31fe65528721f3a.1645558375.git.riteshh@linux.ibm.com \
    --to=riteshh@linux.ibm.com \
    --cc=harshadshirwadkar@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.