Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM f2fs |
| 4 | |
| 5 | #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_F2FS_H |
| 7 | |
| 8 | #include <linux/tracepoint.h> |
Chao Yu | fa4320c | 2020-11-02 14:21:31 +0800 | [diff] [blame] | 9 | #include <uapi/linux/f2fs.h> |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 10 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 11 | #define show_dev(dev) MAJOR(dev), MINOR(dev) |
| 12 | #define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 13 | |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 14 | TRACE_DEFINE_ENUM(NODE); |
| 15 | TRACE_DEFINE_ENUM(DATA); |
| 16 | TRACE_DEFINE_ENUM(META); |
| 17 | TRACE_DEFINE_ENUM(META_FLUSH); |
Jaegeuk Kim | 5d79988 | 2015-04-22 16:07:38 -0700 | [diff] [blame] | 18 | TRACE_DEFINE_ENUM(INMEM); |
| 19 | TRACE_DEFINE_ENUM(INMEM_DROP); |
Jaegeuk Kim | 8c242db | 2017-03-17 09:55:52 +0800 | [diff] [blame] | 20 | TRACE_DEFINE_ENUM(INMEM_INVALIDATE); |
Chao Yu | a58f244 | 2017-03-17 18:46:14 +0800 | [diff] [blame] | 21 | TRACE_DEFINE_ENUM(INMEM_REVOKE); |
Jaegeuk Kim | 5d79988 | 2015-04-22 16:07:38 -0700 | [diff] [blame] | 22 | TRACE_DEFINE_ENUM(IPU); |
| 23 | TRACE_DEFINE_ENUM(OPU); |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 24 | TRACE_DEFINE_ENUM(HOT); |
| 25 | TRACE_DEFINE_ENUM(WARM); |
| 26 | TRACE_DEFINE_ENUM(COLD); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 27 | TRACE_DEFINE_ENUM(CURSEG_HOT_DATA); |
| 28 | TRACE_DEFINE_ENUM(CURSEG_WARM_DATA); |
| 29 | TRACE_DEFINE_ENUM(CURSEG_COLD_DATA); |
| 30 | TRACE_DEFINE_ENUM(CURSEG_HOT_NODE); |
| 31 | TRACE_DEFINE_ENUM(CURSEG_WARM_NODE); |
| 32 | TRACE_DEFINE_ENUM(CURSEG_COLD_NODE); |
| 33 | TRACE_DEFINE_ENUM(NO_CHECK_TYPE); |
| 34 | TRACE_DEFINE_ENUM(GC_GREEDY); |
| 35 | TRACE_DEFINE_ENUM(GC_CB); |
| 36 | TRACE_DEFINE_ENUM(FG_GC); |
| 37 | TRACE_DEFINE_ENUM(BG_GC); |
| 38 | TRACE_DEFINE_ENUM(LFS); |
| 39 | TRACE_DEFINE_ENUM(SSR); |
| 40 | TRACE_DEFINE_ENUM(__REQ_RAHEAD); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 41 | TRACE_DEFINE_ENUM(__REQ_SYNC); |
Christoph Hellwig | a2b8096 | 2016-11-01 07:40:09 -0600 | [diff] [blame] | 42 | TRACE_DEFINE_ENUM(__REQ_IDLE); |
Mike Christie | 28a8f0d | 2016-06-05 14:32:25 -0500 | [diff] [blame] | 43 | TRACE_DEFINE_ENUM(__REQ_PREFLUSH); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 44 | TRACE_DEFINE_ENUM(__REQ_FUA); |
| 45 | TRACE_DEFINE_ENUM(__REQ_PRIO); |
| 46 | TRACE_DEFINE_ENUM(__REQ_META); |
| 47 | TRACE_DEFINE_ENUM(CP_UMOUNT); |
| 48 | TRACE_DEFINE_ENUM(CP_FASTBOOT); |
| 49 | TRACE_DEFINE_ENUM(CP_SYNC); |
Jaegeuk Kim | 5d79988 | 2015-04-22 16:07:38 -0700 | [diff] [blame] | 50 | TRACE_DEFINE_ENUM(CP_RECOVERY); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 51 | TRACE_DEFINE_ENUM(CP_DISCARD); |
Chao Yu | 1f43e2a | 2017-04-28 13:56:08 +0800 | [diff] [blame] | 52 | TRACE_DEFINE_ENUM(CP_TRIMMED); |
Sahitya Tummala | fad5fbc | 2020-01-03 08:49:28 +0530 | [diff] [blame] | 53 | TRACE_DEFINE_ENUM(CP_PAUSE); |
Jaegeuk Kim | b4b1006 | 2020-03-31 11:43:07 -0700 | [diff] [blame] | 54 | TRACE_DEFINE_ENUM(CP_RESIZE); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 55 | |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 56 | #define show_block_type(type) \ |
| 57 | __print_symbolic(type, \ |
| 58 | { NODE, "NODE" }, \ |
| 59 | { DATA, "DATA" }, \ |
| 60 | { META, "META" }, \ |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 61 | { META_FLUSH, "META_FLUSH" }, \ |
| 62 | { INMEM, "INMEM" }, \ |
| 63 | { INMEM_DROP, "INMEM_DROP" }, \ |
Jaegeuk Kim | 8c242db | 2017-03-17 09:55:52 +0800 | [diff] [blame] | 64 | { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \ |
Chao Yu | 28bc106 | 2016-02-06 14:40:34 +0800 | [diff] [blame] | 65 | { INMEM_REVOKE, "INMEM_REVOKE" }, \ |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 66 | { IPU, "IN-PLACE" }, \ |
| 67 | { OPU, "OUT-OF-PLACE" }) |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 68 | |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 69 | #define show_block_temp(temp) \ |
| 70 | __print_symbolic(temp, \ |
| 71 | { HOT, "HOT" }, \ |
| 72 | { WARM, "WARM" }, \ |
| 73 | { COLD, "COLD" }) |
| 74 | |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 75 | #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \ |
| 76 | REQ_PREFLUSH | REQ_FUA) |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 77 | #define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS) |
Jaegeuk Kim | a709f4a | 2013-11-24 14:42:23 +0900 | [diff] [blame] | 78 | |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 79 | #define show_bio_type(op,op_flags) show_bio_op(op), \ |
| 80 | show_bio_op_flags(op_flags) |
| 81 | |
Chaitanya Kulkarni | 0ce3537 | 2019-06-20 10:59:19 -0700 | [diff] [blame] | 82 | #define show_bio_op(op) blk_op_str(op) |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 83 | |
| 84 | #define show_bio_op_flags(flags) \ |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 85 | __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \ |
| 86 | { REQ_RAHEAD, "R" }, \ |
| 87 | { REQ_SYNC, "S" }, \ |
| 88 | { REQ_META, "M" }, \ |
| 89 | { REQ_PRIO, "P" }, \ |
| 90 | { REQ_PREFLUSH, "PF" }, \ |
| 91 | { REQ_FUA, "FUA" }) |
Jaegeuk Kim | a709f4a | 2013-11-24 14:42:23 +0900 | [diff] [blame] | 92 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 93 | #define show_data_type(type) \ |
| 94 | __print_symbolic(type, \ |
| 95 | { CURSEG_HOT_DATA, "Hot DATA" }, \ |
| 96 | { CURSEG_WARM_DATA, "Warm DATA" }, \ |
| 97 | { CURSEG_COLD_DATA, "Cold DATA" }, \ |
| 98 | { CURSEG_HOT_NODE, "Hot NODE" }, \ |
| 99 | { CURSEG_WARM_NODE, "Warm NODE" }, \ |
| 100 | { CURSEG_COLD_NODE, "Cold NODE" }, \ |
| 101 | { NO_CHECK_TYPE, "No TYPE" }) |
| 102 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 103 | #define show_file_type(type) \ |
| 104 | __print_symbolic(type, \ |
| 105 | { 0, "FILE" }, \ |
| 106 | { 1, "DIR" }) |
| 107 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 108 | #define show_gc_type(type) \ |
| 109 | __print_symbolic(type, \ |
| 110 | { FG_GC, "Foreground GC" }, \ |
| 111 | { BG_GC, "Background GC" }) |
| 112 | |
| 113 | #define show_alloc_mode(type) \ |
| 114 | __print_symbolic(type, \ |
Chao Yu | 093749e | 2020-08-04 21:14:49 +0800 | [diff] [blame] | 115 | { LFS, "LFS-mode" }, \ |
| 116 | { SSR, "SSR-mode" }, \ |
| 117 | { AT_SSR, "AT_SSR-mode" }) |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 118 | |
| 119 | #define show_victim_policy(type) \ |
| 120 | __print_symbolic(type, \ |
| 121 | { GC_GREEDY, "Greedy" }, \ |
Chao Yu | 093749e | 2020-08-04 21:14:49 +0800 | [diff] [blame] | 122 | { GC_CB, "Cost-Benefit" }, \ |
| 123 | { GC_AT, "Age-threshold" }) |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 124 | |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 125 | #define show_cpreason(type) \ |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 126 | __print_flags(type, "|", \ |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 127 | { CP_UMOUNT, "Umount" }, \ |
Jaegeuk Kim | 119ee91 | 2015-01-29 11:45:33 -0800 | [diff] [blame] | 128 | { CP_FASTBOOT, "Fastboot" }, \ |
Jaegeuk Kim | 4b2fecc | 2014-09-20 22:06:39 -0700 | [diff] [blame] | 129 | { CP_SYNC, "Sync" }, \ |
Jaegeuk Kim | 1002755 | 2015-04-09 17:03:53 -0700 | [diff] [blame] | 130 | { CP_RECOVERY, "Recovery" }, \ |
Chao Yu | 1f43e2a | 2017-04-28 13:56:08 +0800 | [diff] [blame] | 131 | { CP_DISCARD, "Discard" }, \ |
Sahitya Tummala | fad5fbc | 2020-01-03 08:49:28 +0530 | [diff] [blame] | 132 | { CP_PAUSE, "Pause" }, \ |
Jaegeuk Kim | b4b1006 | 2020-03-31 11:43:07 -0700 | [diff] [blame] | 133 | { CP_TRIMMED, "Trimmed" }, \ |
| 134 | { CP_RESIZE, "Resize" }) |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 135 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 136 | #define show_fsync_cpreason(type) \ |
| 137 | __print_symbolic(type, \ |
| 138 | { CP_NO_NEEDED, "no needed" }, \ |
| 139 | { CP_NON_REGULAR, "non regular" }, \ |
Chao Yu | 32c0fec | 2020-09-03 10:15:15 +0800 | [diff] [blame] | 140 | { CP_COMPRESSED, "compressed" }, \ |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 141 | { CP_HARDLINK, "hardlink" }, \ |
| 142 | { CP_SB_NEED_CP, "sb needs cp" }, \ |
| 143 | { CP_WRONG_PINO, "wrong pino" }, \ |
| 144 | { CP_NO_SPC_ROLL, "no space roll forward" }, \ |
| 145 | { CP_NODE_NEED_CP, "node needs cp" }, \ |
| 146 | { CP_FASTBOOT_MODE, "fastboot mode" }, \ |
Jaegeuk Kim | 0a007b97 | 2017-12-28 08:09:44 -0800 | [diff] [blame] | 147 | { CP_SPEC_LOG_NUM, "log type is 2" }, \ |
| 148 | { CP_RECOVER_DIR, "dir needs recovery" }) |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 149 | |
Chao Yu | 559e87c | 2019-02-26 19:01:15 +0800 | [diff] [blame] | 150 | #define show_shutdown_mode(type) \ |
| 151 | __print_symbolic(type, \ |
| 152 | { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \ |
| 153 | { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \ |
| 154 | { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \ |
| 155 | { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \ |
| 156 | { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" }) |
| 157 | |
Chao Yu | 4c8ff70 | 2019-11-01 18:07:14 +0800 | [diff] [blame] | 158 | #define show_compress_algorithm(type) \ |
| 159 | __print_symbolic(type, \ |
| 160 | { COMPRESS_LZO, "LZO" }, \ |
Chao Yu | 50cfa66 | 2020-03-03 17:46:02 +0800 | [diff] [blame] | 161 | { COMPRESS_LZ4, "LZ4" }, \ |
Chao Yu | 6d92b20 | 2020-04-08 19:56:32 +0800 | [diff] [blame] | 162 | { COMPRESS_ZSTD, "ZSTD" }, \ |
| 163 | { COMPRESS_LZORLE, "LZO-RLE" }) |
Chao Yu | 4c8ff70 | 2019-11-01 18:07:14 +0800 | [diff] [blame] | 164 | |
Zhikang Zhang | 539cd35 | 2019-01-03 20:06:38 +0800 | [diff] [blame] | 165 | struct f2fs_sb_info; |
| 166 | struct f2fs_io_info; |
| 167 | struct extent_info; |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 168 | struct victim_sel_policy; |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 169 | struct f2fs_map_blocks; |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 170 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 171 | DECLARE_EVENT_CLASS(f2fs__inode, |
| 172 | |
| 173 | TP_PROTO(struct inode *inode), |
| 174 | |
| 175 | TP_ARGS(inode), |
| 176 | |
| 177 | TP_STRUCT__entry( |
| 178 | __field(dev_t, dev) |
| 179 | __field(ino_t, ino) |
| 180 | __field(ino_t, pino) |
| 181 | __field(umode_t, mode) |
| 182 | __field(loff_t, size) |
| 183 | __field(unsigned int, nlink) |
| 184 | __field(blkcnt_t, blocks) |
| 185 | __field(__u8, advise) |
| 186 | ), |
| 187 | |
| 188 | TP_fast_assign( |
| 189 | __entry->dev = inode->i_sb->s_dev; |
| 190 | __entry->ino = inode->i_ino; |
| 191 | __entry->pino = F2FS_I(inode)->i_pino; |
| 192 | __entry->mode = inode->i_mode; |
| 193 | __entry->nlink = inode->i_nlink; |
| 194 | __entry->size = inode->i_size; |
| 195 | __entry->blocks = inode->i_blocks; |
| 196 | __entry->advise = F2FS_I(inode)->i_advise; |
| 197 | ), |
| 198 | |
| 199 | TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, " |
| 200 | "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x", |
| 201 | show_dev_ino(__entry), |
| 202 | (unsigned long)__entry->pino, |
| 203 | __entry->mode, |
| 204 | __entry->size, |
| 205 | (unsigned int)__entry->nlink, |
| 206 | (unsigned long long)__entry->blocks, |
| 207 | (unsigned char)__entry->advise) |
| 208 | ); |
| 209 | |
| 210 | DECLARE_EVENT_CLASS(f2fs__inode_exit, |
| 211 | |
| 212 | TP_PROTO(struct inode *inode, int ret), |
| 213 | |
| 214 | TP_ARGS(inode, ret), |
| 215 | |
| 216 | TP_STRUCT__entry( |
| 217 | __field(dev_t, dev) |
| 218 | __field(ino_t, ino) |
| 219 | __field(int, ret) |
| 220 | ), |
| 221 | |
| 222 | TP_fast_assign( |
| 223 | __entry->dev = inode->i_sb->s_dev; |
| 224 | __entry->ino = inode->i_ino; |
| 225 | __entry->ret = ret; |
| 226 | ), |
| 227 | |
| 228 | TP_printk("dev = (%d,%d), ino = %lu, ret = %d", |
| 229 | show_dev_ino(__entry), |
| 230 | __entry->ret) |
| 231 | ); |
| 232 | |
| 233 | DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter, |
| 234 | |
| 235 | TP_PROTO(struct inode *inode), |
| 236 | |
| 237 | TP_ARGS(inode) |
| 238 | ); |
| 239 | |
| 240 | TRACE_EVENT(f2fs_sync_file_exit, |
| 241 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 242 | TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 243 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 244 | TP_ARGS(inode, cp_reason, datasync, ret), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 245 | |
| 246 | TP_STRUCT__entry( |
| 247 | __field(dev_t, dev) |
| 248 | __field(ino_t, ino) |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 249 | __field(int, cp_reason) |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 250 | __field(int, datasync) |
| 251 | __field(int, ret) |
| 252 | ), |
| 253 | |
| 254 | TP_fast_assign( |
| 255 | __entry->dev = inode->i_sb->s_dev; |
| 256 | __entry->ino = inode->i_ino; |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 257 | __entry->cp_reason = cp_reason; |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 258 | __entry->datasync = datasync; |
| 259 | __entry->ret = ret; |
| 260 | ), |
| 261 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 262 | TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, " |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 263 | "datasync = %d, ret = %d", |
| 264 | show_dev_ino(__entry), |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame] | 265 | show_fsync_cpreason(__entry->cp_reason), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 266 | __entry->datasync, |
| 267 | __entry->ret) |
| 268 | ); |
| 269 | |
| 270 | TRACE_EVENT(f2fs_sync_fs, |
| 271 | |
| 272 | TP_PROTO(struct super_block *sb, int wait), |
| 273 | |
| 274 | TP_ARGS(sb, wait), |
| 275 | |
| 276 | TP_STRUCT__entry( |
| 277 | __field(dev_t, dev) |
Jaegeuk Kim | 29e7043 | 2015-02-10 16:23:12 -0800 | [diff] [blame] | 278 | __field(int, dirty) |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 279 | __field(int, wait) |
| 280 | ), |
| 281 | |
| 282 | TP_fast_assign( |
| 283 | __entry->dev = sb->s_dev; |
Chao Yu | caf0047 | 2015-01-28 17:48:42 +0800 | [diff] [blame] | 284 | __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY); |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 285 | __entry->wait = wait; |
| 286 | ), |
| 287 | |
| 288 | TP_printk("dev = (%d,%d), superblock is %s, wait = %d", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 289 | show_dev(__entry->dev), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 290 | __entry->dirty ? "dirty" : "not dirty", |
| 291 | __entry->wait) |
| 292 | ); |
| 293 | |
| 294 | DEFINE_EVENT(f2fs__inode, f2fs_iget, |
| 295 | |
| 296 | TP_PROTO(struct inode *inode), |
| 297 | |
| 298 | TP_ARGS(inode) |
| 299 | ); |
| 300 | |
| 301 | DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit, |
| 302 | |
| 303 | TP_PROTO(struct inode *inode, int ret), |
| 304 | |
| 305 | TP_ARGS(inode, ret) |
| 306 | ); |
| 307 | |
| 308 | DEFINE_EVENT(f2fs__inode, f2fs_evict_inode, |
| 309 | |
| 310 | TP_PROTO(struct inode *inode), |
| 311 | |
| 312 | TP_ARGS(inode) |
| 313 | ); |
| 314 | |
Jaegeuk Kim | d70b4f5 | 2013-04-25 13:24:33 +0900 | [diff] [blame] | 315 | DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode, |
| 316 | |
| 317 | TP_PROTO(struct inode *inode, int ret), |
| 318 | |
| 319 | TP_ARGS(inode, ret) |
| 320 | ); |
| 321 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 322 | TRACE_EVENT(f2fs_unlink_enter, |
| 323 | |
| 324 | TP_PROTO(struct inode *dir, struct dentry *dentry), |
| 325 | |
| 326 | TP_ARGS(dir, dentry), |
| 327 | |
| 328 | TP_STRUCT__entry( |
| 329 | __field(dev_t, dev) |
| 330 | __field(ino_t, ino) |
| 331 | __field(loff_t, size) |
| 332 | __field(blkcnt_t, blocks) |
| 333 | __field(const char *, name) |
| 334 | ), |
| 335 | |
| 336 | TP_fast_assign( |
| 337 | __entry->dev = dir->i_sb->s_dev; |
| 338 | __entry->ino = dir->i_ino; |
| 339 | __entry->size = dir->i_size; |
| 340 | __entry->blocks = dir->i_blocks; |
| 341 | __entry->name = dentry->d_name.name; |
| 342 | ), |
| 343 | |
| 344 | TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, " |
| 345 | "i_blocks = %llu, name = %s", |
| 346 | show_dev_ino(__entry), |
| 347 | __entry->size, |
| 348 | (unsigned long long)__entry->blocks, |
| 349 | __entry->name) |
| 350 | ); |
| 351 | |
| 352 | DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit, |
| 353 | |
| 354 | TP_PROTO(struct inode *inode, int ret), |
| 355 | |
| 356 | TP_ARGS(inode, ret) |
| 357 | ); |
Namjae Jeon | 51dd624 | 2013-04-20 01:28:52 +0900 | [diff] [blame] | 358 | |
Hou Pengyang | b8d96a3 | 2017-02-27 13:02:58 +0000 | [diff] [blame] | 359 | DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode, |
| 360 | |
| 361 | TP_PROTO(struct inode *inode, int ret), |
| 362 | |
| 363 | TP_ARGS(inode, ret) |
| 364 | ); |
| 365 | |
Namjae Jeon | 51dd624 | 2013-04-20 01:28:52 +0900 | [diff] [blame] | 366 | DEFINE_EVENT(f2fs__inode, f2fs_truncate, |
| 367 | |
| 368 | TP_PROTO(struct inode *inode), |
| 369 | |
| 370 | TP_ARGS(inode) |
| 371 | ); |
| 372 | |
| 373 | TRACE_EVENT(f2fs_truncate_data_blocks_range, |
| 374 | |
| 375 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free), |
| 376 | |
| 377 | TP_ARGS(inode, nid, ofs, free), |
| 378 | |
| 379 | TP_STRUCT__entry( |
| 380 | __field(dev_t, dev) |
| 381 | __field(ino_t, ino) |
| 382 | __field(nid_t, nid) |
| 383 | __field(unsigned int, ofs) |
| 384 | __field(int, free) |
| 385 | ), |
| 386 | |
| 387 | TP_fast_assign( |
| 388 | __entry->dev = inode->i_sb->s_dev; |
| 389 | __entry->ino = inode->i_ino; |
| 390 | __entry->nid = nid; |
| 391 | __entry->ofs = ofs; |
| 392 | __entry->free = free; |
| 393 | ), |
| 394 | |
| 395 | TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d", |
| 396 | show_dev_ino(__entry), |
| 397 | (unsigned int)__entry->nid, |
| 398 | __entry->ofs, |
| 399 | __entry->free) |
| 400 | ); |
| 401 | |
| 402 | DECLARE_EVENT_CLASS(f2fs__truncate_op, |
| 403 | |
| 404 | TP_PROTO(struct inode *inode, u64 from), |
| 405 | |
| 406 | TP_ARGS(inode, from), |
| 407 | |
| 408 | TP_STRUCT__entry( |
| 409 | __field(dev_t, dev) |
| 410 | __field(ino_t, ino) |
| 411 | __field(loff_t, size) |
| 412 | __field(blkcnt_t, blocks) |
| 413 | __field(u64, from) |
| 414 | ), |
| 415 | |
| 416 | TP_fast_assign( |
| 417 | __entry->dev = inode->i_sb->s_dev; |
| 418 | __entry->ino = inode->i_ino; |
| 419 | __entry->size = inode->i_size; |
| 420 | __entry->blocks = inode->i_blocks; |
| 421 | __entry->from = from; |
| 422 | ), |
| 423 | |
| 424 | TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, " |
| 425 | "start file offset = %llu", |
| 426 | show_dev_ino(__entry), |
| 427 | __entry->size, |
| 428 | (unsigned long long)__entry->blocks, |
| 429 | (unsigned long long)__entry->from) |
| 430 | ); |
| 431 | |
| 432 | DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter, |
| 433 | |
| 434 | TP_PROTO(struct inode *inode, u64 from), |
| 435 | |
| 436 | TP_ARGS(inode, from) |
| 437 | ); |
| 438 | |
| 439 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit, |
| 440 | |
| 441 | TP_PROTO(struct inode *inode, int ret), |
| 442 | |
| 443 | TP_ARGS(inode, ret) |
| 444 | ); |
| 445 | |
| 446 | DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter, |
| 447 | |
| 448 | TP_PROTO(struct inode *inode, u64 from), |
| 449 | |
| 450 | TP_ARGS(inode, from) |
| 451 | ); |
| 452 | |
| 453 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit, |
| 454 | |
| 455 | TP_PROTO(struct inode *inode, int ret), |
| 456 | |
| 457 | TP_ARGS(inode, ret) |
| 458 | ); |
| 459 | |
| 460 | DECLARE_EVENT_CLASS(f2fs__truncate_node, |
| 461 | |
| 462 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 463 | |
| 464 | TP_ARGS(inode, nid, blk_addr), |
| 465 | |
| 466 | TP_STRUCT__entry( |
| 467 | __field(dev_t, dev) |
| 468 | __field(ino_t, ino) |
| 469 | __field(nid_t, nid) |
| 470 | __field(block_t, blk_addr) |
| 471 | ), |
| 472 | |
| 473 | TP_fast_assign( |
| 474 | __entry->dev = inode->i_sb->s_dev; |
| 475 | __entry->ino = inode->i_ino; |
| 476 | __entry->nid = nid; |
| 477 | __entry->blk_addr = blk_addr; |
| 478 | ), |
| 479 | |
| 480 | TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx", |
| 481 | show_dev_ino(__entry), |
| 482 | (unsigned int)__entry->nid, |
| 483 | (unsigned long long)__entry->blk_addr) |
| 484 | ); |
| 485 | |
| 486 | DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter, |
| 487 | |
| 488 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 489 | |
| 490 | TP_ARGS(inode, nid, blk_addr) |
| 491 | ); |
| 492 | |
| 493 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit, |
| 494 | |
| 495 | TP_PROTO(struct inode *inode, int ret), |
| 496 | |
| 497 | TP_ARGS(inode, ret) |
| 498 | ); |
| 499 | |
| 500 | DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node, |
| 501 | |
| 502 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 503 | |
| 504 | TP_ARGS(inode, nid, blk_addr) |
| 505 | ); |
| 506 | |
| 507 | TRACE_EVENT(f2fs_truncate_partial_nodes, |
| 508 | |
Alexei Starovoitov | c105547 | 2018-03-28 12:05:32 -0700 | [diff] [blame] | 509 | TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err), |
Namjae Jeon | 51dd624 | 2013-04-20 01:28:52 +0900 | [diff] [blame] | 510 | |
| 511 | TP_ARGS(inode, nid, depth, err), |
| 512 | |
| 513 | TP_STRUCT__entry( |
| 514 | __field(dev_t, dev) |
| 515 | __field(ino_t, ino) |
| 516 | __field(nid_t, nid[3]) |
| 517 | __field(int, depth) |
| 518 | __field(int, err) |
| 519 | ), |
| 520 | |
| 521 | TP_fast_assign( |
| 522 | __entry->dev = inode->i_sb->s_dev; |
| 523 | __entry->ino = inode->i_ino; |
| 524 | __entry->nid[0] = nid[0]; |
| 525 | __entry->nid[1] = nid[1]; |
| 526 | __entry->nid[2] = nid[2]; |
| 527 | __entry->depth = depth; |
| 528 | __entry->err = err; |
| 529 | ), |
| 530 | |
| 531 | TP_printk("dev = (%d,%d), ino = %lu, " |
| 532 | "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d", |
| 533 | show_dev_ino(__entry), |
| 534 | (unsigned int)__entry->nid[0], |
| 535 | (unsigned int)__entry->nid[1], |
| 536 | (unsigned int)__entry->nid[2], |
| 537 | __entry->depth, |
| 538 | __entry->err) |
| 539 | ); |
| 540 | |
Chao Yu | 126ce72 | 2019-04-02 18:52:22 +0800 | [diff] [blame] | 541 | TRACE_EVENT(f2fs_file_write_iter, |
| 542 | |
| 543 | TP_PROTO(struct inode *inode, unsigned long offset, |
| 544 | unsigned long length, int ret), |
| 545 | |
| 546 | TP_ARGS(inode, offset, length, ret), |
| 547 | |
| 548 | TP_STRUCT__entry( |
| 549 | __field(dev_t, dev) |
| 550 | __field(ino_t, ino) |
| 551 | __field(unsigned long, offset) |
| 552 | __field(unsigned long, length) |
| 553 | __field(int, ret) |
| 554 | ), |
| 555 | |
| 556 | TP_fast_assign( |
| 557 | __entry->dev = inode->i_sb->s_dev; |
| 558 | __entry->ino = inode->i_ino; |
| 559 | __entry->offset = offset; |
| 560 | __entry->length = length; |
| 561 | __entry->ret = ret; |
| 562 | ), |
| 563 | |
| 564 | TP_printk("dev = (%d,%d), ino = %lu, " |
| 565 | "offset = %lu, length = %lu, written(err) = %d", |
| 566 | show_dev_ino(__entry), |
| 567 | __entry->offset, |
| 568 | __entry->length, |
| 569 | __entry->ret) |
| 570 | ); |
| 571 | |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 572 | TRACE_EVENT(f2fs_map_blocks, |
| 573 | TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret), |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 574 | |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 575 | TP_ARGS(inode, map, ret), |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 576 | |
| 577 | TP_STRUCT__entry( |
| 578 | __field(dev_t, dev) |
| 579 | __field(ino_t, ino) |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 580 | __field(block_t, m_lblk) |
| 581 | __field(block_t, m_pblk) |
| 582 | __field(unsigned int, m_len) |
Chao Yu | 76630f2 | 2019-02-26 19:01:16 +0800 | [diff] [blame] | 583 | __field(unsigned int, m_flags) |
| 584 | __field(int, m_seg_type) |
| 585 | __field(bool, m_may_create) |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 586 | __field(int, ret) |
| 587 | ), |
| 588 | |
| 589 | TP_fast_assign( |
| 590 | __entry->dev = inode->i_sb->s_dev; |
| 591 | __entry->ino = inode->i_ino; |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 592 | __entry->m_lblk = map->m_lblk; |
| 593 | __entry->m_pblk = map->m_pblk; |
| 594 | __entry->m_len = map->m_len; |
Chao Yu | 76630f2 | 2019-02-26 19:01:16 +0800 | [diff] [blame] | 595 | __entry->m_flags = map->m_flags; |
| 596 | __entry->m_seg_type = map->m_seg_type; |
| 597 | __entry->m_may_create = map->m_may_create; |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 598 | __entry->ret = ret; |
| 599 | ), |
| 600 | |
| 601 | TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, " |
Chao Yu | 76630f2 | 2019-02-26 19:01:16 +0800 | [diff] [blame] | 602 | "start blkaddr = 0x%llx, len = 0x%llx, flags = %u," |
| 603 | "seg_type = %d, may_create = %d, err = %d", |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 604 | show_dev_ino(__entry), |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 605 | (unsigned long long)__entry->m_lblk, |
| 606 | (unsigned long long)__entry->m_pblk, |
| 607 | (unsigned long long)__entry->m_len, |
Chao Yu | 76630f2 | 2019-02-26 19:01:16 +0800 | [diff] [blame] | 608 | __entry->m_flags, |
| 609 | __entry->m_seg_type, |
| 610 | __entry->m_may_create, |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 611 | __entry->ret) |
| 612 | ); |
| 613 | |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 614 | TRACE_EVENT(f2fs_background_gc, |
| 615 | |
Chao Yu | b8c502b | 2017-08-07 23:12:46 +0800 | [diff] [blame] | 616 | TP_PROTO(struct super_block *sb, unsigned int wait_ms, |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 617 | unsigned int prefree, unsigned int free), |
| 618 | |
| 619 | TP_ARGS(sb, wait_ms, prefree, free), |
| 620 | |
| 621 | TP_STRUCT__entry( |
| 622 | __field(dev_t, dev) |
Chao Yu | b8c502b | 2017-08-07 23:12:46 +0800 | [diff] [blame] | 623 | __field(unsigned int, wait_ms) |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 624 | __field(unsigned int, prefree) |
| 625 | __field(unsigned int, free) |
| 626 | ), |
| 627 | |
| 628 | TP_fast_assign( |
| 629 | __entry->dev = sb->s_dev; |
| 630 | __entry->wait_ms = wait_ms; |
| 631 | __entry->prefree = prefree; |
| 632 | __entry->free = free; |
| 633 | ), |
| 634 | |
Chao Yu | b8c502b | 2017-08-07 23:12:46 +0800 | [diff] [blame] | 635 | TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 636 | show_dev(__entry->dev), |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 637 | __entry->wait_ms, |
| 638 | __entry->prefree, |
| 639 | __entry->free) |
| 640 | ); |
| 641 | |
Chao Yu | c56f16d | 2017-08-11 18:00:15 +0800 | [diff] [blame] | 642 | TRACE_EVENT(f2fs_gc_begin, |
| 643 | |
| 644 | TP_PROTO(struct super_block *sb, bool sync, bool background, |
| 645 | long long dirty_nodes, long long dirty_dents, |
| 646 | long long dirty_imeta, unsigned int free_sec, |
| 647 | unsigned int free_seg, int reserved_seg, |
| 648 | unsigned int prefree_seg), |
| 649 | |
| 650 | TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta, |
| 651 | free_sec, free_seg, reserved_seg, prefree_seg), |
| 652 | |
| 653 | TP_STRUCT__entry( |
| 654 | __field(dev_t, dev) |
| 655 | __field(bool, sync) |
| 656 | __field(bool, background) |
| 657 | __field(long long, dirty_nodes) |
| 658 | __field(long long, dirty_dents) |
| 659 | __field(long long, dirty_imeta) |
| 660 | __field(unsigned int, free_sec) |
| 661 | __field(unsigned int, free_seg) |
| 662 | __field(int, reserved_seg) |
| 663 | __field(unsigned int, prefree_seg) |
| 664 | ), |
| 665 | |
| 666 | TP_fast_assign( |
| 667 | __entry->dev = sb->s_dev; |
| 668 | __entry->sync = sync; |
| 669 | __entry->background = background; |
| 670 | __entry->dirty_nodes = dirty_nodes; |
| 671 | __entry->dirty_dents = dirty_dents; |
| 672 | __entry->dirty_imeta = dirty_imeta; |
| 673 | __entry->free_sec = free_sec; |
| 674 | __entry->free_seg = free_seg; |
| 675 | __entry->reserved_seg = reserved_seg; |
| 676 | __entry->prefree_seg = prefree_seg; |
| 677 | ), |
| 678 | |
| 679 | TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, " |
| 680 | "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, " |
| 681 | "rsv_seg:%d, prefree_seg:%u", |
| 682 | show_dev(__entry->dev), |
| 683 | __entry->sync, |
| 684 | __entry->background, |
| 685 | __entry->dirty_nodes, |
| 686 | __entry->dirty_dents, |
| 687 | __entry->dirty_imeta, |
| 688 | __entry->free_sec, |
| 689 | __entry->free_seg, |
| 690 | __entry->reserved_seg, |
| 691 | __entry->prefree_seg) |
| 692 | ); |
| 693 | |
| 694 | TRACE_EVENT(f2fs_gc_end, |
| 695 | |
| 696 | TP_PROTO(struct super_block *sb, int ret, int seg_freed, |
| 697 | int sec_freed, long long dirty_nodes, |
| 698 | long long dirty_dents, long long dirty_imeta, |
| 699 | unsigned int free_sec, unsigned int free_seg, |
| 700 | int reserved_seg, unsigned int prefree_seg), |
| 701 | |
| 702 | TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents, |
| 703 | dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg), |
| 704 | |
| 705 | TP_STRUCT__entry( |
| 706 | __field(dev_t, dev) |
| 707 | __field(int, ret) |
| 708 | __field(int, seg_freed) |
| 709 | __field(int, sec_freed) |
| 710 | __field(long long, dirty_nodes) |
| 711 | __field(long long, dirty_dents) |
| 712 | __field(long long, dirty_imeta) |
| 713 | __field(unsigned int, free_sec) |
| 714 | __field(unsigned int, free_seg) |
| 715 | __field(int, reserved_seg) |
| 716 | __field(unsigned int, prefree_seg) |
| 717 | ), |
| 718 | |
| 719 | TP_fast_assign( |
| 720 | __entry->dev = sb->s_dev; |
| 721 | __entry->ret = ret; |
| 722 | __entry->seg_freed = seg_freed; |
| 723 | __entry->sec_freed = sec_freed; |
| 724 | __entry->dirty_nodes = dirty_nodes; |
| 725 | __entry->dirty_dents = dirty_dents; |
| 726 | __entry->dirty_imeta = dirty_imeta; |
| 727 | __entry->free_sec = free_sec; |
| 728 | __entry->free_seg = free_seg; |
| 729 | __entry->reserved_seg = reserved_seg; |
| 730 | __entry->prefree_seg = prefree_seg; |
| 731 | ), |
| 732 | |
| 733 | TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, " |
| 734 | "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, " |
| 735 | "free_seg:%u, rsv_seg:%d, prefree_seg:%u", |
| 736 | show_dev(__entry->dev), |
| 737 | __entry->ret, |
| 738 | __entry->seg_freed, |
| 739 | __entry->sec_freed, |
| 740 | __entry->dirty_nodes, |
| 741 | __entry->dirty_dents, |
| 742 | __entry->dirty_imeta, |
| 743 | __entry->free_sec, |
| 744 | __entry->free_seg, |
| 745 | __entry->reserved_seg, |
| 746 | __entry->prefree_seg) |
| 747 | ); |
| 748 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 749 | TRACE_EVENT(f2fs_get_victim, |
| 750 | |
| 751 | TP_PROTO(struct super_block *sb, int type, int gc_type, |
| 752 | struct victim_sel_policy *p, unsigned int pre_victim, |
| 753 | unsigned int prefree, unsigned int free), |
| 754 | |
| 755 | TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free), |
| 756 | |
| 757 | TP_STRUCT__entry( |
| 758 | __field(dev_t, dev) |
| 759 | __field(int, type) |
| 760 | __field(int, gc_type) |
| 761 | __field(int, alloc_mode) |
| 762 | __field(int, gc_mode) |
| 763 | __field(unsigned int, victim) |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 764 | __field(unsigned int, cost) |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 765 | __field(unsigned int, ofs_unit) |
| 766 | __field(unsigned int, pre_victim) |
| 767 | __field(unsigned int, prefree) |
| 768 | __field(unsigned int, free) |
| 769 | ), |
| 770 | |
| 771 | TP_fast_assign( |
| 772 | __entry->dev = sb->s_dev; |
| 773 | __entry->type = type; |
| 774 | __entry->gc_type = gc_type; |
| 775 | __entry->alloc_mode = p->alloc_mode; |
| 776 | __entry->gc_mode = p->gc_mode; |
| 777 | __entry->victim = p->min_segno; |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 778 | __entry->cost = p->min_cost; |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 779 | __entry->ofs_unit = p->ofs_unit; |
| 780 | __entry->pre_victim = pre_victim; |
| 781 | __entry->prefree = prefree; |
| 782 | __entry->free = free; |
| 783 | ), |
| 784 | |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 785 | TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), " |
| 786 | "victim = %u, cost = %u, ofs_unit = %u, " |
| 787 | "pre_victim_secno = %d, prefree = %u, free = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 788 | show_dev(__entry->dev), |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 789 | show_data_type(__entry->type), |
| 790 | show_gc_type(__entry->gc_type), |
| 791 | show_alloc_mode(__entry->alloc_mode), |
| 792 | show_victim_policy(__entry->gc_mode), |
| 793 | __entry->victim, |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 794 | __entry->cost, |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 795 | __entry->ofs_unit, |
| 796 | (int)__entry->pre_victim, |
| 797 | __entry->prefree, |
| 798 | __entry->free) |
| 799 | ); |
| 800 | |
Chao Yu | 0c5e36d | 2017-10-17 17:33:41 +0800 | [diff] [blame] | 801 | TRACE_EVENT(f2fs_lookup_start, |
| 802 | |
| 803 | TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags), |
| 804 | |
| 805 | TP_ARGS(dir, dentry, flags), |
| 806 | |
| 807 | TP_STRUCT__entry( |
| 808 | __field(dev_t, dev) |
| 809 | __field(ino_t, ino) |
| 810 | __field(const char *, name) |
| 811 | __field(unsigned int, flags) |
| 812 | ), |
| 813 | |
| 814 | TP_fast_assign( |
| 815 | __entry->dev = dir->i_sb->s_dev; |
| 816 | __entry->ino = dir->i_ino; |
| 817 | __entry->name = dentry->d_name.name; |
| 818 | __entry->flags = flags; |
| 819 | ), |
| 820 | |
| 821 | TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u", |
| 822 | show_dev_ino(__entry), |
| 823 | __entry->name, |
| 824 | __entry->flags) |
| 825 | ); |
| 826 | |
| 827 | TRACE_EVENT(f2fs_lookup_end, |
| 828 | |
| 829 | TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino, |
| 830 | int err), |
| 831 | |
| 832 | TP_ARGS(dir, dentry, ino, err), |
| 833 | |
| 834 | TP_STRUCT__entry( |
| 835 | __field(dev_t, dev) |
| 836 | __field(ino_t, ino) |
| 837 | __field(const char *, name) |
| 838 | __field(nid_t, cino) |
| 839 | __field(int, err) |
| 840 | ), |
| 841 | |
| 842 | TP_fast_assign( |
| 843 | __entry->dev = dir->i_sb->s_dev; |
| 844 | __entry->ino = dir->i_ino; |
| 845 | __entry->name = dentry->d_name.name; |
| 846 | __entry->cino = ino; |
| 847 | __entry->err = err; |
| 848 | ), |
| 849 | |
| 850 | TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d", |
| 851 | show_dev_ino(__entry), |
| 852 | __entry->name, |
| 853 | __entry->cino, |
| 854 | __entry->err) |
| 855 | ); |
| 856 | |
Chao Yu | e97a3c4 | 2017-10-13 18:01:33 +0800 | [diff] [blame] | 857 | TRACE_EVENT(f2fs_readdir, |
| 858 | |
| 859 | TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err), |
| 860 | |
| 861 | TP_ARGS(dir, start_pos, end_pos, err), |
| 862 | |
| 863 | TP_STRUCT__entry( |
| 864 | __field(dev_t, dev) |
| 865 | __field(ino_t, ino) |
| 866 | __field(loff_t, start) |
| 867 | __field(loff_t, end) |
| 868 | __field(int, err) |
| 869 | ), |
| 870 | |
| 871 | TP_fast_assign( |
| 872 | __entry->dev = dir->i_sb->s_dev; |
| 873 | __entry->ino = dir->i_ino; |
| 874 | __entry->start = start_pos; |
| 875 | __entry->end = end_pos; |
| 876 | __entry->err = err; |
| 877 | ), |
| 878 | |
| 879 | TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d", |
| 880 | show_dev_ino(__entry), |
| 881 | __entry->start, |
| 882 | __entry->end, |
| 883 | __entry->err) |
| 884 | ); |
| 885 | |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 886 | TRACE_EVENT(f2fs_fallocate, |
| 887 | |
| 888 | TP_PROTO(struct inode *inode, int mode, |
| 889 | loff_t offset, loff_t len, int ret), |
| 890 | |
| 891 | TP_ARGS(inode, mode, offset, len, ret), |
| 892 | |
| 893 | TP_STRUCT__entry( |
| 894 | __field(dev_t, dev) |
| 895 | __field(ino_t, ino) |
| 896 | __field(int, mode) |
| 897 | __field(loff_t, offset) |
| 898 | __field(loff_t, len) |
| 899 | __field(loff_t, size) |
| 900 | __field(blkcnt_t, blocks) |
| 901 | __field(int, ret) |
| 902 | ), |
| 903 | |
| 904 | TP_fast_assign( |
| 905 | __entry->dev = inode->i_sb->s_dev; |
| 906 | __entry->ino = inode->i_ino; |
| 907 | __entry->mode = mode; |
| 908 | __entry->offset = offset; |
| 909 | __entry->len = len; |
| 910 | __entry->size = inode->i_size; |
| 911 | __entry->blocks = inode->i_blocks; |
| 912 | __entry->ret = ret; |
| 913 | ), |
| 914 | |
| 915 | TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, " |
| 916 | "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d", |
| 917 | show_dev_ino(__entry), |
| 918 | __entry->mode, |
| 919 | (unsigned long long)__entry->offset, |
| 920 | (unsigned long long)__entry->len, |
| 921 | (unsigned long long)__entry->size, |
| 922 | (unsigned long long)__entry->blocks, |
| 923 | __entry->ret) |
| 924 | ); |
| 925 | |
Chao Yu | 70407fa | 2014-07-31 21:11:22 +0800 | [diff] [blame] | 926 | TRACE_EVENT(f2fs_direct_IO_enter, |
| 927 | |
| 928 | TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), |
| 929 | |
| 930 | TP_ARGS(inode, offset, len, rw), |
| 931 | |
| 932 | TP_STRUCT__entry( |
| 933 | __field(dev_t, dev) |
| 934 | __field(ino_t, ino) |
| 935 | __field(loff_t, pos) |
| 936 | __field(unsigned long, len) |
| 937 | __field(int, rw) |
| 938 | ), |
| 939 | |
| 940 | TP_fast_assign( |
| 941 | __entry->dev = inode->i_sb->s_dev; |
| 942 | __entry->ino = inode->i_ino; |
| 943 | __entry->pos = offset; |
| 944 | __entry->len = len; |
| 945 | __entry->rw = rw; |
| 946 | ), |
| 947 | |
| 948 | TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d", |
| 949 | show_dev_ino(__entry), |
| 950 | __entry->pos, |
| 951 | __entry->len, |
| 952 | __entry->rw) |
| 953 | ); |
| 954 | |
| 955 | TRACE_EVENT(f2fs_direct_IO_exit, |
| 956 | |
| 957 | TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, |
| 958 | int rw, int ret), |
| 959 | |
| 960 | TP_ARGS(inode, offset, len, rw, ret), |
| 961 | |
| 962 | TP_STRUCT__entry( |
| 963 | __field(dev_t, dev) |
| 964 | __field(ino_t, ino) |
| 965 | __field(loff_t, pos) |
| 966 | __field(unsigned long, len) |
| 967 | __field(int, rw) |
| 968 | __field(int, ret) |
| 969 | ), |
| 970 | |
| 971 | TP_fast_assign( |
| 972 | __entry->dev = inode->i_sb->s_dev; |
| 973 | __entry->ino = inode->i_ino; |
| 974 | __entry->pos = offset; |
| 975 | __entry->len = len; |
| 976 | __entry->rw = rw; |
| 977 | __entry->ret = ret; |
| 978 | ), |
| 979 | |
| 980 | TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu " |
| 981 | "rw = %d ret = %d", |
| 982 | show_dev_ino(__entry), |
| 983 | __entry->pos, |
| 984 | __entry->len, |
| 985 | __entry->rw, |
| 986 | __entry->ret) |
| 987 | ); |
| 988 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 989 | TRACE_EVENT(f2fs_reserve_new_blocks, |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 990 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 991 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node, |
| 992 | blkcnt_t count), |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 993 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 994 | TP_ARGS(inode, nid, ofs_in_node, count), |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 995 | |
| 996 | TP_STRUCT__entry( |
| 997 | __field(dev_t, dev) |
| 998 | __field(nid_t, nid) |
| 999 | __field(unsigned int, ofs_in_node) |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 1000 | __field(blkcnt_t, count) |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 1001 | ), |
| 1002 | |
| 1003 | TP_fast_assign( |
| 1004 | __entry->dev = inode->i_sb->s_dev; |
| 1005 | __entry->nid = nid; |
| 1006 | __entry->ofs_in_node = ofs_in_node; |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 1007 | __entry->count = count; |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 1008 | ), |
| 1009 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 1010 | TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1011 | show_dev(__entry->dev), |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 1012 | (unsigned int)__entry->nid, |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 1013 | __entry->ofs_in_node, |
| 1014 | (unsigned long long)__entry->count) |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 1015 | ); |
| 1016 | |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1017 | DECLARE_EVENT_CLASS(f2fs__submit_page_bio, |
| 1018 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1019 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1020 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1021 | TP_ARGS(page, fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1022 | |
| 1023 | TP_STRUCT__entry( |
| 1024 | __field(dev_t, dev) |
| 1025 | __field(ino_t, ino) |
| 1026 | __field(pgoff_t, index) |
Chao Yu | 7a9d754 | 2016-02-22 18:36:38 +0800 | [diff] [blame] | 1027 | __field(block_t, old_blkaddr) |
| 1028 | __field(block_t, new_blkaddr) |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 1029 | __field(int, op) |
| 1030 | __field(int, op_flags) |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 1031 | __field(int, temp) |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1032 | __field(int, type) |
| 1033 | ), |
| 1034 | |
| 1035 | TP_fast_assign( |
Jaegeuk Kim | 4969c06 | 2019-07-01 19:15:29 -0700 | [diff] [blame] | 1036 | __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; |
| 1037 | __entry->ino = page_file_mapping(page)->host->i_ino; |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1038 | __entry->index = page->index; |
Chao Yu | 7a9d754 | 2016-02-22 18:36:38 +0800 | [diff] [blame] | 1039 | __entry->old_blkaddr = fio->old_blkaddr; |
| 1040 | __entry->new_blkaddr = fio->new_blkaddr; |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 1041 | __entry->op = fio->op; |
| 1042 | __entry->op_flags = fio->op_flags; |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 1043 | __entry->temp = fio->temp; |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1044 | __entry->type = fio->type; |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1045 | ), |
| 1046 | |
| 1047 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 1048 | "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s", |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1049 | show_dev_ino(__entry), |
| 1050 | (unsigned long)__entry->index, |
Chao Yu | 7a9d754 | 2016-02-22 18:36:38 +0800 | [diff] [blame] | 1051 | (unsigned long long)__entry->old_blkaddr, |
| 1052 | (unsigned long long)__entry->new_blkaddr, |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 1053 | show_bio_type(__entry->op, __entry->op_flags), |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 1054 | show_block_temp(__entry->temp), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1055 | show_block_type(__entry->type)) |
| 1056 | ); |
| 1057 | |
| 1058 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio, |
| 1059 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1060 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1061 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1062 | TP_ARGS(page, fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1063 | |
| 1064 | TP_CONDITION(page->mapping) |
| 1065 | ); |
| 1066 | |
Jaegeuk Kim | b9109b0 | 2017-05-10 11:28:38 -0700 | [diff] [blame] | 1067 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write, |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1068 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1069 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1070 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1071 | TP_ARGS(page, fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1072 | |
| 1073 | TP_CONDITION(page->mapping) |
| 1074 | ); |
| 1075 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1076 | DECLARE_EVENT_CLASS(f2fs__bio, |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1077 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1078 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1079 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1080 | TP_ARGS(sb, type, bio), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1081 | |
| 1082 | TP_STRUCT__entry( |
| 1083 | __field(dev_t, dev) |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1084 | __field(dev_t, target) |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 1085 | __field(int, op) |
| 1086 | __field(int, op_flags) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1087 | __field(int, type) |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1088 | __field(sector_t, sector) |
| 1089 | __field(unsigned int, size) |
| 1090 | ), |
| 1091 | |
| 1092 | TP_fast_assign( |
| 1093 | __entry->dev = sb->s_dev; |
Christoph Hellwig | 74d4699 | 2017-08-23 19:10:32 +0200 | [diff] [blame] | 1094 | __entry->target = bio_dev(bio); |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1095 | __entry->op = bio_op(bio); |
| 1096 | __entry->op_flags = bio->bi_opf; |
| 1097 | __entry->type = type; |
Kent Overstreet | 4f024f3 | 2013-10-11 15:44:27 -0700 | [diff] [blame] | 1098 | __entry->sector = bio->bi_iter.bi_sector; |
| 1099 | __entry->size = bio->bi_iter.bi_size; |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1100 | ), |
| 1101 | |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 1102 | TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1103 | show_dev(__entry->target), |
| 1104 | show_dev(__entry->dev), |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 1105 | show_bio_type(__entry->op, __entry->op_flags), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1106 | show_block_type(__entry->type), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1107 | (unsigned long long)__entry->sector, |
| 1108 | __entry->size) |
| 1109 | ); |
| 1110 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1111 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio, |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1112 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1113 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1114 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1115 | TP_ARGS(sb, type, bio), |
Jaegeuk Kim | 93dfe2a | 2013-11-30 12:51:14 +0900 | [diff] [blame] | 1116 | |
| 1117 | TP_CONDITION(bio) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1118 | ); |
| 1119 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1120 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio, |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1121 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1122 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1123 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1124 | TP_ARGS(sb, type, bio), |
| 1125 | |
| 1126 | TP_CONDITION(bio) |
| 1127 | ); |
| 1128 | |
| 1129 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio, |
| 1130 | |
| 1131 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
| 1132 | |
| 1133 | TP_ARGS(sb, type, bio), |
| 1134 | |
| 1135 | TP_CONDITION(bio) |
| 1136 | ); |
| 1137 | |
| 1138 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio, |
| 1139 | |
| 1140 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
| 1141 | |
| 1142 | TP_ARGS(sb, type, bio), |
Jaegeuk Kim | 93dfe2a | 2013-11-30 12:51:14 +0900 | [diff] [blame] | 1143 | |
| 1144 | TP_CONDITION(bio) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1145 | ); |
| 1146 | |
Chao Yu | 62aed04 | 2014-05-06 16:46:04 +0800 | [diff] [blame] | 1147 | TRACE_EVENT(f2fs_write_begin, |
| 1148 | |
| 1149 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
| 1150 | unsigned int flags), |
| 1151 | |
| 1152 | TP_ARGS(inode, pos, len, flags), |
| 1153 | |
| 1154 | TP_STRUCT__entry( |
| 1155 | __field(dev_t, dev) |
| 1156 | __field(ino_t, ino) |
| 1157 | __field(loff_t, pos) |
| 1158 | __field(unsigned int, len) |
| 1159 | __field(unsigned int, flags) |
| 1160 | ), |
| 1161 | |
| 1162 | TP_fast_assign( |
| 1163 | __entry->dev = inode->i_sb->s_dev; |
| 1164 | __entry->ino = inode->i_ino; |
| 1165 | __entry->pos = pos; |
| 1166 | __entry->len = len; |
| 1167 | __entry->flags = flags; |
| 1168 | ), |
| 1169 | |
| 1170 | TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u", |
| 1171 | show_dev_ino(__entry), |
| 1172 | (unsigned long long)__entry->pos, |
| 1173 | __entry->len, |
| 1174 | __entry->flags) |
| 1175 | ); |
| 1176 | |
Chao Yu | dfb2bf3 | 2014-05-06 16:47:23 +0800 | [diff] [blame] | 1177 | TRACE_EVENT(f2fs_write_end, |
| 1178 | |
| 1179 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
| 1180 | unsigned int copied), |
| 1181 | |
| 1182 | TP_ARGS(inode, pos, len, copied), |
| 1183 | |
| 1184 | TP_STRUCT__entry( |
| 1185 | __field(dev_t, dev) |
| 1186 | __field(ino_t, ino) |
| 1187 | __field(loff_t, pos) |
| 1188 | __field(unsigned int, len) |
| 1189 | __field(unsigned int, copied) |
| 1190 | ), |
| 1191 | |
| 1192 | TP_fast_assign( |
| 1193 | __entry->dev = inode->i_sb->s_dev; |
| 1194 | __entry->ino = inode->i_ino; |
| 1195 | __entry->pos = pos; |
| 1196 | __entry->len = len; |
| 1197 | __entry->copied = copied; |
| 1198 | ), |
| 1199 | |
| 1200 | TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u", |
| 1201 | show_dev_ino(__entry), |
| 1202 | (unsigned long long)__entry->pos, |
| 1203 | __entry->len, |
| 1204 | __entry->copied) |
| 1205 | ); |
| 1206 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1207 | DECLARE_EVENT_CLASS(f2fs__page, |
| 1208 | |
| 1209 | TP_PROTO(struct page *page, int type), |
| 1210 | |
| 1211 | TP_ARGS(page, type), |
| 1212 | |
| 1213 | TP_STRUCT__entry( |
| 1214 | __field(dev_t, dev) |
| 1215 | __field(ino_t, ino) |
| 1216 | __field(int, type) |
| 1217 | __field(int, dir) |
| 1218 | __field(pgoff_t, index) |
| 1219 | __field(int, dirty) |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1220 | __field(int, uptodate) |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1221 | ), |
| 1222 | |
| 1223 | TP_fast_assign( |
Jaegeuk Kim | 4969c06 | 2019-07-01 19:15:29 -0700 | [diff] [blame] | 1224 | __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; |
| 1225 | __entry->ino = page_file_mapping(page)->host->i_ino; |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1226 | __entry->type = type; |
Jaegeuk Kim | 4969c06 | 2019-07-01 19:15:29 -0700 | [diff] [blame] | 1227 | __entry->dir = |
| 1228 | S_ISDIR(page_file_mapping(page)->host->i_mode); |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1229 | __entry->index = page->index; |
| 1230 | __entry->dirty = PageDirty(page); |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1231 | __entry->uptodate = PageUptodate(page); |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1232 | ), |
| 1233 | |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1234 | TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, " |
| 1235 | "dirty = %d, uptodate = %d", |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1236 | show_dev_ino(__entry), |
| 1237 | show_block_type(__entry->type), |
| 1238 | show_file_type(__entry->dir), |
| 1239 | (unsigned long)__entry->index, |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1240 | __entry->dirty, |
| 1241 | __entry->uptodate) |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1242 | ); |
| 1243 | |
Chao Yu | ecda0de | 2014-05-06 16:48:26 +0800 | [diff] [blame] | 1244 | DEFINE_EVENT(f2fs__page, f2fs_writepage, |
| 1245 | |
| 1246 | TP_PROTO(struct page *page, int type), |
| 1247 | |
| 1248 | TP_ARGS(page, type) |
| 1249 | ); |
| 1250 | |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 1251 | DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page, |
| 1252 | |
| 1253 | TP_PROTO(struct page *page, int type), |
| 1254 | |
| 1255 | TP_ARGS(page, type) |
| 1256 | ); |
| 1257 | |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1258 | DEFINE_EVENT(f2fs__page, f2fs_readpage, |
| 1259 | |
| 1260 | TP_PROTO(struct page *page, int type), |
| 1261 | |
| 1262 | TP_ARGS(page, type) |
| 1263 | ); |
| 1264 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1265 | DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, |
| 1266 | |
| 1267 | TP_PROTO(struct page *page, int type), |
| 1268 | |
| 1269 | TP_ARGS(page, type) |
| 1270 | ); |
| 1271 | |
Jaegeuk Kim | e943a10 | 2013-10-25 14:26:31 +0900 | [diff] [blame] | 1272 | DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite, |
| 1273 | |
| 1274 | TP_PROTO(struct page *page, int type), |
| 1275 | |
| 1276 | TP_ARGS(page, type) |
| 1277 | ); |
| 1278 | |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 1279 | DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page, |
| 1280 | |
| 1281 | TP_PROTO(struct page *page, int type), |
| 1282 | |
| 1283 | TP_ARGS(page, type) |
| 1284 | ); |
| 1285 | |
| 1286 | DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page, |
| 1287 | |
| 1288 | TP_PROTO(struct page *page, int type), |
| 1289 | |
| 1290 | TP_ARGS(page, type) |
| 1291 | ); |
| 1292 | |
Chao Yu | d764834 | 2019-04-15 15:22:19 +0800 | [diff] [blame] | 1293 | TRACE_EVENT(f2fs_filemap_fault, |
| 1294 | |
| 1295 | TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret), |
| 1296 | |
| 1297 | TP_ARGS(inode, index, ret), |
| 1298 | |
| 1299 | TP_STRUCT__entry( |
| 1300 | __field(dev_t, dev) |
| 1301 | __field(ino_t, ino) |
| 1302 | __field(pgoff_t, index) |
| 1303 | __field(unsigned long, ret) |
| 1304 | ), |
| 1305 | |
| 1306 | TP_fast_assign( |
| 1307 | __entry->dev = inode->i_sb->s_dev; |
| 1308 | __entry->ino = inode->i_ino; |
| 1309 | __entry->index = index; |
| 1310 | __entry->ret = ret; |
| 1311 | ), |
| 1312 | |
| 1313 | TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx", |
| 1314 | show_dev_ino(__entry), |
| 1315 | (unsigned long)__entry->index, |
| 1316 | __entry->ret) |
| 1317 | ); |
| 1318 | |
Chao Yu | e574843 | 2014-05-06 16:51:24 +0800 | [diff] [blame] | 1319 | TRACE_EVENT(f2fs_writepages, |
| 1320 | |
| 1321 | TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type), |
| 1322 | |
| 1323 | TP_ARGS(inode, wbc, type), |
| 1324 | |
| 1325 | TP_STRUCT__entry( |
| 1326 | __field(dev_t, dev) |
| 1327 | __field(ino_t, ino) |
| 1328 | __field(int, type) |
| 1329 | __field(int, dir) |
| 1330 | __field(long, nr_to_write) |
| 1331 | __field(long, pages_skipped) |
| 1332 | __field(loff_t, range_start) |
| 1333 | __field(loff_t, range_end) |
| 1334 | __field(pgoff_t, writeback_index) |
| 1335 | __field(int, sync_mode) |
| 1336 | __field(char, for_kupdate) |
| 1337 | __field(char, for_background) |
| 1338 | __field(char, tagged_writepages) |
| 1339 | __field(char, for_reclaim) |
| 1340 | __field(char, range_cyclic) |
| 1341 | __field(char, for_sync) |
| 1342 | ), |
| 1343 | |
| 1344 | TP_fast_assign( |
| 1345 | __entry->dev = inode->i_sb->s_dev; |
| 1346 | __entry->ino = inode->i_ino; |
| 1347 | __entry->type = type; |
| 1348 | __entry->dir = S_ISDIR(inode->i_mode); |
| 1349 | __entry->nr_to_write = wbc->nr_to_write; |
| 1350 | __entry->pages_skipped = wbc->pages_skipped; |
| 1351 | __entry->range_start = wbc->range_start; |
| 1352 | __entry->range_end = wbc->range_end; |
| 1353 | __entry->writeback_index = inode->i_mapping->writeback_index; |
| 1354 | __entry->sync_mode = wbc->sync_mode; |
| 1355 | __entry->for_kupdate = wbc->for_kupdate; |
| 1356 | __entry->for_background = wbc->for_background; |
| 1357 | __entry->tagged_writepages = wbc->tagged_writepages; |
| 1358 | __entry->for_reclaim = wbc->for_reclaim; |
| 1359 | __entry->range_cyclic = wbc->range_cyclic; |
| 1360 | __entry->for_sync = wbc->for_sync; |
| 1361 | ), |
| 1362 | |
| 1363 | TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, " |
| 1364 | "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, " |
| 1365 | "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u", |
| 1366 | show_dev_ino(__entry), |
| 1367 | show_block_type(__entry->type), |
| 1368 | show_file_type(__entry->dir), |
| 1369 | __entry->nr_to_write, |
| 1370 | __entry->pages_skipped, |
| 1371 | __entry->range_start, |
| 1372 | __entry->range_end, |
| 1373 | (unsigned long)__entry->writeback_index, |
| 1374 | __entry->sync_mode, |
| 1375 | __entry->for_kupdate, |
| 1376 | __entry->for_background, |
| 1377 | __entry->tagged_writepages, |
| 1378 | __entry->for_reclaim, |
| 1379 | __entry->range_cyclic, |
| 1380 | __entry->for_sync) |
| 1381 | ); |
| 1382 | |
Chao Yu | b8c2940 | 2015-10-12 17:02:26 +0800 | [diff] [blame] | 1383 | TRACE_EVENT(f2fs_readpages, |
| 1384 | |
Matthew Wilcox (Oracle) | 2332319 | 2020-06-01 21:47:23 -0700 | [diff] [blame] | 1385 | TP_PROTO(struct inode *inode, pgoff_t start, unsigned int nrpage), |
Chao Yu | b8c2940 | 2015-10-12 17:02:26 +0800 | [diff] [blame] | 1386 | |
Matthew Wilcox (Oracle) | 2332319 | 2020-06-01 21:47:23 -0700 | [diff] [blame] | 1387 | TP_ARGS(inode, start, nrpage), |
Chao Yu | b8c2940 | 2015-10-12 17:02:26 +0800 | [diff] [blame] | 1388 | |
| 1389 | TP_STRUCT__entry( |
| 1390 | __field(dev_t, dev) |
| 1391 | __field(ino_t, ino) |
| 1392 | __field(pgoff_t, start) |
| 1393 | __field(unsigned int, nrpage) |
| 1394 | ), |
| 1395 | |
| 1396 | TP_fast_assign( |
| 1397 | __entry->dev = inode->i_sb->s_dev; |
| 1398 | __entry->ino = inode->i_ino; |
Matthew Wilcox (Oracle) | 2332319 | 2020-06-01 21:47:23 -0700 | [diff] [blame] | 1399 | __entry->start = start; |
Chao Yu | b8c2940 | 2015-10-12 17:02:26 +0800 | [diff] [blame] | 1400 | __entry->nrpage = nrpage; |
| 1401 | ), |
| 1402 | |
| 1403 | TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u", |
| 1404 | show_dev_ino(__entry), |
| 1405 | (unsigned long)__entry->start, |
| 1406 | __entry->nrpage) |
| 1407 | ); |
| 1408 | |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1409 | TRACE_EVENT(f2fs_write_checkpoint, |
| 1410 | |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1411 | TP_PROTO(struct super_block *sb, int reason, char *msg), |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1412 | |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1413 | TP_ARGS(sb, reason, msg), |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1414 | |
| 1415 | TP_STRUCT__entry( |
| 1416 | __field(dev_t, dev) |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1417 | __field(int, reason) |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1418 | __field(char *, msg) |
| 1419 | ), |
| 1420 | |
| 1421 | TP_fast_assign( |
| 1422 | __entry->dev = sb->s_dev; |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1423 | __entry->reason = reason; |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1424 | __entry->msg = msg; |
| 1425 | ), |
| 1426 | |
| 1427 | TP_printk("dev = (%d,%d), checkpoint for %s, state = %s", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1428 | show_dev(__entry->dev), |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1429 | show_cpreason(__entry->reason), |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1430 | __entry->msg) |
| 1431 | ); |
| 1432 | |
Chao Yu | 0243a5f | 2017-04-15 14:09:38 +0800 | [diff] [blame] | 1433 | DECLARE_EVENT_CLASS(f2fs_discard, |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1434 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1435 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1436 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1437 | TP_ARGS(dev, blkstart, blklen), |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1438 | |
| 1439 | TP_STRUCT__entry( |
| 1440 | __field(dev_t, dev) |
| 1441 | __field(block_t, blkstart) |
| 1442 | __field(block_t, blklen) |
| 1443 | ), |
| 1444 | |
| 1445 | TP_fast_assign( |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1446 | __entry->dev = dev->bd_dev; |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1447 | __entry->blkstart = blkstart; |
| 1448 | __entry->blklen = blklen; |
| 1449 | ), |
| 1450 | |
| 1451 | TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1452 | show_dev(__entry->dev), |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1453 | (unsigned long long)__entry->blkstart, |
| 1454 | (unsigned long long)__entry->blklen) |
| 1455 | ); |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1456 | |
Chao Yu | 0243a5f | 2017-04-15 14:09:38 +0800 | [diff] [blame] | 1457 | DEFINE_EVENT(f2fs_discard, f2fs_queue_discard, |
| 1458 | |
| 1459 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
| 1460 | |
| 1461 | TP_ARGS(dev, blkstart, blklen) |
| 1462 | ); |
| 1463 | |
| 1464 | DEFINE_EVENT(f2fs_discard, f2fs_issue_discard, |
| 1465 | |
| 1466 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
| 1467 | |
| 1468 | TP_ARGS(dev, blkstart, blklen) |
| 1469 | ); |
| 1470 | |
Chao Yu | 2ec6f2e | 2017-10-04 09:08:36 +0800 | [diff] [blame] | 1471 | DEFINE_EVENT(f2fs_discard, f2fs_remove_discard, |
| 1472 | |
| 1473 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
| 1474 | |
| 1475 | TP_ARGS(dev, blkstart, blklen) |
| 1476 | ); |
| 1477 | |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1478 | TRACE_EVENT(f2fs_issue_reset_zone, |
| 1479 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1480 | TP_PROTO(struct block_device *dev, block_t blkstart), |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1481 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1482 | TP_ARGS(dev, blkstart), |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1483 | |
| 1484 | TP_STRUCT__entry( |
| 1485 | __field(dev_t, dev) |
| 1486 | __field(block_t, blkstart) |
| 1487 | ), |
| 1488 | |
| 1489 | TP_fast_assign( |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1490 | __entry->dev = dev->bd_dev; |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1491 | __entry->blkstart = blkstart; |
| 1492 | ), |
| 1493 | |
| 1494 | TP_printk("dev = (%d,%d), reset zone at block = 0x%llx", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1495 | show_dev(__entry->dev), |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1496 | (unsigned long long)__entry->blkstart) |
| 1497 | ); |
| 1498 | |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1499 | TRACE_EVENT(f2fs_issue_flush, |
| 1500 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1501 | TP_PROTO(struct block_device *dev, unsigned int nobarrier, |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1502 | unsigned int flush_merge, int ret), |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1503 | |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1504 | TP_ARGS(dev, nobarrier, flush_merge, ret), |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1505 | |
| 1506 | TP_STRUCT__entry( |
| 1507 | __field(dev_t, dev) |
Jaegeuk Kim | 29e7043 | 2015-02-10 16:23:12 -0800 | [diff] [blame] | 1508 | __field(unsigned int, nobarrier) |
| 1509 | __field(unsigned int, flush_merge) |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1510 | __field(int, ret) |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1511 | ), |
| 1512 | |
| 1513 | TP_fast_assign( |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1514 | __entry->dev = dev->bd_dev; |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1515 | __entry->nobarrier = nobarrier; |
| 1516 | __entry->flush_merge = flush_merge; |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1517 | __entry->ret = ret; |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1518 | ), |
| 1519 | |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1520 | TP_printk("dev = (%d,%d), %s %s, ret = %d", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1521 | show_dev(__entry->dev), |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1522 | __entry->nobarrier ? "skip (nobarrier)" : "issue", |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1523 | __entry->flush_merge ? " with flush_merge" : "", |
| 1524 | __entry->ret) |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1525 | ); |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1526 | |
| 1527 | TRACE_EVENT(f2fs_lookup_extent_tree_start, |
| 1528 | |
| 1529 | TP_PROTO(struct inode *inode, unsigned int pgofs), |
| 1530 | |
| 1531 | TP_ARGS(inode, pgofs), |
| 1532 | |
| 1533 | TP_STRUCT__entry( |
| 1534 | __field(dev_t, dev) |
| 1535 | __field(ino_t, ino) |
| 1536 | __field(unsigned int, pgofs) |
| 1537 | ), |
| 1538 | |
| 1539 | TP_fast_assign( |
| 1540 | __entry->dev = inode->i_sb->s_dev; |
| 1541 | __entry->ino = inode->i_ino; |
| 1542 | __entry->pgofs = pgofs; |
| 1543 | ), |
| 1544 | |
| 1545 | TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u", |
| 1546 | show_dev_ino(__entry), |
| 1547 | __entry->pgofs) |
| 1548 | ); |
| 1549 | |
| 1550 | TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end, |
| 1551 | |
| 1552 | TP_PROTO(struct inode *inode, unsigned int pgofs, |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1553 | struct extent_info *ei), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1554 | |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1555 | TP_ARGS(inode, pgofs, ei), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1556 | |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1557 | TP_CONDITION(ei), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1558 | |
| 1559 | TP_STRUCT__entry( |
| 1560 | __field(dev_t, dev) |
| 1561 | __field(ino_t, ino) |
| 1562 | __field(unsigned int, pgofs) |
| 1563 | __field(unsigned int, fofs) |
| 1564 | __field(u32, blk) |
| 1565 | __field(unsigned int, len) |
| 1566 | ), |
| 1567 | |
| 1568 | TP_fast_assign( |
| 1569 | __entry->dev = inode->i_sb->s_dev; |
| 1570 | __entry->ino = inode->i_ino; |
| 1571 | __entry->pgofs = pgofs; |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1572 | __entry->fofs = ei->fofs; |
| 1573 | __entry->blk = ei->blk; |
| 1574 | __entry->len = ei->len; |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1575 | ), |
| 1576 | |
| 1577 | TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, " |
| 1578 | "ext_info(fofs: %u, blk: %u, len: %u)", |
| 1579 | show_dev_ino(__entry), |
| 1580 | __entry->pgofs, |
| 1581 | __entry->fofs, |
| 1582 | __entry->blk, |
| 1583 | __entry->len) |
| 1584 | ); |
| 1585 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1586 | TRACE_EVENT(f2fs_update_extent_tree_range, |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1587 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1588 | TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr, |
| 1589 | unsigned int len), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1590 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1591 | TP_ARGS(inode, pgofs, blkaddr, len), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1592 | |
| 1593 | TP_STRUCT__entry( |
| 1594 | __field(dev_t, dev) |
| 1595 | __field(ino_t, ino) |
| 1596 | __field(unsigned int, pgofs) |
| 1597 | __field(u32, blk) |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1598 | __field(unsigned int, len) |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1599 | ), |
| 1600 | |
| 1601 | TP_fast_assign( |
| 1602 | __entry->dev = inode->i_sb->s_dev; |
| 1603 | __entry->ino = inode->i_ino; |
| 1604 | __entry->pgofs = pgofs; |
| 1605 | __entry->blk = blkaddr; |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1606 | __entry->len = len; |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1607 | ), |
| 1608 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1609 | TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, " |
| 1610 | "blkaddr = %u, len = %u", |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1611 | show_dev_ino(__entry), |
| 1612 | __entry->pgofs, |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1613 | __entry->blk, |
| 1614 | __entry->len) |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1615 | ); |
| 1616 | |
| 1617 | TRACE_EVENT(f2fs_shrink_extent_tree, |
| 1618 | |
| 1619 | TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt, |
| 1620 | unsigned int tree_cnt), |
| 1621 | |
| 1622 | TP_ARGS(sbi, node_cnt, tree_cnt), |
| 1623 | |
| 1624 | TP_STRUCT__entry( |
| 1625 | __field(dev_t, dev) |
| 1626 | __field(unsigned int, node_cnt) |
| 1627 | __field(unsigned int, tree_cnt) |
| 1628 | ), |
| 1629 | |
| 1630 | TP_fast_assign( |
| 1631 | __entry->dev = sbi->sb->s_dev; |
| 1632 | __entry->node_cnt = node_cnt; |
| 1633 | __entry->tree_cnt = tree_cnt; |
| 1634 | ), |
| 1635 | |
| 1636 | TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1637 | show_dev(__entry->dev), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1638 | __entry->node_cnt, |
| 1639 | __entry->tree_cnt) |
| 1640 | ); |
| 1641 | |
| 1642 | TRACE_EVENT(f2fs_destroy_extent_tree, |
| 1643 | |
| 1644 | TP_PROTO(struct inode *inode, unsigned int node_cnt), |
| 1645 | |
| 1646 | TP_ARGS(inode, node_cnt), |
| 1647 | |
| 1648 | TP_STRUCT__entry( |
| 1649 | __field(dev_t, dev) |
| 1650 | __field(ino_t, ino) |
| 1651 | __field(unsigned int, node_cnt) |
| 1652 | ), |
| 1653 | |
| 1654 | TP_fast_assign( |
| 1655 | __entry->dev = inode->i_sb->s_dev; |
| 1656 | __entry->ino = inode->i_ino; |
| 1657 | __entry->node_cnt = node_cnt; |
| 1658 | ), |
| 1659 | |
| 1660 | TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u", |
| 1661 | show_dev_ino(__entry), |
| 1662 | __entry->node_cnt) |
| 1663 | ); |
| 1664 | |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1665 | DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes, |
| 1666 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1667 | TP_PROTO(struct super_block *sb, int type, s64 count), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1668 | |
| 1669 | TP_ARGS(sb, type, count), |
| 1670 | |
| 1671 | TP_STRUCT__entry( |
| 1672 | __field(dev_t, dev) |
| 1673 | __field(int, type) |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1674 | __field(s64, count) |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1675 | ), |
| 1676 | |
| 1677 | TP_fast_assign( |
| 1678 | __entry->dev = sb->s_dev; |
| 1679 | __entry->type = type; |
| 1680 | __entry->count = count; |
| 1681 | ), |
| 1682 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1683 | TP_printk("dev = (%d,%d), %s, dirty count = %lld", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1684 | show_dev(__entry->dev), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1685 | show_file_type(__entry->type), |
| 1686 | __entry->count) |
| 1687 | ); |
| 1688 | |
| 1689 | DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter, |
| 1690 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1691 | TP_PROTO(struct super_block *sb, int type, s64 count), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1692 | |
| 1693 | TP_ARGS(sb, type, count) |
| 1694 | ); |
| 1695 | |
| 1696 | DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit, |
| 1697 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1698 | TP_PROTO(struct super_block *sb, int type, s64 count), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1699 | |
| 1700 | TP_ARGS(sb, type, count) |
| 1701 | ); |
| 1702 | |
Chao Yu | 559e87c | 2019-02-26 19:01:15 +0800 | [diff] [blame] | 1703 | TRACE_EVENT(f2fs_shutdown, |
| 1704 | |
| 1705 | TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret), |
| 1706 | |
| 1707 | TP_ARGS(sbi, mode, ret), |
| 1708 | |
| 1709 | TP_STRUCT__entry( |
| 1710 | __field(dev_t, dev) |
| 1711 | __field(unsigned int, mode) |
| 1712 | __field(int, ret) |
| 1713 | ), |
| 1714 | |
| 1715 | TP_fast_assign( |
| 1716 | __entry->dev = sbi->sb->s_dev; |
| 1717 | __entry->mode = mode; |
| 1718 | __entry->ret = ret; |
| 1719 | ), |
| 1720 | |
| 1721 | TP_printk("dev = (%d,%d), mode: %s, ret:%d", |
| 1722 | show_dev(__entry->dev), |
| 1723 | show_shutdown_mode(__entry->mode), |
| 1724 | __entry->ret) |
| 1725 | ); |
| 1726 | |
Chao Yu | 4c8ff70 | 2019-11-01 18:07:14 +0800 | [diff] [blame] | 1727 | DECLARE_EVENT_CLASS(f2fs_zip_start, |
| 1728 | |
| 1729 | TP_PROTO(struct inode *inode, pgoff_t cluster_idx, |
| 1730 | unsigned int cluster_size, unsigned char algtype), |
| 1731 | |
| 1732 | TP_ARGS(inode, cluster_idx, cluster_size, algtype), |
| 1733 | |
| 1734 | TP_STRUCT__entry( |
| 1735 | __field(dev_t, dev) |
| 1736 | __field(ino_t, ino) |
| 1737 | __field(pgoff_t, idx) |
| 1738 | __field(unsigned int, size) |
| 1739 | __field(unsigned int, algtype) |
| 1740 | ), |
| 1741 | |
| 1742 | TP_fast_assign( |
| 1743 | __entry->dev = inode->i_sb->s_dev; |
| 1744 | __entry->ino = inode->i_ino; |
| 1745 | __entry->idx = cluster_idx; |
| 1746 | __entry->size = cluster_size; |
| 1747 | __entry->algtype = algtype; |
| 1748 | ), |
| 1749 | |
| 1750 | TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, " |
| 1751 | "cluster_size = %u, algorithm = %s", |
| 1752 | show_dev_ino(__entry), |
| 1753 | __entry->idx, |
| 1754 | __entry->size, |
| 1755 | show_compress_algorithm(__entry->algtype)) |
| 1756 | ); |
| 1757 | |
| 1758 | DECLARE_EVENT_CLASS(f2fs_zip_end, |
| 1759 | |
| 1760 | TP_PROTO(struct inode *inode, pgoff_t cluster_idx, |
| 1761 | unsigned int compressed_size, int ret), |
| 1762 | |
| 1763 | TP_ARGS(inode, cluster_idx, compressed_size, ret), |
| 1764 | |
| 1765 | TP_STRUCT__entry( |
| 1766 | __field(dev_t, dev) |
| 1767 | __field(ino_t, ino) |
| 1768 | __field(pgoff_t, idx) |
| 1769 | __field(unsigned int, size) |
| 1770 | __field(unsigned int, ret) |
| 1771 | ), |
| 1772 | |
| 1773 | TP_fast_assign( |
| 1774 | __entry->dev = inode->i_sb->s_dev; |
| 1775 | __entry->ino = inode->i_ino; |
| 1776 | __entry->idx = cluster_idx; |
| 1777 | __entry->size = compressed_size; |
| 1778 | __entry->ret = ret; |
| 1779 | ), |
| 1780 | |
| 1781 | TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, " |
| 1782 | "compressed_size = %u, ret = %d", |
| 1783 | show_dev_ino(__entry), |
| 1784 | __entry->idx, |
| 1785 | __entry->size, |
| 1786 | __entry->ret) |
| 1787 | ); |
| 1788 | |
| 1789 | DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start, |
| 1790 | |
| 1791 | TP_PROTO(struct inode *inode, pgoff_t cluster_idx, |
| 1792 | unsigned int cluster_size, unsigned char algtype), |
| 1793 | |
| 1794 | TP_ARGS(inode, cluster_idx, cluster_size, algtype) |
| 1795 | ); |
| 1796 | |
| 1797 | DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start, |
| 1798 | |
| 1799 | TP_PROTO(struct inode *inode, pgoff_t cluster_idx, |
| 1800 | unsigned int cluster_size, unsigned char algtype), |
| 1801 | |
| 1802 | TP_ARGS(inode, cluster_idx, cluster_size, algtype) |
| 1803 | ); |
| 1804 | |
| 1805 | DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end, |
| 1806 | |
| 1807 | TP_PROTO(struct inode *inode, pgoff_t cluster_idx, |
| 1808 | unsigned int compressed_size, int ret), |
| 1809 | |
| 1810 | TP_ARGS(inode, cluster_idx, compressed_size, ret) |
| 1811 | ); |
| 1812 | |
| 1813 | DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end, |
| 1814 | |
| 1815 | TP_PROTO(struct inode *inode, pgoff_t cluster_idx, |
| 1816 | unsigned int compressed_size, int ret), |
| 1817 | |
| 1818 | TP_ARGS(inode, cluster_idx, compressed_size, ret) |
| 1819 | ); |
| 1820 | |
Daeho Jeong | 5211874 | 2021-08-19 20:52:28 -0700 | [diff] [blame] | 1821 | #ifdef CONFIG_F2FS_IOSTAT |
Daeho Jeong | 2bc4bea | 2020-03-30 03:30:59 +0000 | [diff] [blame] | 1822 | TRACE_EVENT(f2fs_iostat, |
| 1823 | |
| 1824 | TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat), |
| 1825 | |
| 1826 | TP_ARGS(sbi, iostat), |
| 1827 | |
| 1828 | TP_STRUCT__entry( |
| 1829 | __field(dev_t, dev) |
| 1830 | __field(unsigned long long, app_dio) |
| 1831 | __field(unsigned long long, app_bio) |
| 1832 | __field(unsigned long long, app_wio) |
| 1833 | __field(unsigned long long, app_mio) |
| 1834 | __field(unsigned long long, fs_dio) |
| 1835 | __field(unsigned long long, fs_nio) |
| 1836 | __field(unsigned long long, fs_mio) |
| 1837 | __field(unsigned long long, fs_gc_dio) |
| 1838 | __field(unsigned long long, fs_gc_nio) |
| 1839 | __field(unsigned long long, fs_cp_dio) |
| 1840 | __field(unsigned long long, fs_cp_nio) |
| 1841 | __field(unsigned long long, fs_cp_mio) |
Chao Yu | 8b83ac8 | 2020-04-16 18:16:56 +0800 | [diff] [blame] | 1842 | __field(unsigned long long, app_drio) |
| 1843 | __field(unsigned long long, app_brio) |
| 1844 | __field(unsigned long long, app_rio) |
| 1845 | __field(unsigned long long, app_mrio) |
| 1846 | __field(unsigned long long, fs_drio) |
Chao Yu | 9c12238 | 2020-04-23 18:03:06 +0800 | [diff] [blame] | 1847 | __field(unsigned long long, fs_gdrio) |
| 1848 | __field(unsigned long long, fs_cdrio) |
Chao Yu | 8b83ac8 | 2020-04-16 18:16:56 +0800 | [diff] [blame] | 1849 | __field(unsigned long long, fs_nrio) |
| 1850 | __field(unsigned long long, fs_mrio) |
Daeho Jeong | 2bc4bea | 2020-03-30 03:30:59 +0000 | [diff] [blame] | 1851 | __field(unsigned long long, fs_discard) |
| 1852 | ), |
| 1853 | |
| 1854 | TP_fast_assign( |
| 1855 | __entry->dev = sbi->sb->s_dev; |
| 1856 | __entry->app_dio = iostat[APP_DIRECT_IO]; |
| 1857 | __entry->app_bio = iostat[APP_BUFFERED_IO]; |
| 1858 | __entry->app_wio = iostat[APP_WRITE_IO]; |
| 1859 | __entry->app_mio = iostat[APP_MAPPED_IO]; |
| 1860 | __entry->fs_dio = iostat[FS_DATA_IO]; |
| 1861 | __entry->fs_nio = iostat[FS_NODE_IO]; |
| 1862 | __entry->fs_mio = iostat[FS_META_IO]; |
| 1863 | __entry->fs_gc_dio = iostat[FS_GC_DATA_IO]; |
| 1864 | __entry->fs_gc_nio = iostat[FS_GC_NODE_IO]; |
| 1865 | __entry->fs_cp_dio = iostat[FS_CP_DATA_IO]; |
| 1866 | __entry->fs_cp_nio = iostat[FS_CP_NODE_IO]; |
| 1867 | __entry->fs_cp_mio = iostat[FS_CP_META_IO]; |
Chao Yu | 8b83ac8 | 2020-04-16 18:16:56 +0800 | [diff] [blame] | 1868 | __entry->app_drio = iostat[APP_DIRECT_READ_IO]; |
| 1869 | __entry->app_brio = iostat[APP_BUFFERED_READ_IO]; |
| 1870 | __entry->app_rio = iostat[APP_READ_IO]; |
| 1871 | __entry->app_mrio = iostat[APP_MAPPED_READ_IO]; |
| 1872 | __entry->fs_drio = iostat[FS_DATA_READ_IO]; |
Chao Yu | 9c12238 | 2020-04-23 18:03:06 +0800 | [diff] [blame] | 1873 | __entry->fs_gdrio = iostat[FS_GDATA_READ_IO]; |
| 1874 | __entry->fs_cdrio = iostat[FS_CDATA_READ_IO]; |
Chao Yu | 8b83ac8 | 2020-04-16 18:16:56 +0800 | [diff] [blame] | 1875 | __entry->fs_nrio = iostat[FS_NODE_READ_IO]; |
| 1876 | __entry->fs_mrio = iostat[FS_META_READ_IO]; |
Daeho Jeong | 2bc4bea | 2020-03-30 03:30:59 +0000 | [diff] [blame] | 1877 | __entry->fs_discard = iostat[FS_DISCARD]; |
| 1878 | ), |
| 1879 | |
| 1880 | TP_printk("dev = (%d,%d), " |
| 1881 | "app [write=%llu (direct=%llu, buffered=%llu), mapped=%llu], " |
| 1882 | "fs [data=%llu, node=%llu, meta=%llu, discard=%llu], " |
| 1883 | "gc [data=%llu, node=%llu], " |
Chao Yu | 8b83ac8 | 2020-04-16 18:16:56 +0800 | [diff] [blame] | 1884 | "cp [data=%llu, node=%llu, meta=%llu], " |
| 1885 | "app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], " |
Chao Yu | 9c12238 | 2020-04-23 18:03:06 +0800 | [diff] [blame] | 1886 | "fs [data=%llu, (gc_data=%llu, compr_data=%llu), " |
| 1887 | "node=%llu, meta=%llu]", |
Daeho Jeong | 2bc4bea | 2020-03-30 03:30:59 +0000 | [diff] [blame] | 1888 | show_dev(__entry->dev), __entry->app_wio, __entry->app_dio, |
| 1889 | __entry->app_bio, __entry->app_mio, __entry->fs_dio, |
| 1890 | __entry->fs_nio, __entry->fs_mio, __entry->fs_discard, |
| 1891 | __entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio, |
Chao Yu | 8b83ac8 | 2020-04-16 18:16:56 +0800 | [diff] [blame] | 1892 | __entry->fs_cp_nio, __entry->fs_cp_mio, |
| 1893 | __entry->app_rio, __entry->app_drio, __entry->app_brio, |
Chao Yu | 9c12238 | 2020-04-23 18:03:06 +0800 | [diff] [blame] | 1894 | __entry->app_mrio, __entry->fs_drio, __entry->fs_gdrio, |
| 1895 | __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio) |
Daeho Jeong | 2bc4bea | 2020-03-30 03:30:59 +0000 | [diff] [blame] | 1896 | ); |
Daeho Jeong | a4b6817 | 2021-08-20 15:29:09 -0700 | [diff] [blame] | 1897 | |
| 1898 | #ifndef __F2FS_IOSTAT_LATENCY_TYPE |
| 1899 | #define __F2FS_IOSTAT_LATENCY_TYPE |
| 1900 | struct f2fs_iostat_latency { |
| 1901 | unsigned int peak_lat; |
| 1902 | unsigned int avg_lat; |
| 1903 | unsigned int cnt; |
| 1904 | }; |
| 1905 | #endif /* __F2FS_IOSTAT_LATENCY_TYPE */ |
| 1906 | |
| 1907 | TRACE_EVENT(f2fs_iostat_latency, |
| 1908 | |
| 1909 | TP_PROTO(struct f2fs_sb_info *sbi, struct f2fs_iostat_latency (*iostat_lat)[NR_PAGE_TYPE]), |
| 1910 | |
| 1911 | TP_ARGS(sbi, iostat_lat), |
| 1912 | |
| 1913 | TP_STRUCT__entry( |
| 1914 | __field(dev_t, dev) |
| 1915 | __field(unsigned int, d_rd_peak) |
| 1916 | __field(unsigned int, d_rd_avg) |
| 1917 | __field(unsigned int, d_rd_cnt) |
| 1918 | __field(unsigned int, n_rd_peak) |
| 1919 | __field(unsigned int, n_rd_avg) |
| 1920 | __field(unsigned int, n_rd_cnt) |
| 1921 | __field(unsigned int, m_rd_peak) |
| 1922 | __field(unsigned int, m_rd_avg) |
| 1923 | __field(unsigned int, m_rd_cnt) |
| 1924 | __field(unsigned int, d_wr_s_peak) |
| 1925 | __field(unsigned int, d_wr_s_avg) |
| 1926 | __field(unsigned int, d_wr_s_cnt) |
| 1927 | __field(unsigned int, n_wr_s_peak) |
| 1928 | __field(unsigned int, n_wr_s_avg) |
| 1929 | __field(unsigned int, n_wr_s_cnt) |
| 1930 | __field(unsigned int, m_wr_s_peak) |
| 1931 | __field(unsigned int, m_wr_s_avg) |
| 1932 | __field(unsigned int, m_wr_s_cnt) |
| 1933 | __field(unsigned int, d_wr_as_peak) |
| 1934 | __field(unsigned int, d_wr_as_avg) |
| 1935 | __field(unsigned int, d_wr_as_cnt) |
| 1936 | __field(unsigned int, n_wr_as_peak) |
| 1937 | __field(unsigned int, n_wr_as_avg) |
| 1938 | __field(unsigned int, n_wr_as_cnt) |
| 1939 | __field(unsigned int, m_wr_as_peak) |
| 1940 | __field(unsigned int, m_wr_as_avg) |
| 1941 | __field(unsigned int, m_wr_as_cnt) |
| 1942 | ), |
| 1943 | |
| 1944 | TP_fast_assign( |
| 1945 | __entry->dev = sbi->sb->s_dev; |
| 1946 | __entry->d_rd_peak = iostat_lat[0][DATA].peak_lat; |
| 1947 | __entry->d_rd_avg = iostat_lat[0][DATA].avg_lat; |
| 1948 | __entry->d_rd_cnt = iostat_lat[0][DATA].cnt; |
| 1949 | __entry->n_rd_peak = iostat_lat[0][NODE].peak_lat; |
| 1950 | __entry->n_rd_avg = iostat_lat[0][NODE].avg_lat; |
| 1951 | __entry->n_rd_cnt = iostat_lat[0][NODE].cnt; |
| 1952 | __entry->m_rd_peak = iostat_lat[0][META].peak_lat; |
| 1953 | __entry->m_rd_avg = iostat_lat[0][META].avg_lat; |
| 1954 | __entry->m_rd_cnt = iostat_lat[0][META].cnt; |
| 1955 | __entry->d_wr_s_peak = iostat_lat[1][DATA].peak_lat; |
| 1956 | __entry->d_wr_s_avg = iostat_lat[1][DATA].avg_lat; |
| 1957 | __entry->d_wr_s_cnt = iostat_lat[1][DATA].cnt; |
| 1958 | __entry->n_wr_s_peak = iostat_lat[1][NODE].peak_lat; |
| 1959 | __entry->n_wr_s_avg = iostat_lat[1][NODE].avg_lat; |
| 1960 | __entry->n_wr_s_cnt = iostat_lat[1][NODE].cnt; |
| 1961 | __entry->m_wr_s_peak = iostat_lat[1][META].peak_lat; |
| 1962 | __entry->m_wr_s_avg = iostat_lat[1][META].avg_lat; |
| 1963 | __entry->m_wr_s_cnt = iostat_lat[1][META].cnt; |
| 1964 | __entry->d_wr_as_peak = iostat_lat[2][DATA].peak_lat; |
| 1965 | __entry->d_wr_as_avg = iostat_lat[2][DATA].avg_lat; |
| 1966 | __entry->d_wr_as_cnt = iostat_lat[2][DATA].cnt; |
| 1967 | __entry->n_wr_as_peak = iostat_lat[2][NODE].peak_lat; |
| 1968 | __entry->n_wr_as_avg = iostat_lat[2][NODE].avg_lat; |
| 1969 | __entry->n_wr_as_cnt = iostat_lat[2][NODE].cnt; |
| 1970 | __entry->m_wr_as_peak = iostat_lat[2][META].peak_lat; |
| 1971 | __entry->m_wr_as_avg = iostat_lat[2][META].avg_lat; |
| 1972 | __entry->m_wr_as_cnt = iostat_lat[2][META].cnt; |
| 1973 | ), |
| 1974 | |
| 1975 | TP_printk("dev = (%d,%d), " |
| 1976 | "iotype [peak lat.(ms)/avg lat.(ms)/count], " |
| 1977 | "rd_data [%u/%u/%u], rd_node [%u/%u/%u], rd_meta [%u/%u/%u], " |
| 1978 | "wr_sync_data [%u/%u/%u], wr_sync_node [%u/%u/%u], " |
| 1979 | "wr_sync_meta [%u/%u/%u], wr_async_data [%u/%u/%u], " |
| 1980 | "wr_async_node [%u/%u/%u], wr_async_meta [%u/%u/%u]", |
| 1981 | show_dev(__entry->dev), |
| 1982 | __entry->d_rd_peak, __entry->d_rd_avg, __entry->d_rd_cnt, |
| 1983 | __entry->n_rd_peak, __entry->n_rd_avg, __entry->n_rd_cnt, |
| 1984 | __entry->m_rd_peak, __entry->m_rd_avg, __entry->m_rd_cnt, |
| 1985 | __entry->d_wr_s_peak, __entry->d_wr_s_avg, __entry->d_wr_s_cnt, |
| 1986 | __entry->n_wr_s_peak, __entry->n_wr_s_avg, __entry->n_wr_s_cnt, |
| 1987 | __entry->m_wr_s_peak, __entry->m_wr_s_avg, __entry->m_wr_s_cnt, |
| 1988 | __entry->d_wr_as_peak, __entry->d_wr_as_avg, __entry->d_wr_as_cnt, |
| 1989 | __entry->n_wr_as_peak, __entry->n_wr_as_avg, __entry->n_wr_as_cnt, |
| 1990 | __entry->m_wr_as_peak, __entry->m_wr_as_avg, __entry->m_wr_as_cnt) |
| 1991 | ); |
Daeho Jeong | 5211874 | 2021-08-19 20:52:28 -0700 | [diff] [blame] | 1992 | #endif |
Daeho Jeong | 2bc4bea | 2020-03-30 03:30:59 +0000 | [diff] [blame] | 1993 | |
Chao Yu | b79b0a3 | 2020-06-29 20:13:12 +0800 | [diff] [blame] | 1994 | TRACE_EVENT(f2fs_bmap, |
| 1995 | |
| 1996 | TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock), |
| 1997 | |
| 1998 | TP_ARGS(inode, lblock, pblock), |
| 1999 | |
| 2000 | TP_STRUCT__entry( |
| 2001 | __field(dev_t, dev) |
| 2002 | __field(ino_t, ino) |
| 2003 | __field(sector_t, lblock) |
| 2004 | __field(sector_t, pblock) |
| 2005 | ), |
| 2006 | |
| 2007 | TP_fast_assign( |
| 2008 | __entry->dev = inode->i_sb->s_dev; |
| 2009 | __entry->ino = inode->i_ino; |
| 2010 | __entry->lblock = lblock; |
| 2011 | __entry->pblock = pblock; |
| 2012 | ), |
| 2013 | |
| 2014 | TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld", |
| 2015 | show_dev_ino(__entry), |
| 2016 | (unsigned long long)__entry->lblock, |
| 2017 | (unsigned long long)__entry->pblock) |
| 2018 | ); |
| 2019 | |
Chao Yu | dd5a09b | 2020-06-29 20:13:13 +0800 | [diff] [blame] | 2020 | TRACE_EVENT(f2fs_fiemap, |
| 2021 | |
| 2022 | TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock, |
| 2023 | unsigned long long len, unsigned int flags, int ret), |
| 2024 | |
| 2025 | TP_ARGS(inode, lblock, pblock, len, flags, ret), |
| 2026 | |
| 2027 | TP_STRUCT__entry( |
| 2028 | __field(dev_t, dev) |
| 2029 | __field(ino_t, ino) |
| 2030 | __field(sector_t, lblock) |
| 2031 | __field(sector_t, pblock) |
| 2032 | __field(unsigned long long, len) |
| 2033 | __field(unsigned int, flags) |
| 2034 | __field(int, ret) |
| 2035 | ), |
| 2036 | |
| 2037 | TP_fast_assign( |
| 2038 | __entry->dev = inode->i_sb->s_dev; |
| 2039 | __entry->ino = inode->i_ino; |
| 2040 | __entry->lblock = lblock; |
| 2041 | __entry->pblock = pblock; |
| 2042 | __entry->len = len; |
| 2043 | __entry->flags = flags; |
| 2044 | __entry->ret = ret; |
| 2045 | ), |
| 2046 | |
| 2047 | TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, " |
| 2048 | "len:%llu, flags:%u, ret:%d", |
| 2049 | show_dev_ino(__entry), |
| 2050 | (unsigned long long)__entry->lblock, |
| 2051 | (unsigned long long)__entry->pblock, |
| 2052 | __entry->len, |
| 2053 | __entry->flags, |
| 2054 | __entry->ret) |
| 2055 | ); |
| 2056 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 2057 | #endif /* _TRACE_F2FS_H */ |
| 2058 | |
| 2059 | /* This part must be outside protection */ |
| 2060 | #include <trace/define_trace.h> |