All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] f2fs: fix the assign logic of iocb
@ 2022-10-27  9:12 ` Mukesh Ojha
  0 siblings, 0 replies; 12+ messages in thread
From: Mukesh Ojha @ 2022-10-27  9:12 UTC (permalink / raw)
  To: jaegeuk, chao, mhiramat
  Cc: linux-f2fs-devel, linux-kernel, quic_pkondeti, Mukesh Ojha

commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
introduces iocb field in 'f2fs_direct_IO_enter' trace event
And it only assigns the pointer and later it accesses its field
in trace print log.

Unable to handle kernel paging request at virtual address ffffffc04cef3d30
Mem abort info:
ESR = 0x96000007
EC = 0x25: DABT (current EL), IL = 32 bits

 pc : trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
 lr : trace_raw_output_f2fs_direct_IO_enter+0x2c/0xa4
 sp : ffffffc0443cbbd0
 x29: ffffffc0443cbbf0 x28: ffffff8935b120d0 x27: ffffff8935b12108
 x26: ffffff8935b120f0 x25: ffffff8935b12100 x24: ffffff8935b110c0
 x23: ffffff8935b10000 x22: ffffff88859a936c x21: ffffff88859a936c
 x20: ffffff8935b110c0 x19: ffffff8935b10000 x18: ffffffc03b195060
 x17: ffffff8935b11e76 x16: 00000000000000cc x15: ffffffef855c4f2c
 x14: 0000000000000001 x13: 000000000000004e x12: ffff0000ffffff00
 x11: ffffffef86c350d0 x10: 00000000000010c0 x9 : 000000000fe0002c
 x8 : ffffffc04cef3d28 x7 : 7f7f7f7f7f7f7f7f x6 : 0000000002000000
 x5 : ffffff8935b11e9a x4 : 0000000000006250 x3 : ffff0a00ffffff04
 x2 : 0000000000000002 x1 : ffffffef86a0a31f x0 : ffffff8935b10000
 Call trace:
  trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
  print_trace_fmt+0x9c/0x138
  print_trace_line+0x154/0x254
  tracing_read_pipe+0x21c/0x380
  vfs_read+0x108/0x3ac
  ksys_read+0x7c/0xec
  __arm64_sys_read+0x20/0x30
  invoke_syscall+0x60/0x150
  el0_svc_common.llvm.1237943816091755067+0xb8/0xf8
  do_el0_svc+0x28/0xa0

Fix it by copying the required variables for printing and while at
it fix the similar issue at some other places in the same file.

Fixes: 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
Changes in v2:
 - Added commit text with crash information.
 - Fixed the similar issue at some other places in the file.
 - Only copy the required variables instead of memcpy.

 include/trace/events/f2fs.h | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index c6b3724..ff57e7f 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -322,7 +322,7 @@ TRACE_EVENT(f2fs_unlink_enter,
 		__field(ino_t,	ino)
 		__field(loff_t,	size)
 		__field(blkcnt_t, blocks)
-		__field(const char *,	name)
+		__string(name,  dentry->d_name.name)
 	),
 
 	TP_fast_assign(
@@ -330,7 +330,7 @@ TRACE_EVENT(f2fs_unlink_enter,
 		__entry->ino	= dir->i_ino;
 		__entry->size	= dir->i_size;
 		__entry->blocks	= dir->i_blocks;
-		__entry->name	= dentry->d_name.name;
+		__assign_str(name, dentry->d_name.name);
 	),
 
 	TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
@@ -338,7 +338,7 @@ TRACE_EVENT(f2fs_unlink_enter,
 		show_dev_ino(__entry),
 		__entry->size,
 		(unsigned long long)__entry->blocks,
-		__entry->name)
+		__get_str(name))
 );
 
 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
@@ -940,25 +940,29 @@ TRACE_EVENT(f2fs_direct_IO_enter,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(ino_t,	ino)
-		__field(struct kiocb *,	iocb)
+		__field(loff_t,	ki_pos)
+		__field(int,	ki_flags)
+		__field(u16,	ki_ioprio)
 		__field(unsigned long,	len)
 		__field(int,	rw)
 	),
 
 	TP_fast_assign(
-		__entry->dev	= inode->i_sb->s_dev;
-		__entry->ino	= inode->i_ino;
-		__entry->iocb	= iocb;
-		__entry->len	= len;
-		__entry->rw	= rw;
+		__entry->dev		= inode->i_sb->s_dev;
+		__entry->ino		= inode->i_ino;
+		__entry->ki_pos		= iocb->ki_pos;
+		__entry->ki_flags	= iocb->ki_flags;
+		__entry->ki_ioprio	= iocb->ki_ioprio;
+		__entry->len		= len;
+		__entry->rw		= rw;
 	),
 
 	TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_ioprio = %x rw = %d",
 		show_dev_ino(__entry),
-		__entry->iocb->ki_pos,
+		__entry->ki_pos,
 		__entry->len,
-		__entry->iocb->ki_flags,
-		__entry->iocb->ki_ioprio,
+		__entry->ki_flags,
+		__entry->ki_ioprio,
 		__entry->rw)
 );
 
@@ -1407,19 +1411,19 @@ TRACE_EVENT(f2fs_write_checkpoint,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(int,	reason)
-		__field(char *,	msg)
+		__string(dest_msg, msg)
 	),
 
 	TP_fast_assign(
 		__entry->dev		= sb->s_dev;
 		__entry->reason		= reason;
-		__entry->msg		= msg;
+		__assign_str(dest_msg, msg);
 	),
 
 	TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
 		show_dev(__entry->dev),
 		show_cpreason(__entry->reason),
-		__entry->msg)
+		__get_str(dest_msg))
 );
 
 DECLARE_EVENT_CLASS(f2fs_discard,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [f2fs-dev] [PATCH v2 1/2] f2fs: fix the assign logic of iocb
@ 2022-10-27  9:12 ` Mukesh Ojha
  0 siblings, 0 replies; 12+ messages in thread
From: Mukesh Ojha @ 2022-10-27  9:12 UTC (permalink / raw)
  To: jaegeuk, chao, mhiramat
  Cc: Mukesh Ojha, quic_pkondeti, linux-kernel, linux-f2fs-devel

commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
introduces iocb field in 'f2fs_direct_IO_enter' trace event
And it only assigns the pointer and later it accesses its field
in trace print log.

Unable to handle kernel paging request at virtual address ffffffc04cef3d30
Mem abort info:
ESR = 0x96000007
EC = 0x25: DABT (current EL), IL = 32 bits

 pc : trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
 lr : trace_raw_output_f2fs_direct_IO_enter+0x2c/0xa4
 sp : ffffffc0443cbbd0
 x29: ffffffc0443cbbf0 x28: ffffff8935b120d0 x27: ffffff8935b12108
 x26: ffffff8935b120f0 x25: ffffff8935b12100 x24: ffffff8935b110c0
 x23: ffffff8935b10000 x22: ffffff88859a936c x21: ffffff88859a936c
 x20: ffffff8935b110c0 x19: ffffff8935b10000 x18: ffffffc03b195060
 x17: ffffff8935b11e76 x16: 00000000000000cc x15: ffffffef855c4f2c
 x14: 0000000000000001 x13: 000000000000004e x12: ffff0000ffffff00
 x11: ffffffef86c350d0 x10: 00000000000010c0 x9 : 000000000fe0002c
 x8 : ffffffc04cef3d28 x7 : 7f7f7f7f7f7f7f7f x6 : 0000000002000000
 x5 : ffffff8935b11e9a x4 : 0000000000006250 x3 : ffff0a00ffffff04
 x2 : 0000000000000002 x1 : ffffffef86a0a31f x0 : ffffff8935b10000
 Call trace:
  trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
  print_trace_fmt+0x9c/0x138
  print_trace_line+0x154/0x254
  tracing_read_pipe+0x21c/0x380
  vfs_read+0x108/0x3ac
  ksys_read+0x7c/0xec
  __arm64_sys_read+0x20/0x30
  invoke_syscall+0x60/0x150
  el0_svc_common.llvm.1237943816091755067+0xb8/0xf8
  do_el0_svc+0x28/0xa0

