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