summaryrefslogtreecommitdiff
path: root/include/trace/events/f2fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/f2fs.h')
-rw-r--r--include/trace/events/f2fs.h442
1 files changed, 318 insertions, 124 deletions
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index df4017dcc701..d53be932df01 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -9,7 +9,7 @@
#include <uapi/linux/f2fs.h>
#define show_dev(dev) MAJOR(dev), MINOR(dev)
-#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
+#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long long)entry->ino
TRACE_DEFINE_ENUM(NODE);
TRACE_DEFINE_ENUM(DATA);
@@ -184,6 +184,16 @@ TRACE_DEFINE_ENUM(CP_PHASE_FINISH_CHECKPOINT);
{ CP_PHASE_FINISH_BLOCK_OPS, "finish block_ops" }, \
{ CP_PHASE_FINISH_CHECKPOINT, "finish checkpoint" })
+#define show_lock_name(lock) \
+ __print_symbolic(lock, \
+ { LOCK_NAME_CP_RWSEM, "cp_rwsem" }, \
+ { LOCK_NAME_NODE_CHANGE, "node_change" }, \
+ { LOCK_NAME_NODE_WRITE, "node_write" }, \
+ { LOCK_NAME_GC_LOCK, "gc_lock" }, \
+ { LOCK_NAME_CP_GLOBAL, "cp_global" }, \
+ { LOCK_NAME_IO_RWSEM, "io_rwsem" }, \
+ { LOCK_NAME_NAT_TREE_LOCK, "nat_tree_lock" })
+
struct f2fs_sb_info;
struct f2fs_io_info;
struct extent_info;
@@ -197,13 +207,13 @@ DECLARE_EVENT_CLASS(f2fs__inode,
TP_ARGS(inode),
TP_STRUCT__entry(
+ __field(u64, ino)
+ __field(u64, pino)
+ __field(loff_t, size)
+ __field(blkcnt_t, blocks)
__field(dev_t, dev)
- __field(ino_t, ino)
- __field(ino_t, pino)
__field(umode_t, mode)
- __field(loff_t, size)
__field(unsigned int, nlink)
- __field(blkcnt_t, blocks)
__field(__u8, advise)
),
@@ -218,10 +228,10 @@ DECLARE_EVENT_CLASS(f2fs__inode,
__entry->advise = F2FS_I(inode)->i_advise;
),
- TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
+ TP_printk("dev = (%d,%d), ino = %llu, pino = %llu, i_mode = 0x%hx, "
"i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
show_dev_ino(__entry),
- (unsigned long)__entry->pino,
+ __entry->pino,
__entry->mode,
__entry->size,
(unsigned int)__entry->nlink,
@@ -236,8 +246,8 @@ DECLARE_EVENT_CLASS(f2fs__inode_exit,
TP_ARGS(inode, ret),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(umode_t, mode)
__field(int, ret)
),
@@ -249,7 +259,7 @@ DECLARE_EVENT_CLASS(f2fs__inode_exit,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, type: %s, mode = 0%o, ret = %d",
+ TP_printk("dev = (%d,%d), ino = %llu, type: %s, mode = 0%o, ret = %d",
show_dev_ino(__entry),
show_inode_type(__entry->mode & S_IFMT),
__entry->mode & S_ALL_PERM,
@@ -270,8 +280,8 @@ TRACE_EVENT(f2fs_sync_file_exit,
TP_ARGS(inode, cp_reason, datasync, ret),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(int, cp_reason)
__field(int, datasync)
__field(int, ret)
@@ -285,7 +295,7 @@ TRACE_EVENT(f2fs_sync_file_exit,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
+ TP_printk("dev = (%d,%d), ino = %llu, cp_reason: %s, "
"datasync = %d, ret = %d",
show_dev_ino(__entry),
show_fsync_cpreason(__entry->cp_reason),
@@ -352,10 +362,10 @@ TRACE_EVENT(f2fs_unlink_enter,
TP_ARGS(dir, dentry),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, size)
__field(blkcnt_t, blocks)
+ __field(dev_t, dev)
__string(name, dentry->d_name.name)
),
@@ -367,7 +377,7 @@ TRACE_EVENT(f2fs_unlink_enter,
__assign_str(name);
),
- TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
+ TP_printk("dev = (%d,%d), dir ino = %llu, i_size = %lld, "
"i_blocks = %llu, name = %s",
show_dev_ino(__entry),
__entry->size,
@@ -403,8 +413,8 @@ TRACE_EVENT(f2fs_truncate_data_blocks_range,
TP_ARGS(inode, nid, ofs, free),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(nid_t, nid)
__field(unsigned int, ofs)
__field(int, free)
@@ -418,7 +428,7 @@ TRACE_EVENT(f2fs_truncate_data_blocks_range,
__entry->free = free;
),
- TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
+ TP_printk("dev = (%d,%d), ino = %llu, nid = %u, offset = %u, freed = %d",
show_dev_ino(__entry),
(unsigned int)__entry->nid,
__entry->ofs,
@@ -432,11 +442,11 @@ DECLARE_EVENT_CLASS(f2fs__truncate_op,
TP_ARGS(inode, from),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, size)
__field(blkcnt_t, blocks)
__field(u64, from)
+ __field(dev_t, dev)
),
TP_fast_assign(
@@ -447,7 +457,7 @@ DECLARE_EVENT_CLASS(f2fs__truncate_op,
__entry->from = from;
),
- TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
+ TP_printk("dev = (%d,%d), ino = %llu, i_size = %lld, i_blocks = %llu, "
"start file offset = %llu",
show_dev_ino(__entry),
__entry->size,
@@ -490,8 +500,8 @@ DECLARE_EVENT_CLASS(f2fs__truncate_node,
TP_ARGS(inode, nid, blk_addr),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(nid_t, nid)
__field(block_t, blk_addr)
),
@@ -503,7 +513,7 @@ DECLARE_EVENT_CLASS(f2fs__truncate_node,
__entry->blk_addr = blk_addr;
),
- TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
+ TP_printk("dev = (%d,%d), ino = %llu, nid = %u, block_address = 0x%llx",
show_dev_ino(__entry),
(unsigned int)__entry->nid,
(unsigned long long)__entry->blk_addr)
@@ -537,8 +547,8 @@ TRACE_EVENT(f2fs_truncate_partial_nodes,
TP_ARGS(inode, nid, depth, err),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__array(nid_t, nid, 3)
__field(int, depth)
__field(int, err)
@@ -554,7 +564,7 @@ TRACE_EVENT(f2fs_truncate_partial_nodes,
__entry->err = err;
),
- TP_printk("dev = (%d,%d), ino = %lu, "
+ TP_printk("dev = (%d,%d), ino = %llu, "
"nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
show_dev_ino(__entry),
(unsigned int)__entry->nid[0],
@@ -572,11 +582,11 @@ TRACE_EVENT(f2fs_file_write_iter,
TP_ARGS(inode, offset, length, ret),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, offset)
__field(size_t, length)
__field(ssize_t, ret)
+ __field(dev_t, dev)
),
TP_fast_assign(
@@ -587,7 +597,7 @@ TRACE_EVENT(f2fs_file_write_iter,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, "
+ TP_printk("dev = (%d,%d), ino = %llu, "
"offset = %lld, length = %zu, written(err) = %zd",
show_dev_ino(__entry),
__entry->offset,
@@ -602,11 +612,11 @@ TRACE_EVENT(f2fs_fadvise,
TP_ARGS(inode, offset, len, advice),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, size)
__field(loff_t, offset)
__field(loff_t, len)
+ __field(dev_t, dev)
__field(int, advice)
),
@@ -619,7 +629,7 @@ TRACE_EVENT(f2fs_fadvise,
__entry->advice = advice;
),
- TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld offset:%llu, len:%llu, advise:%d",
+ TP_printk("dev = (%d,%d), ino = %llu, i_size = %lld offset:%llu, len:%llu, advise:%d",
show_dev_ino(__entry),
(unsigned long long)__entry->size,
__entry->offset,
@@ -634,8 +644,8 @@ TRACE_EVENT(f2fs_map_blocks,
TP_ARGS(inode, map, flag, ret),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(block_t, m_lblk)
__field(block_t, m_pblk)
__field(unsigned int, m_len)
@@ -661,7 +671,7 @@ TRACE_EVENT(f2fs_map_blocks,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
+ TP_printk("dev = (%d,%d), ino = %llu, file offset = %llu, "
"start blkaddr = 0x%llx, len = 0x%llx, flags = %u, "
"seg_type = %d, may_create = %d, multidevice = %d, "
"flag = %d, err = %d",
@@ -876,8 +886,8 @@ TRACE_EVENT(f2fs_lookup_start,
TP_ARGS(dir, dentry, flags),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__string(name, dentry->d_name.name)
__field(unsigned int, flags)
),
@@ -889,7 +899,7 @@ TRACE_EVENT(f2fs_lookup_start,
__entry->flags = flags;
),
- TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
+ TP_printk("dev = (%d,%d), pino = %llu, name:%s, flags:%u",
show_dev_ino(__entry),
__get_str(name),
__entry->flags)
@@ -903,8 +913,8 @@ TRACE_EVENT(f2fs_lookup_end,
TP_ARGS(dir, dentry, ino, err),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__string(name, dentry->d_name.name)
__field(nid_t, cino)
__field(int, err)
@@ -918,7 +928,7 @@ TRACE_EVENT(f2fs_lookup_end,
__entry->err = err;
),
- TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
+ TP_printk("dev = (%d,%d), pino = %llu, name:%s, ino:%u, err:%d",
show_dev_ino(__entry),
__get_str(name),
__entry->cino,
@@ -934,10 +944,10 @@ TRACE_EVENT(f2fs_rename_start,
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, flags),
TP_STRUCT__entry(
+ __field(u64, ino)
+ __field(u64, new_pino)
__field(dev_t, dev)
- __field(ino_t, ino)
__string(old_name, old_dentry->d_name.name)
- __field(ino_t, new_pino)
__string(new_name, new_dentry->d_name.name)
__field(unsigned int, flags)
),
@@ -951,8 +961,8 @@ TRACE_EVENT(f2fs_rename_start,
__entry->flags = flags;
),
- TP_printk("dev = (%d,%d), old_dir = %lu, old_name: %s, "
- "new_dir = %lu, new_name: %s, flags = %u",
+ TP_printk("dev = (%d,%d), old_dir = %llu, old_name: %s, "
+ "new_dir = %llu, new_name: %s, flags = %u",
show_dev_ino(__entry),
__get_str(old_name),
__entry->new_pino,
@@ -968,8 +978,8 @@ TRACE_EVENT(f2fs_rename_end,
TP_ARGS(old_dentry, new_dentry, flags, ret),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__string(old_name, old_dentry->d_name.name)
__string(new_name, new_dentry->d_name.name)
__field(unsigned int, flags)
@@ -985,7 +995,7 @@ TRACE_EVENT(f2fs_rename_end,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, old_name: %s, "
+ TP_printk("dev = (%d,%d), ino = %llu, old_name: %s, "
"new_name: %s, flags = %u, ret = %d",
show_dev_ino(__entry),
__get_str(old_name),
@@ -1001,10 +1011,10 @@ TRACE_EVENT(f2fs_readdir,
TP_ARGS(dir, start_pos, end_pos, err),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, start)
__field(loff_t, end)
+ __field(dev_t, dev)
__field(int, err)
),
@@ -1016,7 +1026,7 @@ TRACE_EVENT(f2fs_readdir,
__entry->err = err;
),
- TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
+ TP_printk("dev = (%d,%d), ino = %llu, start_pos:%llu, end_pos:%llu, err:%d",
show_dev_ino(__entry),
__entry->start,
__entry->end,
@@ -1031,13 +1041,13 @@ TRACE_EVENT(f2fs_fallocate,
TP_ARGS(inode, mode, offset, len, ret),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
- __field(int, mode)
+ __field(u64, ino)
__field(loff_t, offset)
__field(loff_t, len)
__field(loff_t, size)
__field(blkcnt_t, blocks)
+ __field(dev_t, dev)
+ __field(int, mode)
__field(int, ret)
),
@@ -1052,7 +1062,7 @@ TRACE_EVENT(f2fs_fallocate,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
+ TP_printk("dev = (%d,%d), ino = %llu, mode = %x, offset = %lld, "
"len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
show_dev_ino(__entry),
__entry->mode,
@@ -1070,12 +1080,12 @@ TRACE_EVENT(f2fs_direct_IO_enter,
TP_ARGS(inode, iocb, len, rw),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, ki_pos)
+ __field(unsigned long, len)
+ __field(dev_t, dev)
__field(int, ki_flags)
__field(u16, ki_ioprio)
- __field(unsigned long, len)
__field(int, rw)
),
@@ -1089,7 +1099,7 @@ TRACE_EVENT(f2fs_direct_IO_enter,
__entry->rw = rw;
),
- TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_ioprio = %x rw = %d",
+ TP_printk("dev = (%d,%d), ino = %llu pos = %lld len = %lu ki_flags = %x ki_ioprio = %x rw = %d",
show_dev_ino(__entry),
__entry->ki_pos,
__entry->len,
@@ -1106,10 +1116,10 @@ TRACE_EVENT(f2fs_direct_IO_exit,
TP_ARGS(inode, offset, len, rw, ret),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, pos)
__field(unsigned long, len)
+ __field(dev_t, dev)
__field(int, rw)
__field(int, ret)
),
@@ -1123,7 +1133,7 @@ TRACE_EVENT(f2fs_direct_IO_exit,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
+ TP_printk("dev = (%d,%d), ino = %llu pos = %lld len = %lu "
"rw = %d ret = %d",
show_dev_ino(__entry),
__entry->pos,
@@ -1167,9 +1177,9 @@ DECLARE_EVENT_CLASS(f2fs__submit_folio_bio,
TP_ARGS(folio, fio),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(pgoff_t, index)
+ __field(dev_t, dev)
__field(block_t, old_blkaddr)
__field(block_t, new_blkaddr)
__field(enum req_op, op)
@@ -1190,7 +1200,7 @@ DECLARE_EVENT_CLASS(f2fs__submit_folio_bio,
__entry->type = fio->type;
),
- TP_printk("dev = (%d,%d), ino = %lu, folio_index = 0x%lx, "
+ TP_printk("dev = (%d,%d), ino = %llu, folio_index = 0x%lx, "
"oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
show_dev_ino(__entry),
(unsigned long)__entry->index,
@@ -1297,9 +1307,9 @@ TRACE_EVENT(f2fs_write_begin,
TP_ARGS(inode, pos, len),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, pos)
+ __field(dev_t, dev)
__field(unsigned int, len)
),
@@ -1310,7 +1320,7 @@ TRACE_EVENT(f2fs_write_begin,
__entry->len = len;
),
- TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u",
+ TP_printk("dev = (%d,%d), ino = %llu, pos = %llu, len = %u",
show_dev_ino(__entry),
(unsigned long long)__entry->pos,
__entry->len)
@@ -1324,9 +1334,9 @@ TRACE_EVENT(f2fs_write_end,
TP_ARGS(inode, pos, len, copied),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, pos)
+ __field(dev_t, dev)
__field(unsigned int, len)
__field(unsigned int, copied)
),
@@ -1339,7 +1349,7 @@ TRACE_EVENT(f2fs_write_end,
__entry->copied = copied;
),
- TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
+ TP_printk("dev = (%d,%d), ino = %llu, pos = %llu, len = %u, copied = %u",
show_dev_ino(__entry),
(unsigned long long)__entry->pos,
__entry->len,
@@ -1353,11 +1363,12 @@ DECLARE_EVENT_CLASS(f2fs__folio,
TP_ARGS(folio, type),
TP_STRUCT__entry(
+ __field(u64, ino)
+ __field(pgoff_t, index)
+ __field(pgoff_t, nrpages)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(int, type)
__field(int, dir)
- __field(pgoff_t, index)
__field(int, dirty)
__field(int, uptodate)
),
@@ -1368,16 +1379,18 @@ DECLARE_EVENT_CLASS(f2fs__folio,
__entry->type = type;
__entry->dir = S_ISDIR(folio->mapping->host->i_mode);
__entry->index = folio->index;
+ __entry->nrpages= folio_nr_pages(folio);
__entry->dirty = folio_test_dirty(folio);
__entry->uptodate = folio_test_uptodate(folio);
),
- TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
+ TP_printk("dev = (%d,%d), ino = %llu, %s, %s, index = %lu, nr_pages = %lu, "
"dirty = %d, uptodate = %d",
show_dev_ino(__entry),
show_block_type(__entry->type),
show_file_type(__entry->dir),
(unsigned long)__entry->index,
+ (unsigned long)__entry->nrpages,
__entry->dirty,
__entry->uptodate)
);
@@ -1403,6 +1416,13 @@ DEFINE_EVENT(f2fs__folio, f2fs_readpage,
TP_ARGS(folio, type)
);
+DEFINE_EVENT(f2fs__folio, f2fs_read_folio,
+
+ TP_PROTO(struct folio *folio, int type),
+
+ TP_ARGS(folio, type)
+);
+
DEFINE_EVENT(f2fs__folio, f2fs_set_page_dirty,
TP_PROTO(struct folio *folio, int type),
@@ -1418,10 +1438,10 @@ TRACE_EVENT(f2fs_replace_atomic_write_block,
TP_ARGS(inode, cow_inode, index, old_addr, new_addr, recovery),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
- __field(ino_t, cow_ino)
+ __field(u64, ino)
+ __field(u64, cow_ino)
__field(pgoff_t, index)
+ __field(dev_t, dev)
__field(block_t, old_addr)
__field(block_t, new_addr)
__field(bool, recovery)
@@ -1437,7 +1457,7 @@ TRACE_EVENT(f2fs_replace_atomic_write_block,
__entry->recovery = recovery;
),
- TP_printk("dev = (%d,%d), ino = %lu, cow_ino = %lu, index = %lu, "
+ TP_printk("dev = (%d,%d), ino = %llu, cow_ino = %llu, index = %lu, "
"old_addr = 0x%llx, new_addr = 0x%llx, recovery = %d",
show_dev_ino(__entry),
__entry->cow_ino,
@@ -1455,10 +1475,10 @@ DECLARE_EVENT_CLASS(f2fs_mmap,
TP_ARGS(inode, index, flags, ret),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(pgoff_t, index)
__field(vm_flags_t, flags)
+ __field(dev_t, dev)
__field(vm_fault_t, ret)
),
@@ -1470,7 +1490,7 @@ DECLARE_EVENT_CLASS(f2fs_mmap,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, index = %lu, flags: %s, ret: %s",
+ TP_printk("dev = (%d,%d), ino = %llu, index = %lu, flags: %s, ret: %s",
show_dev_ino(__entry),
(unsigned long)__entry->index,
__print_flags(__entry->flags, "|", FAULT_FLAG_TRACE),
@@ -1500,15 +1520,15 @@ TRACE_EVENT(f2fs_writepages,
TP_ARGS(inode, wbc, type),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
- __field(int, type)
- __field(int, dir)
- __field(long, nr_to_write)
- __field(long, pages_skipped)
+ __field(u64, ino)
__field(loff_t, range_start)
__field(loff_t, range_end)
+ __field(long, nr_to_write)
+ __field(long, pages_skipped)
__field(pgoff_t, writeback_index)
+ __field(dev_t, dev)
+ __field(int, type)
+ __field(int, dir)
__field(int, sync_mode)
__field(char, for_kupdate)
__field(char, for_background)
@@ -1535,7 +1555,7 @@ TRACE_EVENT(f2fs_writepages,
__entry->for_sync = wbc->for_sync;
),
- TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
+ TP_printk("dev = (%d,%d), ino = %llu, %s, %s, nr_to_write %ld, "
"skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
"kupdate %u background %u tagged %u cyclic %u sync %u",
show_dev_ino(__entry),
@@ -1561,9 +1581,9 @@ TRACE_EVENT(f2fs_readpages,
TP_ARGS(inode, start, nrpage),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(pgoff_t, start)
+ __field(dev_t, dev)
__field(unsigned int, nrpage)
),
@@ -1574,7 +1594,7 @@ TRACE_EVENT(f2fs_readpages,
__entry->nrpage = nrpage;
),
- TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
+ TP_printk("dev = (%d,%d), ino = %llu, start = %lu nrpage = %u",
show_dev_ino(__entry),
(unsigned long)__entry->start,
__entry->nrpage)
@@ -1719,8 +1739,8 @@ TRACE_EVENT(f2fs_lookup_extent_tree_start,
TP_ARGS(inode, pgofs, type),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(unsigned int, pgofs)
__field(enum extent_type, type)
),
@@ -1732,7 +1752,7 @@ TRACE_EVENT(f2fs_lookup_extent_tree_start,
__entry->type = type;
),
- TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, type = %s",
+ TP_printk("dev = (%d,%d), ino = %llu, pgofs = %u, type = %s",
show_dev_ino(__entry),
__entry->pgofs,
show_extent_type(__entry->type))
@@ -1748,8 +1768,8 @@ TRACE_EVENT_CONDITION(f2fs_lookup_read_extent_tree_end,
TP_CONDITION(ei),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(unsigned int, pgofs)
__field(unsigned int, fofs)
__field(unsigned int, len)
@@ -1765,7 +1785,7 @@ TRACE_EVENT_CONDITION(f2fs_lookup_read_extent_tree_end,
__entry->blk = ei->blk;
),
- TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
+ TP_printk("dev = (%d,%d), ino = %llu, pgofs = %u, "
"read_ext_info(fofs: %u, len: %u, blk: %u)",
show_dev_ino(__entry),
__entry->pgofs,
@@ -1784,13 +1804,13 @@ TRACE_EVENT_CONDITION(f2fs_lookup_age_extent_tree_end,
TP_CONDITION(ei),
TP_STRUCT__entry(
+ __field(u64, ino)
+ __field(unsigned long long, age)
+ __field(unsigned long long, blocks)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(unsigned int, pgofs)
__field(unsigned int, fofs)
__field(unsigned int, len)
- __field(unsigned long long, age)
- __field(unsigned long long, blocks)
),
TP_fast_assign(
@@ -1803,7 +1823,7 @@ TRACE_EVENT_CONDITION(f2fs_lookup_age_extent_tree_end,
__entry->blocks = ei->last_blocks;
),
- TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
+ TP_printk("dev = (%d,%d), ino = %llu, pgofs = %u, "
"age_ext_info(fofs: %u, len: %u, age: %llu, blocks: %llu)",
show_dev_ino(__entry),
__entry->pgofs,
@@ -1822,8 +1842,8 @@ TRACE_EVENT(f2fs_update_read_extent_tree_range,
TP_ARGS(inode, pgofs, len, blkaddr, c_len),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(unsigned int, pgofs)
__field(u32, blk)
__field(unsigned int, len)
@@ -1839,7 +1859,7 @@ TRACE_EVENT(f2fs_update_read_extent_tree_range,
__entry->c_len = c_len;
),
- TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
+ TP_printk("dev = (%d,%d), ino = %llu, pgofs = %u, "
"len = %u, blkaddr = %u, c_len = %u",
show_dev_ino(__entry),
__entry->pgofs,
@@ -1857,12 +1877,12 @@ TRACE_EVENT(f2fs_update_age_extent_tree_range,
TP_ARGS(inode, pgofs, len, age, last_blks),
TP_STRUCT__entry(
+ __field(u64, ino)
+ __field(unsigned long long, age)
+ __field(unsigned long long, blocks)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(unsigned int, pgofs)
__field(unsigned int, len)
- __field(unsigned long long, age)
- __field(unsigned long long, blocks)
),
TP_fast_assign(
@@ -1874,7 +1894,7 @@ TRACE_EVENT(f2fs_update_age_extent_tree_range,
__entry->blocks = last_blks;
),
- TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
+ TP_printk("dev = (%d,%d), ino = %llu, pgofs = %u, "
"len = %u, age = %llu, blocks = %llu",
show_dev_ino(__entry),
__entry->pgofs,
@@ -1919,8 +1939,8 @@ TRACE_EVENT(f2fs_destroy_extent_tree,
TP_ARGS(inode, node_cnt, type),
TP_STRUCT__entry(
+ __field(u64, ino)
__field(dev_t, dev)
- __field(ino_t, ino)
__field(unsigned int, node_cnt)
__field(enum extent_type, type)
),
@@ -1932,7 +1952,7 @@ TRACE_EVENT(f2fs_destroy_extent_tree,
__entry->type = type;
),
- TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u, type = %s",
+ TP_printk("dev = (%d,%d), ino = %llu, destroyed: node_cnt = %u, type = %s",
show_dev_ino(__entry),
__entry->node_cnt,
show_extent_type(__entry->type))
@@ -2008,9 +2028,9 @@ DECLARE_EVENT_CLASS(f2fs_zip_start,
TP_ARGS(inode, cluster_idx, cluster_size, algtype),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(pgoff_t, idx)
+ __field(dev_t, dev)
__field(unsigned int, size)
__field(unsigned int, algtype)
),
@@ -2023,7 +2043,7 @@ DECLARE_EVENT_CLASS(f2fs_zip_start,
__entry->algtype = algtype;
),
- TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
+ TP_printk("dev = (%d,%d), ino = %llu, cluster_idx:%lu, "
"cluster_size = %u, algorithm = %s",
show_dev_ino(__entry),
__entry->idx,
@@ -2039,9 +2059,9 @@ DECLARE_EVENT_CLASS(f2fs_zip_end,
TP_ARGS(inode, cluster_idx, compressed_size, ret),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(pgoff_t, idx)
+ __field(dev_t, dev)
__field(unsigned int, size)
__field(unsigned int, ret)
),
@@ -2054,7 +2074,7 @@ DECLARE_EVENT_CLASS(f2fs_zip_end,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
+ TP_printk("dev = (%d,%d), ino = %llu, cluster_idx:%lu, "
"compressed_size = %u, ret = %d",
show_dev_ino(__entry),
__entry->idx,
@@ -2095,11 +2115,20 @@ DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
);
#ifdef CONFIG_F2FS_IOSTAT
+/*
+ * Number of read folio order buckets emitted by the f2fs_iostat tracepoint.
+ * TP_printk() cannot loop, so the field count is fixed here and must be >=
+ * the largest possible NR_PAGE_ORDERS (14 on arm64 with 64K pages). The
+ * BUILD_BUG_ON() in f2fs_update_read_folio_count() enforces this.
+ */
+#define F2FS_IOSTAT_RD_FOLIO_ORDERS 16
+
TRACE_EVENT(f2fs_iostat,
- TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat),
+ TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat,
+ unsigned long long *read_folio_count),
- TP_ARGS(sbi, iostat),
+ TP_ARGS(sbi, iostat, read_folio_count),
TP_STRUCT__entry(
__field(dev_t, dev)
@@ -2131,6 +2160,7 @@ TRACE_EVENT(f2fs_iostat,
__field(unsigned long long, fs_mrio)
__field(unsigned long long, fs_discard)
__field(unsigned long long, fs_reset_zone)
+ __array(unsigned long long, read_folio_count, F2FS_IOSTAT_RD_FOLIO_ORDERS)
),
TP_fast_assign(
@@ -2163,6 +2193,10 @@ TRACE_EVENT(f2fs_iostat,
__entry->fs_mrio = iostat[FS_META_READ_IO];
__entry->fs_discard = iostat[FS_DISCARD_IO];
__entry->fs_reset_zone = iostat[FS_ZONE_RESET_IO];
+ memset(__entry->read_folio_count, 0, sizeof(__entry->read_folio_count));
+ memcpy(__entry->read_folio_count, read_folio_count,
+ sizeof(unsigned long long) *
+ min_t(int, NR_PAGE_ORDERS, F2FS_IOSTAT_RD_FOLIO_ORDERS));
),
TP_printk("dev = (%d,%d), "
@@ -2175,7 +2209,10 @@ TRACE_EVENT(f2fs_iostat,
"app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
"compr(buffered=%llu, mapped=%llu)], "
"fs [data=%llu, (gc_data=%llu, cdata=%llu), "
- "node=%llu, meta=%llu]",
+ "node=%llu, meta=%llu], "
+ "read_folio_count [0=%llu, 1=%llu, 2=%llu, 3=%llu, 4=%llu, "
+ "5=%llu, 6=%llu, 7=%llu, 8=%llu, 9=%llu, 10=%llu, 11=%llu, "
+ "12=%llu, 13=%llu, 14=%llu, 15=%llu]",
show_dev(__entry->dev), __entry->app_wio, __entry->app_dio,
__entry->app_bio, __entry->app_mio, __entry->app_bcdio,
__entry->app_mcdio, __entry->fs_dio, __entry->fs_cdio,
@@ -2186,7 +2223,15 @@ TRACE_EVENT(f2fs_iostat,
__entry->app_rio, __entry->app_drio, __entry->app_brio,
__entry->app_mrio, __entry->app_bcrio, __entry->app_mcrio,
__entry->fs_drio, __entry->fs_gdrio,
- __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio)
+ __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio,
+ __entry->read_folio_count[0], __entry->read_folio_count[1],
+ __entry->read_folio_count[2], __entry->read_folio_count[3],
+ __entry->read_folio_count[4], __entry->read_folio_count[5],
+ __entry->read_folio_count[6], __entry->read_folio_count[7],
+ __entry->read_folio_count[8], __entry->read_folio_count[9],
+ __entry->read_folio_count[10], __entry->read_folio_count[11],
+ __entry->read_folio_count[12], __entry->read_folio_count[13],
+ __entry->read_folio_count[14], __entry->read_folio_count[15])
);
#ifndef __F2FS_IOSTAT_LATENCY_TYPE
@@ -2292,10 +2337,10 @@ TRACE_EVENT(f2fs_bmap,
TP_ARGS(inode, lblock, pblock),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(sector_t, lblock)
__field(sector_t, pblock)
+ __field(dev_t, dev)
),
TP_fast_assign(
@@ -2305,7 +2350,7 @@ TRACE_EVENT(f2fs_bmap,
__entry->pblock = pblock;
),
- TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld",
+ TP_printk("dev = (%d,%d), ino = %llu, lblock:%lld, pblock:%lld",
show_dev_ino(__entry),
(unsigned long long)__entry->lblock,
(unsigned long long)__entry->pblock)
@@ -2319,11 +2364,11 @@ TRACE_EVENT(f2fs_fiemap,
TP_ARGS(inode, lblock, pblock, len, flags, ret),
TP_STRUCT__entry(
- __field(dev_t, dev)
- __field(ino_t, ino)
+ __field(u64, ino)
__field(sector_t, lblock)
__field(sector_t, pblock)
__field(unsigned long long, len)
+ __field(dev_t, dev)
__field(unsigned int, flags)
__field(int, ret)
),
@@ -2338,7 +2383,7 @@ TRACE_EVENT(f2fs_fiemap,
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, "
+ TP_printk("dev = (%d,%d), ino = %llu, lblock:%lld, pblock:%lld, "
"len:%llu, flags:%u, ret:%d",
show_dev_ino(__entry),
(unsigned long long)__entry->lblock,
@@ -2356,13 +2401,13 @@ DECLARE_EVENT_CLASS(f2fs__rw_start,
TP_ARGS(inode, offset, bytes, pid, pathname, command),
TP_STRUCT__entry(
- __string(pathbuf, pathname)
+ __field(u64, ino)
__field(loff_t, offset)
- __field(int, bytes)
__field(loff_t, i_size)
+ __string(pathbuf, pathname)
__string(cmdline, command)
__field(pid_t, pid)
- __field(ino_t, ino)
+ __field(int, bytes)
),
TP_fast_assign(
@@ -2383,10 +2428,10 @@ DECLARE_EVENT_CLASS(f2fs__rw_start,
),
TP_printk("entry_name %s, offset %llu, bytes %d, cmdline %s,"
- " pid %d, i_size %llu, ino %lu",
+ " pid %d, i_size %llu, ino %llu",
__get_str(pathbuf), __entry->offset, __entry->bytes,
__get_str(cmdline), __entry->pid, __entry->i_size,
- (unsigned long) __entry->ino)
+ __entry->ino)
);
DECLARE_EVENT_CLASS(f2fs__rw_end,
@@ -2396,7 +2441,7 @@ DECLARE_EVENT_CLASS(f2fs__rw_end,
TP_ARGS(inode, offset, bytes),
TP_STRUCT__entry(
- __field(ino_t, ino)
+ __field(u64, ino)
__field(loff_t, offset)
__field(int, bytes)
),
@@ -2407,8 +2452,8 @@ DECLARE_EVENT_CLASS(f2fs__rw_end,
__entry->bytes = bytes;
),
- TP_printk("ino %lu, offset %llu, bytes %d",
- (unsigned long) __entry->ino,
+ TP_printk("ino %llu, offset %llu, bytes %d",
+ __entry->ino,
__entry->offset, __entry->bytes)
);
@@ -2442,6 +2487,155 @@ DEFINE_EVENT(f2fs__rw_end, f2fs_datawrite_end,
TP_ARGS(inode, offset, bytes)
);
+TRACE_EVENT(f2fs_lock_elapsed_time,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int ioprio,
+ unsigned long long total_time,
+ unsigned long long running_time,
+ unsigned long long runnable_time,
+ unsigned long long io_sleep_time,
+ unsigned long long other_time),
+
+ TP_ARGS(sbi, lock_name, is_write, p, ioprio, total_time, running_time,
+ runnable_time, io_sleep_time, other_time),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __array(char, comm, TASK_COMM_LEN)
+ __field(pid_t, pid)
+ __field(int, prio)
+ __field(int, ioprio_class)
+ __field(int, ioprio_data)
+ __field(unsigned int, lock_name)
+ __field(bool, is_write)
+ __field(unsigned long long, total_time)
+ __field(unsigned long long, running_time)
+ __field(unsigned long long, runnable_time)
+ __field(unsigned long long, io_sleep_time)
+ __field(unsigned long long, other_time)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = sbi->sb->s_dev;
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ __entry->ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
+ __entry->ioprio_data = IOPRIO_PRIO_DATA(ioprio);
+ __entry->lock_name = lock_name;
+ __entry->is_write = is_write;
+ __entry->total_time = total_time;
+ __entry->running_time = running_time;
+ __entry->runnable_time = runnable_time;
+ __entry->io_sleep_time = io_sleep_time;
+ __entry->other_time = other_time;
+ ),
+
+ TP_printk("dev = (%d,%d), comm: %s, pid: %d, prio: %d, "
+ "ioprio_class: %d, ioprio_data: %d, lock_name: %s, "
+ "lock_type: %s, total: %llu, running: %llu, "
+ "runnable: %llu, io_sleep: %llu, other: %llu",
+ show_dev(__entry->dev),
+ __entry->comm,
+ __entry->pid,
+ __entry->prio,
+ __entry->ioprio_class,
+ __entry->ioprio_data,
+ show_lock_name(__entry->lock_name),
+ __entry->is_write ? "wlock" : "rlock",
+ __entry->total_time,
+ __entry->running_time,
+ __entry->runnable_time,
+ __entry->io_sleep_time,
+ __entry->other_time)
+);
+
+DECLARE_EVENT_CLASS(f2fs_priority_update,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int orig_prio,
+ int new_prio),
+
+ TP_ARGS(sbi, lock_name, is_write, p, orig_prio, new_prio),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __array(char, comm, TASK_COMM_LEN)
+ __field(pid_t, pid)
+ __field(unsigned int, lock_name)
+ __field(bool, is_write)
+ __field(int, orig_prio)
+ __field(int, new_prio)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = sbi->sb->s_dev;
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->lock_name = lock_name;
+ __entry->is_write = is_write;
+ __entry->orig_prio = orig_prio;
+ __entry->new_prio = new_prio;
+ ),
+
+ TP_printk("dev = (%d,%d), comm: %s, pid: %d, lock_name: %s, "
+ "lock_type: %s, orig_prio: %d, new_prio: %d",
+ show_dev(__entry->dev),
+ __entry->comm,
+ __entry->pid,
+ show_lock_name(__entry->lock_name),
+ __entry->is_write ? "wlock" : "rlock",
+ __entry->orig_prio,
+ __entry->new_prio)
+);
+
+DEFINE_EVENT(f2fs_priority_update, f2fs_priority_uplift,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int orig_prio,
+ int new_prio),
+
+ TP_ARGS(sbi, lock_name, is_write, p, orig_prio, new_prio)
+);
+
+DEFINE_EVENT(f2fs_priority_update, f2fs_priority_restore,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int orig_prio,
+ int new_prio),
+
+ TP_ARGS(sbi, lock_name, is_write, p, orig_prio, new_prio)
+);
+
+TRACE_EVENT(f2fs_fault_report,
+
+ TP_PROTO(struct super_block *sb, unsigned int err_code,
+ const char *func, unsigned int data),
+
+ TP_ARGS(sb, err_code, func, data),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __field(unsigned int, err_code)
+ __string(func, func)
+ __field(unsigned int, data)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = sb->s_dev;
+ __entry->err_code = err_code;
+ __assign_str(func);
+ __entry->data = data;
+ ),
+
+ TP_printk("dev = (%d,%d), err_code = %u, func = %s, data = %u",
+ show_dev(__entry->dev),
+ __entry->err_code,
+ __get_str(func),
+ __entry->data)
+);
+
#endif /* _TRACE_F2FS_H */
/* This part must be outside protection */