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