From: Chao Yu <chao@kernel.org>
To: Yongpeng Yang <yangyongpeng.storage@gmail.com>,
Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: chao@kernel.org, Yongpeng Yang <yangyongpeng@xiaomi.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: add fadvise tracepoint
Date: Wed, 29 Oct 2025 11:41:27 +0800 [thread overview]
Message-ID: <490569af-8e87-4cea-81dc-3bc9f59aa2b4@kernel.org> (raw)
In-Reply-To: <7040b501-6e25-42da-bda0-a15614a80d5d@gmail.com>
On 10/29/25 11:13, Yongpeng Yang wrote:
> On 10/29/25 10:06, Chao Yu via Linux-f2fs-devel wrote:
>> On 10/29/25 03:54, Jaegeuk Kim via Linux-f2fs-devel wrote:
>>> This adds a tracepoint in the fadvise call path.
>>>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>> ---
>>> fs/f2fs/file.c | 2 ++
>>> include/trace/events/f2fs.h | 32 ++++++++++++++++++++++++++++++++
>>> 2 files changed, 34 insertions(+)
>>>
>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>> index 6d42e2d28861..4a81089c5df3 100644
>>> --- a/fs/f2fs/file.c
>>> +++ b/fs/f2fs/file.c
>>> @@ -5288,6 +5288,8 @@ static int f2fs_file_fadvise(struct file *filp, loff_t offset, loff_t len,
>>> struct inode *inode = file_inode(filp);
>>> int err;
>>> + trace_f2fs_fadvise(inode, offset, len, advice);
>>> +
>>> if (advice == POSIX_FADV_SEQUENTIAL) {
>>> if (S_ISFIFO(inode->i_mode))
>>> return -ESPIPE;
>>> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
>>> index edbbd869078f..b7f5317b5980 100644
>>> --- a/include/trace/events/f2fs.h
>>> +++ b/include/trace/events/f2fs.h
>>> @@ -586,6 +586,38 @@ TRACE_EVENT(f2fs_file_write_iter,
>>> __entry->ret)
>>> );
>>> +TRACE_EVENT(f2fs_fadvise,
>>> +
>>> + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int advice),
>>> +
>>> + TP_ARGS(inode, offset, len, advice),
>>> +
>>> + TP_STRUCT__entry(
>>> + __field(dev_t, dev)
>>> + __field(ino_t, ino)
>>> + __field(loff_t, size)
>>> + __field(loff_t, offset)
>>> + __field(loff_t, len)
>>> + __field(int, advice)
>>> + ),
>>> +
>>> + TP_fast_assign(
>>> + __entry->dev = inode->i_sb->s_dev;
>>> + __entry->ino = inode->i_ino;
>>> + __entry->size = inode->i_size;
>>
>> __entry->size = i_size_read(inode)?
>>
>> Thanks,
>>
> The other "__entry->size = inode->i_size;" in include/trace/events/f2fs.h also need to be updated?
Yeah, Yongpeng, I noticed that and fixed them right after reply:
https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/commit/?h=bugfix/common&id=ffd21bf791143957f6ff1fc14d7dbd6e8466b320
Thanks for your reminder. :)
Thanks,
>
>>> + __entry->offset = offset;
>>> + __entry->len = len;
>>> + __entry->advice = advice;
>>> + ),
>>> +
>>> + TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld offset:%llu, len:%llu, advise:%d",
>>> + show_dev_ino(__entry),
>>> + (unsigned long long)__entry->size,
>>> + __entry->offset,
>>> + __entry->len,
>>> + __entry->advice)
>>> +);
>>> +
>>> TRACE_EVENT(f2fs_map_blocks,
>>> TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int flag,
>>> int ret),
>>
>>
>>
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>
next prev parent reply other threads:[~2025-10-29 3:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 19:54 Jaegeuk Kim
2025-10-29 2:06 ` [f2fs-dev] " Chao Yu
2025-10-29 3:13 ` Yongpeng Yang
2025-10-29 3:41 ` Chao Yu [this message]
2025-10-29 4:26 ` Jaegeuk Kim
2025-10-31 21:35 ` [PATCH v2] " Jaegeuk Kim
2025-11-03 2:31 ` [f2fs-dev] " Chao Yu
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=490569af-8e87-4cea-81dc-3bc9f59aa2b4@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yangyongpeng.storage@gmail.com \
--cc=yangyongpeng@xiaomi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®