Fix it by copying the required variables for printing and while at
it fix the similar issue at some other places in the same file.

Fixes: 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
Changes in v2:
 - Added commit text with crash information.
 - Fixed the similar issue at some other places in the file.
 - Only copy the required variables instead of memcpy.

 include/trace/events/f2fs.h | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index c6b3724..ff57e7f 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -322,7 +322,7 @@ TRACE_EVENT(f2fs_unlink_enter,
 		__field(ino_t,	ino)
 		__field(loff_t,	size)
 		__field(blkcnt_t, blocks)
-		__field(const char *,	name)
+		__string(name,  dentry->d_name.name)
 	),
 
 	TP_fast_assign(
@@ -330,7 +330,7 @@ TRACE_EVENT(f2fs_unlink_enter,
 		__entry->ino	= dir->i_ino;
 		__entry->size	= dir->i_size;
 		__entry->blocks	= dir->i_blocks;
-		__entry->name	= dentry->d_name.name;
+		__assign_str(name, dentry->d_name.name);
 	),
 
 	TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
@@ -338,7 +338,7 @@ TRACE_EVENT(f2fs_unlink_enter,
 		show_dev_ino(__entry),
 		__entry->size,
 		(unsigned long long)__entry->blocks,
-		__entry->name)
+		__get_str(name))
 );
 
 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
@@ -940,25 +940,29 @@ TRACE_EVENT(f2fs_direct_IO_enter,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(ino_t,	ino)
-		__field(struct kiocb *,	iocb)
+		__field(loff_t,	ki_pos)
+		__field(int,	ki_flags)
+		__field(u16,	ki_ioprio)
 		__field(unsigned long,	len)
 		__field(int,	rw)
 	),
 
 	TP_fast_assign(
-		__entry->dev	= inode->i_sb->s_dev;
-		__entry->ino	= inode->i_ino;
-		__entry->iocb	= iocb;
-		__entry->len	= len;
-		__entry->rw	= rw;
+		__entry->dev		= inode->i_sb->s_dev;
+		__entry->ino		= inode->i_ino;
+		__entry->ki_pos		= iocb->ki_pos;
+		__entry->ki_flags	= iocb->ki_flags;
+		__entry->ki_ioprio	= iocb->ki_ioprio;
+		__entry->len		= len;
+		__entry->rw		= rw;
 	),
 
 	TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_ioprio = %x rw = %d",
 		show_dev_ino(__entry),
-		__entry->iocb->ki_pos,
+		__entry->ki_pos,
 		__entry->len,
-		__entry->iocb->ki_flags,
-		__entry->iocb->ki_ioprio,
+		__entry->ki_flags,
+		__entry->ki_ioprio,
 		__entry->rw)
 );
 
@@ -1407,19 +1411,19 @@ TRACE_EVENT(f2fs_write_checkpoint,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(int,	reason)
-		__field(char *,	msg)
+		__string(dest_msg, msg)
 	),
 
 	TP_fast_assign(
 		__entry->dev		= sb->s_dev;
 		__entry->reason		= reason;
-		__entry->msg		= msg;
+		__assign_str(dest_msg, msg);
 	),
 
 	TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
 		show_dev(__entry->dev),
 		show_cpreason(__entry->reason),
-		__entry->msg)
+		__get_str(dest_msg))
 );
 
 DECLARE_EVENT_CLASS(f2fs_discard,
-- 
2.7.4



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] f2fs: fix the msg data type
  2022-10-27  9:12 ` [f2fs-dev] " Mukesh Ojha
@ 2022-10-27  9:12   ` Mukesh Ojha
  -1 siblings, 0 replies; 12+ messages in thread
From: Mukesh Ojha @ 2022-10-27  9:12 UTC (permalink / raw)
  To: jaegeuk, chao, mhiramat
  Cc: linux-f2fs-devel, linux-kernel, quic_pkondeti, Mukesh Ojha

