* [PATCH -next] jbd2: use the correct print format
@ 2022-10-10 8:09 Bixuan Cui
2022-10-10 14:35 ` Jason Yan
0 siblings, 1 reply; 3+ messages in thread
From: Bixuan Cui @ 2022-10-10 8:09 UTC (permalink / raw)
To: rostedt, mhiramat, bvanassche, axboe, tytso, linux-kernel,
linux-ext4
Cc: cuibixuan
The print format error was found when using ftrace event:
<...>-1406 [000] .... 23599442.895823: jbd2_end_commit: dev 252,8 transaction -1866216965 sync 0 head -1866217368
<...>-1406 [000] .... 23599442.896299: jbd2_start_commit: dev 252,8 transaction -1866216964 sync 0
Print transaction and head with the unsigned format "%u" instead.
Fixes: 879c5e6b7cb4 ('jbd2: convert instrumentation from markers to tracepoints')
Signed-off-by: Bixuan Cui <cuibixuan@linux.alibaba.com>
---
include/trace/events/jbd2.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index 99f783c..ce9accb 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -40,7 +40,7 @@
TP_STRUCT__entry(
__field( dev_t, dev )
__field( char, sync_commit )
- __field( int, transaction )
+ __field( tid_t, transaction )
),
TP_fast_assign(
@@ -49,7 +49,7 @@
__entry->transaction = commit_transaction->t_tid;
),
- TP_printk("dev %d,%d transaction %d sync %d",
+ TP_printk("dev %d,%d transaction %u sync %d",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->transaction, __entry->sync_commit)
);
@@ -97,8 +97,8 @@
TP_STRUCT__entry(
__field( dev_t, dev )
__field( char, sync_commit )
- __field( int, transaction )
- __field( int, head )
+ __field( tid_t, transaction )
+ __field( tid_t, head )
),
TP_fast_assign(
@@ -108,7 +108,7 @@
__entry->head = journal->j_tail_sequence;
),
- TP_printk("dev %d,%d transaction %d sync %d head %d",
+ TP_printk("dev %d,%d transaction %u sync %d head %u",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->transaction, __entry->sync_commit, __entry->head)
);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH -next] jbd2: use the correct print format 2022-10-10 8:09 [PATCH -next] jbd2: use the correct print format Bixuan Cui @ 2022-10-10 14:35 ` Jason Yan 2022-10-11 11:23 ` Bixuan Cui 0 siblings, 1 reply; 3+ messages in thread From: Jason Yan @ 2022-10-10 14:35 UTC (permalink / raw) To: Bixuan Cui, rostedt, mhiramat, bvanassche, axboe, tytso, linux-kernel, linux-ext4 Hi Bixuan, On 2022/10/10 16:09, Bixuan Cui wrote: > The print format error was found when using ftrace event: > <...>-1406 [000] .... 23599442.895823: jbd2_end_commit: dev 252,8 transaction -1866216965 sync 0 head -1866217368 > <...>-1406 [000] .... 23599442.896299: jbd2_start_commit: dev 252,8 transaction -1866216964 sync 0 > > Print transaction and head with the unsigned format "%u" instead. > > Fixes: 879c5e6b7cb4 ('jbd2: convert instrumentation from markers to tracepoints') > Signed-off-by: Bixuan Cui <cuibixuan@linux.alibaba.com> > --- > include/trace/events/jbd2.h | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h > index 99f783c..ce9accb 100644 > --- a/include/trace/events/jbd2.h > +++ b/include/trace/events/jbd2.h > @@ -40,7 +40,7 @@ > TP_STRUCT__entry( > __field( dev_t, dev ) > __field( char, sync_commit ) > - __field( int, transaction ) > + __field( tid_t, transaction ) While you are at it, can you make all the tid tracing consistent. Some tracing points using unsigned long such as: TRACE_EVENT(jbd2_handle_extend, TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, unsigned int line_no, int buffer_credits, int requested_blocks), TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks), and the caller passing transaction->t_tid which is tid_t(unsigned int). trace_jbd2_handle_extend(journal->j_fs_dev->bd_dev, transaction->t_tid, handle->h_type, handle->h_line_no, handle->h_total_credits, nblocks); Thanks, Jason > ), > > TP_fast_assign( > @@ -49,7 +49,7 @@ > __entry->transaction = commit_transaction->t_tid; > ), > > - TP_printk("dev %d,%d transaction %d sync %d", > + TP_printk("dev %d,%d transaction %u sync %d", > MAJOR(__entry->dev), MINOR(__entry->dev), > __entry->transaction, __entry->sync_commit) > ); > @@ -97,8 +97,8 @@ > TP_STRUCT__entry( > __field( dev_t, dev ) > __field( char, sync_commit ) > - __field( int, transaction ) > - __field( int, head ) > + __field( tid_t, transaction ) > + __field( tid_t, head ) > ), > > TP_fast_assign( > @@ -108,7 +108,7 @@ > __entry->head = journal->j_tail_sequence; > ), > > - TP_printk("dev %d,%d transaction %d sync %d head %d", > + TP_printk("dev %d,%d transaction %u sync %d head %u", > MAJOR(__entry->dev), MINOR(__entry->dev), > __entry->transaction, __entry->sync_commit, __entry->head) > ); > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] jbd2: use the correct print format 2022-10-10 14:35 ` Jason Yan @ 2022-10-11 11:23 ` Bixuan Cui 0 siblings, 0 replies; 3+ messages in thread From: Bixuan Cui @ 2022-10-11 11:23 UTC (permalink / raw) To: Jason Yan, rostedt, mhiramat, bvanassche, axboe, tytso, linux-kernel, linux-ext4 在 2022/10/10 22:35, Jason Yan 写道: > While you are at it, can you make all the tid tracing consistent. Some > tracing points using unsigned long such as: > > TRACE_EVENT(jbd2_handle_extend, > TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, > unsigned int line_no, int buffer_credits, > int requested_blocks), > > TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks), > > > and the caller passing transaction->t_tid which is tid_t(unsigned int). > > trace_jbd2_handle_extend(journal->j_fs_dev->bd_dev, > transaction->t_tid, > handle->h_type, handle->h_line_no, > handle->h_total_credits, > nblocks); Ok, I'll send another patch to fix this problem. Thanks Bixuan Cui ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-11 11:23 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-10-10 8:09 [PATCH -next] jbd2: use the correct print format Bixuan Cui 2022-10-10 14:35 ` Jason Yan 2022-10-11 11:23 ` Bixuan Cui
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox