Re: [f2fs-dev] [PATCH 2/2] f2fs: fix the msg data type

2022-10-27 Thread Pavan Kondeti
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 
> > ---
> >  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


Re: [f2fs-dev] [PATCH 2/2] f2fs: fix the msg data type

2022-10-27 Thread Pavan Kondeti
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 
> ---
>  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


Re: [f2fs-dev] [PATCH] f2fs: fix the assign logic of iocb

2022-10-20 Thread Pavan Kondeti
Hi Mukesh,

On Wed, Oct 19, 2022 at 09:47:57PM +0530, 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.
> 
> Fix it by correcting data type and memcpy the content of iocb.
> 
> Fixes: 18ae8d12991b ("f2fs: show more DIO information in tracepoint")
> Signed-off-by: Mukesh Ojha 
> ---
>  include/trace/events/f2fs.h | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index c6b3724..7727ec9 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -940,7 +940,7 @@ TRACE_EVENT(f2fs_direct_IO_enter,
>   TP_STRUCT__entry(
>   __field(dev_t,  dev)
>   __field(ino_t,  ino)
> - __field(struct kiocb *, iocb)
> + __field_struct(struct kiocb,iocb)
>   __field(unsigned long,  len)
>   __field(int,rw)
>   ),
> @@ -948,17 +948,17 @@ TRACE_EVENT(f2fs_direct_IO_enter,
>   TP_fast_assign(
>   __entry->dev= inode->i_sb->s_dev;
>   __entry->ino= inode->i_ino;
> - __entry->iocb   = iocb;
> +  memcpy(&__entry->iocb, iocb, sizeof(*iocb));
>   __entry->len= len;
>   __entry->rw = rw;
>   ),
>  

Why copy the whole structure (48 bytes)? cache the three members you
need.

Thanks,
Pavan


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