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 super_block
*sb
, struct zonefs_zone
*z
,
29 __field(enum req_op
, op
)
30 __field(sector_t
, sector
)
31 __field(sector_t
, nr_sectors
)
34 __entry
->dev
= sb
->s_dev
;
36 z
->z_sector
>> ZONEFS_SB(sb
)->s_zone_sectors_shift
;
38 __entry
->sector
= z
->z_sector
;
39 __entry
->nr_sectors
= z
->z_size
>> SECTOR_SHIFT
;
41 TP_printk("bdev=(%d,%d), ino=%lu op=%s, sector=%llu, nr_sectors=%llu",
42 show_dev(__entry
->dev
), (unsigned long)__entry
->ino
,
43 blk_op_str(__entry
->op
), __entry
->sector
,
48 TRACE_EVENT(zonefs_file_dio_append
,
49 TP_PROTO(struct inode
*inode
, ssize_t size
, ssize_t ret
),
50 TP_ARGS(inode
, size
, ret
),
54 __field(sector_t
, sector
)
55 __field(ssize_t
, size
)
56 __field(loff_t
, wpoffset
)
60 __entry
->dev
= inode
->i_sb
->s_dev
;
61 __entry
->ino
= inode
->i_ino
;
62 __entry
->sector
= zonefs_inode_zone(inode
)->z_sector
;
65 zonefs_inode_zone(inode
)->z_wpoffset
;
68 TP_printk("bdev=(%d, %d), ino=%lu, sector=%llu, size=%zu, wpoffset=%llu, ret=%zu",
69 show_dev(__entry
->dev
), (unsigned long)__entry
->ino
,
70 __entry
->sector
, __entry
->size
, __entry
->wpoffset
,
75 TRACE_EVENT(zonefs_iomap_begin
,
76 TP_PROTO(struct inode
*inode
, struct iomap
*iomap
),
77 TP_ARGS(inode
, iomap
),
82 __field(loff_t
, offset
)
86 __entry
->dev
= inode
->i_sb
->s_dev
;
87 __entry
->ino
= inode
->i_ino
;
88 __entry
->addr
= iomap
->addr
;
89 __entry
->offset
= iomap
->offset
;
90 __entry
->length
= iomap
->length
;
92 TP_printk("bdev=(%d,%d), ino=%lu, addr=%llu, offset=%llu, length=%llu",
93 show_dev(__entry
->dev
), (unsigned long)__entry
->ino
,
94 __entry
->addr
, __entry
->offset
, __entry
->length
98 #endif /* _TRACE_ZONEFS_H */
100 #undef TRACE_INCLUDE_PATH
101 #define TRACE_INCLUDE_PATH .
102 #undef TRACE_INCLUDE_FILE
103 #define TRACE_INCLUDE_FILE trace
105 /* This part must be outside protection */
106 #include <trace/define_trace.h>