Re: [f2fs-dev] [PATCH 1/1] f2fs: pass I_NEW flag to trace event

From: Jaegeuk Kim
Date: Wed May 17 2023 - 20:33:10 EST


On 05/17, Wu Bo wrote:
> On 2023/5/17 16:36, Chao Yu wrote:
> > On 2023/5/17 11:59, Wu Bo wrote:
> > > On 2023/5/17 10:44, Chao Yu wrote:
> > > > On 2023/5/16 20:07, Wu Bo wrote:
> > > > > Modify the order between 'trace_f2fs_iget' &
> > > > > 'unlock_new_inode', so the
> > > > > I_NEW can pass to the trace event when the inode initialised.
> > > >
> > > > Why is it needed? And trace_f2fs_iget() won't print inode->i_state?
> > >
> > > When connect a trace_probe to f2fs_iget, it will be able to
> > > determine whether
> > > the inode is new initialised in order to do different process.
> >
> > I didn't get it, you want to hook __tracepoint_f2fs_iget() w/ your own
> > callback?
> Yes,  to use 'tracepoint_probe_register ' to register a probe at
> trace_f2fs_iget

Why?

> >
> > Thanks,
> >
> > >
> > > >
> > > > Thanks,
> > > >
> > > > >
> > > > > Signed-off-by: Wu Bo <bo.wu@xxxxxxxx>
> > > > > ---
> > > > >    fs/f2fs/inode.c | 2 +-
> > > > >    1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> > > > > index cf4327ad106c..caf959289fe7 100644
> > > > > --- a/fs/f2fs/inode.c
> > > > > +++ b/fs/f2fs/inode.c
> > > > > @@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb,
> > > > > unsigned long ino)
> > > > >            file_dont_truncate(inode);
> > > > >        }
> > > > >    -    unlock_new_inode(inode);
> > > > >        trace_f2fs_iget(inode);
> > > > > +    unlock_new_inode(inode);
> > > > >        return inode;
> > > > >      bad_inode:
> > > >
> > > >
> > > > _______________________________________________
> > > > Linux-f2fs-devel mailing list
> > > > Linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx
> > > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> > > >