1 /* SPDX-License-Identifier: GPL-2.0 */
3 * zonefs filesystem driver tracepoints.
5 * Copyright (C) 2021 Western Digital Corporation or its affiliates.
9 #define TRACE_SYSTEM zonefs
11 #if !defined(_TRACE_ZONEFS_H) || defined(TRACE_HEADER_MULTI_READ)
12 #define _TRACE_ZONEFS_H
14 #include <linux/tracepoint.h>
15 #include <linux/trace_seq.h>
16 #include <linux/blkdev.h>
20 #define show_dev(dev) MAJOR(dev), MINOR(dev)
22 TRACE_EVENT(zonefs_zone_mgmt,
23 TP_PROTO(struct inode *inode, enum req_op op),
28 __field(enum req_op, op)
29 __field(sector_t, sector)
30 __field(sector_t, nr_sectors)
33 __entry->dev = inode->i_sb->s_dev;
34 __entry->ino = inode->i_ino;
36 __entry->sector = ZONEFS_I(inode)->i_zsector;
38 ZONEFS_I(inode)->i_zone_size >> SECTOR_SHIFT;
40 TP_printk("bdev=(%d,%d), ino=%lu op=%s, sector=%llu, nr_sectors=%llu",
41 show_dev(__entry->dev), (unsigned long)__entry->ino,
42 blk_op_str(__entry->op), __entry->sector,
47 TRACE_EVENT(zonefs_file_dio_append,
48 TP_PROTO(struct inode *inode, ssize_t size, ssize_t ret),
49 TP_ARGS(inode, size, ret),
53 __field(sector_t, sector)
54 __field(ssize_t, size)
55 __field(loff_t, wpoffset)
59 __entry->dev = inode->i_sb->s_dev;
60 __entry->ino = inode->i_ino;
61 __entry->sector = ZONEFS_I(inode)->i_zsector;
63 __entry->wpoffset = ZONEFS_I(inode)->i_wpoffset;
66 TP_printk("bdev=(%d, %d), ino=%lu, sector=%llu, size=%zu, wpoffset=%llu, ret=%zu",
67 show_dev(__entry->dev), (unsigned long)__entry->ino,
68 __entry->sector, __entry->size, __entry->wpoffset,
73 TRACE_EVENT(zonefs_iomap_begin,
74 TP_PROTO(struct inode *inode, struct iomap *iomap),
75 TP_ARGS(inode, iomap),
80 __field(loff_t, offset)
84 __entry->dev = inode->i_sb->s_dev;
85 __entry->ino = inode->i_ino;
86 __entry->addr = iomap->addr;
87 __entry->offset = iomap->offset;
88 __entry->length = iomap->length;
90 TP_printk("bdev=(%d,%d), ino=%lu, addr=%llu, offset=%llu, length=%llu",
91 show_dev(__entry->dev), (unsigned long)__entry->ino,
92 __entry->addr, __entry->offset, __entry->length
96 #endif /* _TRACE_ZONEFS_H */
98 #undef TRACE_INCLUDE_PATH
99 #define TRACE_INCLUDE_PATH .
100 #undef TRACE_INCLUDE_FILE
101 #define TRACE_INCLUDE_FILE trace
103 /* This part must be outside protection */
104 #include <trace/define_trace.h>