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