f2fs: fix up f2fs_lookup tracepoints

Fix up a misuse that the filename pointer isn't always valid in
the ring buffer, and we should copy the content instead.

Fixes: 0c5e36db17 ("f2fs: trace f2fs_lookup")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Gao Xiang 2021-09-21 22:37:30 +08:00 committed by Jaegeuk Kim
parent 6663b138de
commit 70a9ac36ff
1 changed files with 6 additions and 6 deletions

View File

@ -807,20 +807,20 @@ TRACE_EVENT(f2fs_lookup_start,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
__field(ino_t, ino) __field(ino_t, ino)
__field(const char *, name) __string(name, dentry->d_name.name)
__field(unsigned int, flags) __field(unsigned int, flags)
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = dir->i_sb->s_dev; __entry->dev = dir->i_sb->s_dev;
__entry->ino = dir->i_ino; __entry->ino = dir->i_ino;
__entry->name = dentry->d_name.name; __assign_str(name, dentry->d_name.name);
__entry->flags = flags; __entry->flags = flags;
), ),
TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u", TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
show_dev_ino(__entry), show_dev_ino(__entry),
__entry->name, __get_str(name),
__entry->flags) __entry->flags)
); );
@ -834,7 +834,7 @@ TRACE_EVENT(f2fs_lookup_end,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
__field(ino_t, ino) __field(ino_t, ino)
__field(const char *, name) __string(name, dentry->d_name.name)
__field(nid_t, cino) __field(nid_t, cino)
__field(int, err) __field(int, err)
), ),
@ -842,14 +842,14 @@ TRACE_EVENT(f2fs_lookup_end,
TP_fast_assign( TP_fast_assign(
__entry->dev = dir->i_sb->s_dev; __entry->dev = dir->i_sb->s_dev;
__entry->ino = dir->i_ino; __entry->ino = dir->i_ino;
__entry->name = dentry->d_name.name; __assign_str(name, dentry->d_name.name);
__entry->cino = ino; __entry->cino = ino;
__entry->err = err; __entry->err = err;
), ),
TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d", TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
show_dev_ino(__entry), show_dev_ino(__entry),
__entry->name, __get_str(name),
__entry->cino, __entry->cino,
__entry->err) __entry->err)
); );