Data type of msg in f2fs_write_checkpoint trace should
be const char * instead of char *.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 include/trace/events/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index ff57e7f..7fbfce4 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -1404,7 +1404,7 @@ TRACE_EVENT(f2fs_readpages,
 
 TRACE_EVENT(f2fs_write_checkpoint,
 
-	TP_PROTO(struct super_block *sb, int reason, char *msg),
+	TP_PROTO(struct super_block *sb, int reason, const char *msg),
 
 	TP_ARGS(sb, reason, msg),
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [f2fs-dev] [PATCH 2/2] f2fs: fix the msg data type
@ 2022-10-27  9:12   ` Mukesh Ojha
  0 siblings, 0 replies; 12+ messages in thread
From: Mukesh Ojha @ 2022-10-27  9:12 UTC (permalink / raw)
  To: jaegeuk, chao, mhiramat
  Cc: Mukesh Ojha, quic_pkondeti, linux-kernel, linux-f2fs-devel

Data type of msg in f2fs_write_checkpoint trace should
be const char * instead of char *.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 include/trace/events/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index ff57e7f..7fbfce4 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -1404,7 +1404,7 @@ TRACE_EVENT(f2fs_readpages,
 
 TRACE_EVENT(f2fs_write_checkpoint,
 
-	TP_PROTO(struct super_block *sb, int reason, char *msg),
+	TP_PROTO(struct super_block *sb, int reason, const char *msg),
 
 	TP_ARGS(sb, reason, msg),
 
-- 
2.7.4



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] f2fs: fix the msg data type
  2022-10-27  9:12   ` [f2fs-dev] " Mukesh Ojha
@ 2022-10-27 10:17     ` Pavan Kondeti
  -1 siblings, 0 replies; 12+ messages in thread
From: Pavan Kondeti @ 2022-10-27 10:17 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: jaegeuk, chao, mhiramat, linux-f2fs-devel, linux-kernel, quic_pkondeti

On Thu, Oct 27, 2022 at 02:42:41PM +0530, Mukesh Ojha wrote:
> Data type of msg in f2fs_write_checkpoint trace should
> be const char * instead of char *.
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> ---
>  include/trace/events/f2fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index ff57e7f..7fbfce4 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -1404,7 +1404,7 @@ TRACE_EVENT(f2fs_readpages,
>  
>  TRACE_EVENT(f2fs_write_checkpoint,
>  
> -	TP_PROTO(struct super_block *sb, int reason, char *msg),
> +	TP_PROTO(struct super_block *sb, int reason, const char *msg),
>  
>  	TP_ARGS(sb, reason, msg),
>  
LGTM. one minor comment.

Declare it const char pointer in the trace point structure also.

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 11f6b71..22960e6 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -1429,7 +1429,7 @@ TRACE_EVENT(f2fs_write_checkpoint,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(int,	reason)
-		__field(char *,	msg)
+		__field(const char *,	msg)
 	),
 
 	TP_fast_assign(

Thanks,
Pavan

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [f2fs-dev] [PATCH 2/2] f2fs: fix the msg data type
@ 2022-10-27 10:17     ` Pavan Kondeti
  0 siblings, 0 replies; 12+ messages in thread
From: Pavan Kondeti @ 2022-10-27 10:17 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: quic_pkondeti, linux-kernel, linux-f2fs-devel, mhiramat, jaegeuk

On Thu, Oct 27, 2022 at 02:42:41PM +0530, Mukesh Ojha wrote:
> Data type of msg in f2fs_write_checkpoint trace should
> be const char * instead of char *.
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> ---
>  include/trace/events/f2fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index ff57e7f..7fbfce4 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -1404,7 +1404,7 @@ TRACE_EVENT(f2fs_readpages,
>  
>  TRACE_EVENT(f2fs_write_checkpoint,
>  
> -	TP_PROTO(struct super_block *sb, int reason, char *msg),
> +	TP_PROTO(struct super_block *sb, int reason, const char *msg),
>  
>  	TP_ARGS(sb, reason, msg),
>  
LGTM. one minor comment.

Declare it const char pointer in the trace point structure also.

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 11f6b71..22960e6 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -1429,7 +1429,7 @@ TRACE_EVENT(f2fs_write_checkpoint,
 	TP_STRUCT__entry(
 		__field(dev_t,	dev)
 		__field(int,	reason)
-		__field(char *,	msg)
+		__field(const char *,	msg)
 	),
 
 	TP_fast_assign(

Thanks,
Pavan


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [f2fs-dev] [PATCH 2/2] f2fs: fix the msg data type
  2022-10-27 10:17     ` [f2fs-dev] " Pavan Kondeti
@ 2022-10-27 10:30       ` Pavan Kondeti
  -1 siblings, 0 replies; 12+ messages in thread
From: Pavan Kondeti @ 2022-10-27 10:30 UTC (permalink / raw)
  To: Pavan Kondeti
  Cc: linux-kernel, linux-f2fs-devel, Mukesh Ojha, jaegeuk, mhiramat

On Thu, Oct 27, 2022 at 03:47:02PM +0530, Pavan Kondeti wrote:
> On Thu, Oct 27, 2022 at 02:42:41PM +0530, Mukesh Ojha wrote:
> > Data type of msg in f2fs_write_checkpoint trace should
> > be const char * instead of char *.
> > 
> > Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> > ---
> >  include/trace/events/f2fs.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> > index ff57e7f..7fbfce4 100644
> > --- a/include/trace/events/f2fs.h
> > +++ b/include/trace/events/f2fs.h
> > @@ -1404,7 +1404,7 @@ TRACE_EVENT(f2fs_readpages,
> >  
> >  TRACE_EVENT(f2fs_write_checkpoint,
> >  
> > -	TP_PROTO(struct super_block *sb, int reason, char *msg),
> > +	TP_PROTO(struct super_block *sb, int reason, const char *msg),
> >  
> >  	TP_ARGS(sb, reason, msg),
> >  
> LGTM. one minor comment.
> 
> Declare it const char pointer in the trace point structure also.
> 
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index 11f6b71..22960e6 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -1429,7 +1429,7 @@ TRACE_EVENT(f2fs_write_checkpoint,
>  	TP_STRUCT__entry(
>  		__field(dev_t,	dev)
>  		__field(int,	reason)
> -		__field(char *,	msg)
> +		__field(const char *,	msg)
>  	),
>  
>  	TP_fast_assign(
> 
Never mind, I saw your other patch which makes it a string. Actually, we don't
need a string here as all the invocations (currently) are from ro strings like
below 

trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "start block_ops");
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish block_ops");
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint");

Thanks,
Pavan


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] f2fs: fix the msg data type
@ 2022-10-27 10:30       ` Pavan Kondeti
  0 siblings, 0 replies; 12+ messages in thread
From: Pavan Kondeti @ 2022-10-27 10:30 UTC (permalink / raw)
  To: Pavan Kondeti
  Cc: Mukesh Ojha, jaegeuk, chao, mhiramat, linux-f2fs-devel, linux-kernel

On Thu, Oct 27, 2022 at 03:47:02PM +0530, Pavan Kondeti wrote:
> On Thu, Oct 27, 2022 at 02:42:41PM +0530, Mukesh Ojha wrote:
> > Data type of msg in f2fs_write_checkpoint trace should
> > be const char * instead of char *.
> > 
> > Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> > ---
> >  include/trace/events/f2fs.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> > index ff57e7f..7fbfce4 100644
> > --- a/include/trace/events/f2fs.h
> > +++ b/include/trace/events/f2fs.h
> > @@ -1404,7 +1404,7 @@ TRACE_EVENT(f2fs_readpages,
> >  
> >  TRACE_EVENT(f2fs_write_checkpoint,
> >  
> > -	TP_PROTO(struct super_block *sb, int reason, char *msg),
> > +	TP_PROTO(struct super_block *sb, int reason, const char *msg),
> >  
> >  	TP_ARGS(sb, reason, msg),
> >  
> LGTM. one minor comment.
> 
> Declare it const char pointer in the trace point structure also.
> 
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index 11f6b71..22960e6 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -1429,7 +1429,7 @@ TRACE_EVENT(f2fs_write_checkpoint,
>  	TP_STRUCT__entry(
>  		__field(dev_t,	dev)
>  		__field(int,	reason)
> -		__field(char *,	msg)
> +		__field(const char *,	msg)
>  	),
>  
>  	TP_fast_assign(
> 
Never mind, I saw your other patch which makes it a string. Actually, we don't
need a string here as all the invocations (currently) are from ro strings like
below 

trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "start block_ops");
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish block_ops");
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint");

Thanks,
Pavan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix the assign logic of iocb
  2022-10-27  9:12 ` [f2fs-dev] " Mukesh Ojha
@ 2022-10-29  2:55   ` Chao Yu
  -1 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-10-29  2:55 UTC (permalink / raw)
  To: Mukesh Ojha, jaegeuk, mhiramat
  Cc: quic_pkondeti, linux-kernel, linux-f2fs-devel

On 2022/10/27 17:12, Mukesh Ojha wrote:
> commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
> introduces iocb field in 'f2fs_direct_IO_enter' trace event
> And it only assigns the pointer and later it accesses its field
> in trace print log.
> 
> Unable to handle kernel paging request at virtual address ffffffc04cef3d30
> Mem abort info:
> ESR = 0x96000007
> EC = 0x25: DABT (current EL), IL = 32 bits
> 
>   pc : trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
>   lr : trace_raw_output_f2fs_direct_IO_enter+0x2c/0xa4
>   sp : ffffffc0443cbbd0
>   x29: ffffffc0443cbbf0 x28: ffffff8935b120d0 x27: ffffff8935b12108
>   x26: ffffff8935b120f0 x25: ffffff8935b12100 x24: ffffff8935b110c0
>   x23: ffffff8935b10000 x22: ffffff88859a936c x21: ffffff88859a936c
>   x20: ffffff8935b110c0 x19: ffffff8935b10000 x18: ffffffc03b195060
>   x17: ffffff8935b11e76 x16: 00000000000000cc x15: ffffffef855c4f2c
>   x14: 0000000000000001 x13: 000000000000004e x12: ffff0000ffffff00
>   x11: ffffffef86c350d0 x10: 00000000000010c0 x9 : 000000000fe0002c
>   x8 : ffffffc04cef3d28 x7 : 7f7f7f7f7f7f7f7f x6 : 0000000002000000
>   x5 : ffffff8935b11e9a x4 : 0000000000006250 x3 : ffff0a00ffffff04
>   x2 : 0000000000000002 x1 : ffffffef86a0a31f x0 : ffffff8935b10000
>   Call trace:
>    trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
>    print_trace_fmt+0x9c/0x138
>    print_trace_line+0x154/0x254
>    tracing_read_pipe+0x21c/0x380
>    vfs_read+0x108/0x3ac
>    ksys_read+0x7c/0xec
>    __arm64_sys_read+0x20/0x30
>    invoke_syscall+0x60/0x150
>    el0_svc_common.llvm.1237943816091755067+0xb8/0xf8
>    do_el0_svc+0x28/0xa0
> 
> Fix it by copying the required variables for printing and while at
> it fix the similar issue at some other places in the same file.
> 
> Fixes: 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix the assign logic of iocb
@ 2022-10-29  2:55   ` Chao Yu
  0 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-10-29  2:55 UTC (permalink / raw)
  To: Mukesh Ojha, jaegeuk, mhiramat
  Cc: quic_pkondeti, linux-kernel, linux-f2fs-devel

On 2022/10/27 17:12, Mukesh Ojha wrote:
> commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
> introduces iocb field in 'f2fs_direct_IO_enter' trace event
> And it only assigns the pointer and later it accesses its field
> in trace print log.
> 
> Unable to handle kernel paging request at virtual address ffffffc04cef3d30
> Mem abort info:
> ESR = 0x96000007
> EC = 0x25: DABT (current EL), IL = 32 bits
> 
>   pc : trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
>   lr : trace_raw_output_f2fs_direct_IO_enter+0x2c/0xa4
>   sp : ffffffc0443cbbd0
>   x29: ffffffc0443cbbf0 x28: ffffff8935b120d0 x27: ffffff8935b12108
>   x26: ffffff8935b120f0 x25: ffffff8935b12100 x24: ffffff8935b110c0
>   x23: ffffff8935b10000 x22: ffffff88859a936c x21: ffffff88859a936c
>   x20: ffffff8935b110c0 x19: ffffff8935b10000 x18: ffffffc03b195060
>   x17: ffffff8935b11e76 x16: 00000000000000cc x15: ffffffef855c4f2c
>   x14: 0000000000000001 x13: 000000000000004e x12: ffff0000ffffff00
>   x11: ffffffef86c350d0 x10: 00000000000010c0 x9 : 000000000fe0002c
>   x8 : ffffffc04cef3d28 x7 : 7f7f7f7f7f7f7f7f x6 : 0000000002000000
>   x5 : ffffff8935b11e9a x4 : 0000000000006250 x3 : ffff0a00ffffff04
>   x2 : 0000000000000002 x1 : ffffffef86a0a31f x0 : ffffff8935b10000
>   Call trace:
>    trace_raw_output_f2fs_direct_IO_enter+0x54/0xa4
>    print_trace_fmt+0x9c/0x138
>    print_trace_line+0x154/0x254
>    tracing_read_pipe+0x21c/0x380
>    vfs_read+0x108/0x3ac
>    ksys_read+0x7c/0xec
>    __arm64_sys_read+0x20/0x30
>    invoke_syscall+0x60/0x150
>    el0_svc_common.llvm.1237943816091755067+0xb8/0xf8
>    do_el0_svc+0x28/0xa0
> 
> Fix it by copying the required variables for printing and while at
> it fix the similar issue at some other places in the same file.
> 
> Fixes: 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] f2fs: fix the msg data type
  2022-10-27  9:12   ` [f2fs-dev] " Mukesh Ojha
@ 2022-10-29  2:55     ` Chao Yu
  -1 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-10-29  2:55 UTC (permalink / raw)
  To: Mukesh Ojha, jaegeuk, mhiramat
  Cc: linux-f2fs-devel, linux-kernel, quic_pkondeti

On 2022/10/27 17:12, Mukesh Ojha wrote:
> Data type of msg in f2fs_write_checkpoint trace should
> be const char * instead of char *.
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [f2fs-dev] [PATCH 2/2] f2fs: fix the msg data type
@ 2022-10-29  2:55     ` Chao Yu
  0 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-10-29  2:55 UTC (permalink / raw)
  To: Mukesh Ojha, jaegeuk, mhiramat
  Cc: quic_pkondeti, linux-kernel, linux-f2fs-devel

On 2022/10/27 17:12, Mukesh Ojha wrote:
> Data type of msg in f2fs_write_checkpoint trace should
> be const char * instead of char *.
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-29  2:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27  9:12 [PATCH v2 1/2] f2fs: fix the assign logic of iocb Mukesh Ojha
2022-10-27  9:12 ` [f2fs-dev] " Mukesh Ojha
2022-10-27  9:12 ` [PATCH 2/2] f2fs: fix the msg data type Mukesh Ojha
2022-10-27  9:12   ` [f2fs-dev] " Mukesh Ojha
2022-10-27 10:17   ` Pavan Kondeti
2022-10-27 10:17     ` [f2fs-dev] " Pavan Kondeti
2022-10-27 10:30     ` Pavan Kondeti
2022-10-27 10:30       ` Pavan Kondeti
2022-10-29  2:55   ` Chao Yu
2022-10-29  2:55     ` [f2fs-dev] " Chao Yu
2022-10-29  2:55 ` [f2fs-dev] [PATCH v2 1/2] f2fs: fix the assign logic of iocb Chao Yu
2022-10-29  2:55   ` Chao Yu

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.