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