Skip to content

Commit bd984c0

Browse files
author
Jaegeuk Kim
committed
f2fs: show more DIO information in tracepoint
This prints more information of DIO in tracepoint. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent a1e09b0 commit bd984c0

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

fs/f2fs/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4284,7 +4284,7 @@ static ssize_t f2fs_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)
42844284
if (count == 0)
42854285
return 0; /* skip atime update */
42864286

4287-
trace_f2fs_direct_IO_enter(inode, pos, count, READ);
4287+
trace_f2fs_direct_IO_enter(inode, iocb, count, READ);
42884288

42894289
if (iocb->ki_flags & IOCB_NOWAIT) {
42904290
if (!down_read_trylock(&fi->i_gc_rwsem[READ])) {
@@ -4483,7 +4483,7 @@ static ssize_t f2fs_dio_write_iter(struct kiocb *iocb, struct iov_iter *from,
44834483
struct iomap_dio *dio;
44844484
ssize_t ret;
44854485

4486-
trace_f2fs_direct_IO_enter(inode, pos, count, WRITE);
4486+
trace_f2fs_direct_IO_enter(inode, iocb, count, WRITE);
44874487

44884488
if (iocb->ki_flags & IOCB_NOWAIT) {
44894489
/* f2fs_convert_inline_inode() and block allocation can block */

include/trace/events/f2fs.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -936,30 +936,33 @@ TRACE_EVENT(f2fs_fallocate,
936936

937937
TRACE_EVENT(f2fs_direct_IO_enter,
938938

939-
TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
939+
TP_PROTO(struct inode *inode, struct kiocb *iocb, long len, int rw),
940940

941-
TP_ARGS(inode, offset, len, rw),
941+
TP_ARGS(inode, iocb, len, rw),
942942

943943
TP_STRUCT__entry(
944944
__field(dev_t, dev)
945945
__field(ino_t, ino)
946-
__field(loff_t, pos)
946+
__field(struct kiocb *, iocb)
947947
__field(unsigned long, len)
948948
__field(int, rw)
949949
),
950950

951951
TP_fast_assign(
952952
__entry->dev = inode->i_sb->s_dev;
953953
__entry->ino = inode->i_ino;
954-
__entry->pos = offset;
954+
__entry->iocb = iocb;
955955
__entry->len = len;
956956
__entry->rw = rw;
957957
),
958958

959-
TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
959+
TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_hint = %x ki_ioprio = %x rw = %d",
960960
show_dev_ino(__entry),
961-
__entry->pos,
961+
__entry->iocb->ki_pos,
962962
__entry->len,
963+
__entry->iocb->ki_flags,
964+
__entry->iocb->ki_hint,
965+
__entry->iocb->ki_ioprio,
963966
__entry->rw)
964967
);
965968

0 commit comments

Comments
 (0)