blob: 8f8dd42fa57bd39c0a07cb15ece2249e8bb8928e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09002#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 Kimd50aaee2017-02-15 11:14:06 -080010#define show_dev(dev) MAJOR(dev), MINOR(dev)
11#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
Namjae Jeon6ec178d2013-04-23 17:51:43 +090012
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040013TRACE_DEFINE_ENUM(NODE);
14TRACE_DEFINE_ENUM(DATA);
15TRACE_DEFINE_ENUM(META);
16TRACE_DEFINE_ENUM(META_FLUSH);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070017TRACE_DEFINE_ENUM(INMEM);
18TRACE_DEFINE_ENUM(INMEM_DROP);
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080019TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
Chao Yua58f2442017-03-17 18:46:14 +080020TRACE_DEFINE_ENUM(INMEM_REVOKE);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070021TRACE_DEFINE_ENUM(IPU);
22TRACE_DEFINE_ENUM(OPU);
Jaegeuk Kima912b542017-05-10 11:18:25 -070023TRACE_DEFINE_ENUM(HOT);
24TRACE_DEFINE_ENUM(WARM);
25TRACE_DEFINE_ENUM(COLD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040026TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
27TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
28TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
29TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
30TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
31TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
32TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
33TRACE_DEFINE_ENUM(GC_GREEDY);
34TRACE_DEFINE_ENUM(GC_CB);
35TRACE_DEFINE_ENUM(FG_GC);
36TRACE_DEFINE_ENUM(BG_GC);
37TRACE_DEFINE_ENUM(LFS);
38TRACE_DEFINE_ENUM(SSR);
39TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040040TRACE_DEFINE_ENUM(__REQ_SYNC);
Christoph Hellwiga2b80962016-11-01 07:40:09 -060041TRACE_DEFINE_ENUM(__REQ_IDLE);
Mike Christie28a8f0d2016-06-05 14:32:25 -050042TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040043TRACE_DEFINE_ENUM(__REQ_FUA);
44TRACE_DEFINE_ENUM(__REQ_PRIO);
45TRACE_DEFINE_ENUM(__REQ_META);
46TRACE_DEFINE_ENUM(CP_UMOUNT);
47TRACE_DEFINE_ENUM(CP_FASTBOOT);
48TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070049TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040050TRACE_DEFINE_ENUM(CP_DISCARD);
Chao Yu1f43e2a2017-04-28 13:56:08 +080051TRACE_DEFINE_ENUM(CP_TRIMMED);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040052
Namjae Jeon6ec178d2013-04-23 17:51:43 +090053#define show_block_type(type) \
54 __print_symbolic(type, \
55 { NODE, "NODE" }, \
56 { DATA, "DATA" }, \
57 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070058 { META_FLUSH, "META_FLUSH" }, \
59 { INMEM, "INMEM" }, \
60 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080061 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080062 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070063 { IPU, "IN-PLACE" }, \
64 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090065
Jaegeuk Kima912b542017-05-10 11:18:25 -070066#define show_block_temp(temp) \
67 __print_symbolic(temp, \
68 { HOT, "HOT" }, \
69 { WARM, "WARM" }, \
70 { COLD, "COLD" })
71
Chao Yubaaabbb2017-05-04 09:35:43 +080072#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
73 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080074#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090075
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080076#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 Christie04d328d2016-06-05 14:31:55 -050090
91#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080092 __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 Kima709f4a2013-11-24 14:42:23 +090099
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900100#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 Kim26c6b882013-10-24 17:53:29 +0900110#define show_file_type(type) \
111 __print_symbolic(type, \
112 { 0, "FILE" }, \
113 { 1, "DIR" })
114
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900115#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 Kim75ab4cb2014-09-20 21:57:51 -0700130#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800131 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700132 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800133 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700134 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700135 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800136 { CP_DISCARD, "Discard" }, \
Chao Yubaaabbb2017-05-04 09:35:43 +0800137 { CP_UMOUNT, "Umount" }, \
138 { CP_TRIMMED, "Trimmed" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700139
Chao Yua5fd5052017-11-06 22:51:45 +0800140#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 Jeon8e46b3e2013-04-23 16:42:53 +0900152struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700153struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900154
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900155DECLARE_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
194DECLARE_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
217DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
218
219 TP_PROTO(struct inode *inode),
220
221 TP_ARGS(inode)
222);
223
224TRACE_EVENT(f2fs_sync_file_exit,
225
Chao Yua5fd5052017-11-06 22:51:45 +0800226 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900227
Chao Yua5fd5052017-11-06 22:51:45 +0800228 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900229
230 TP_STRUCT__entry(
231 __field(dev_t, dev)
232 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800233 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900234 __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 Yua5fd5052017-11-06 22:51:45 +0800241 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900242 __entry->datasync = datasync;
243 __entry->ret = ret;
244 ),
245
Chao Yua5fd5052017-11-06 22:51:45 +0800246 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900247 "datasync = %d, ret = %d",
248 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800249 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900250 __entry->datasync,
251 __entry->ret)
252);
253
254TRACE_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 Kim29e70432015-02-10 16:23:12 -0800262 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900263 __field(int, wait)
264 ),
265
266 TP_fast_assign(
267 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800268 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900269 __entry->wait = wait;
270 ),
271
272 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800273 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900274 __entry->dirty ? "dirty" : "not dirty",
275 __entry->wait)
276);
277
278DEFINE_EVENT(f2fs__inode, f2fs_iget,
279
280 TP_PROTO(struct inode *inode),
281
282 TP_ARGS(inode)
283);
284
285DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
286
287 TP_PROTO(struct inode *inode, int ret),
288
289 TP_ARGS(inode, ret)
290);
291
292DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
293
294 TP_PROTO(struct inode *inode),
295
296 TP_ARGS(inode)
297);
298
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900299DEFINE_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 Jeona2a4a7e2013-04-20 01:28:40 +0900306TRACE_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
336DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
337
338 TP_PROTO(struct inode *inode, int ret),
339
340 TP_ARGS(inode, ret)
341);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900342
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000343DEFINE_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 Jeon51dd6242013-04-20 01:28:52 +0900350DEFINE_EVENT(f2fs__inode, f2fs_truncate,
351
352 TP_PROTO(struct inode *inode),
353
354 TP_ARGS(inode)
355);
356
357TRACE_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
386DECLARE_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
416DEFINE_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
423DEFINE_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
430DEFINE_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
437DEFINE_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
444DECLARE_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
470DEFINE_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
477DEFINE_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
484DEFINE_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
491TRACE_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 Kim003a3e12015-04-06 19:55:34 -0700525TRACE_EVENT(f2fs_map_blocks,
526 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900527
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700528 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900529
530 TP_STRUCT__entry(
531 __field(dev_t, dev)
532 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700533 __field(block_t, m_lblk)
534 __field(block_t, m_pblk)
535 __field(unsigned int, m_len)
Namjae Jeon848753a2013-04-23 16:38:02 +0900536 __field(int, ret)
537 ),
538
539 TP_fast_assign(
540 __entry->dev = inode->i_sb->s_dev;
541 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700542 __entry->m_lblk = map->m_lblk;
543 __entry->m_pblk = map->m_pblk;
544 __entry->m_len = map->m_len;
Namjae Jeon848753a2013-04-23 16:38:02 +0900545 __entry->ret = ret;
546 ),
547
548 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700549 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900550 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700551 (unsigned long long)__entry->m_lblk,
552 (unsigned long long)__entry->m_pblk,
553 (unsigned long long)__entry->m_len,
Namjae Jeon848753a2013-04-23 16:38:02 +0900554 __entry->ret)
555);
556
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700557TRACE_EVENT(f2fs_background_gc,
558
Chao Yub8c502b2017-08-07 23:12:46 +0800559 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700560 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 Yub8c502b2017-08-07 23:12:46 +0800566 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700567 __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 Yub8c502b2017-08-07 23:12:46 +0800578 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800579 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700580 __entry->wait_ms,
581 __entry->prefree,
582 __entry->free)
583);
584
Chao Yuc56f16d2017-08-11 18:00:15 +0800585TRACE_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
637TRACE_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 Jeon8e46b3e2013-04-23 16:42:53 +0900692TRACE_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 Kim5012de22017-02-16 10:35:41 -0800707 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900708 __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 Kim5012de22017-02-16 10:35:41 -0800721 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900722 __entry->ofs_unit = p->ofs_unit;
723 __entry->pre_victim = pre_victim;
724 __entry->prefree = prefree;
725 __entry->free = free;
726 ),
727
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800728 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 Kimd50aaee2017-02-15 11:14:06 -0800731 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900732 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 Kim5012de22017-02-16 10:35:41 -0800737 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900738 __entry->ofs_unit,
739 (int)__entry->pre_victim,
740 __entry->prefree,
741 __entry->free)
742);
743
Chao Yu0c5e36d2017-10-17 17:33:41 +0800744TRACE_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
770TRACE_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 Yue97a3c42017-10-13 18:01:33 +0800800TRACE_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 Jeonc01e2852013-04-23 17:00:52 +0900829TRACE_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 Yu70407fad2014-07-31 21:11:22 +0800869TRACE_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
898TRACE_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 Yu46008c62016-05-09 19:56:30 +0800932TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900933
Chao Yu46008c62016-05-09 19:56:30 +0800934 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
935 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900936
Chao Yu46008c62016-05-09 19:56:30 +0800937 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900938
939 TP_STRUCT__entry(
940 __field(dev_t, dev)
941 __field(nid_t, nid)
942 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800943 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900944 ),
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 Yu46008c62016-05-09 19:56:30 +0800950 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +0900951 ),
952
Chao Yu46008c62016-05-09 19:56:30 +0800953 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800954 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900955 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +0800956 __entry->ofs_in_node,
957 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900958);
959
Chao Yu3e1c8f12014-12-23 16:35:21 +0800960DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
961
Chao Yu2ace38e2014-12-24 16:08:14 +0800962 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800963
Chao Yu2ace38e2014-12-24 16:08:14 +0800964 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800965
966 TP_STRUCT__entry(
967 __field(dev_t, dev)
968 __field(ino_t, ino)
969 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +0800970 __field(block_t, old_blkaddr)
971 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -0500972 __field(int, op)
973 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -0700974 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +0800975 __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 Yu7a9d7542016-02-22 18:36:38 +0800982 __entry->old_blkaddr = fio->old_blkaddr;
983 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -0500984 __entry->op = fio->op;
985 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -0700986 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +0800987 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +0800988 ),
989
990 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -0700991 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +0800992 show_dev_ino(__entry),
993 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +0800994 (unsigned long long)__entry->old_blkaddr,
995 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -0800996 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -0700997 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800998 show_block_type(__entry->type))
999);
1000
1001DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1002
Chao Yu2ace38e2014-12-24 16:08:14 +08001003 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001004
Chao Yu2ace38e2014-12-24 16:08:14 +08001005 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001006
1007 TP_CONDITION(page->mapping)
1008);
1009
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001010DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001011
Chao Yu2ace38e2014-12-24 16:08:14 +08001012 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001013
Chao Yu2ace38e2014-12-24 16:08:14 +08001014 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001015
1016 TP_CONDITION(page->mapping)
1017);
1018
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001019DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001020
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001021 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001022
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001023 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001024
1025 TP_STRUCT__entry(
1026 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001027 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001028 __field(int, op)
1029 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001030 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001031 __field(sector_t, sector)
1032 __field(unsigned int, size)
1033 ),
1034
1035 TP_fast_assign(
1036 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001037 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001038 __entry->op = bio_op(bio);
1039 __entry->op_flags = bio->bi_opf;
1040 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001041 __entry->sector = bio->bi_iter.bi_sector;
1042 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001043 ),
1044
Chao Yubaaabbb2017-05-04 09:35:43 +08001045 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001046 show_dev(__entry->target),
1047 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001048 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001049 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001050 (unsigned long long)__entry->sector,
1051 __entry->size)
1052);
1053
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001054DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001055
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001056 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001057
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001058 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001059
1060 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001061);
1062
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001063DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001064
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001065 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001066
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001067 TP_ARGS(sb, type, bio),
1068
1069 TP_CONDITION(bio)
1070);
1071
1072DEFINE_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
1081DEFINE_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 Kim93dfe2a2013-11-30 12:51:14 +09001086
1087 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001088);
1089
Chao Yu62aed042014-05-06 16:46:04 +08001090TRACE_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 Yudfb2bf32014-05-06 16:47:23 +08001120TRACE_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 Kim26c6b882013-10-24 17:53:29 +09001150DECLARE_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 Yuc20e89c2014-05-06 16:53:08 +08001163 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001164 ),
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 Yuc20e89c2014-05-06 16:53:08 +08001173 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001174 ),
1175
Chao Yuc20e89c2014-05-06 16:53:08 +08001176 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1177 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001178 show_dev_ino(__entry),
1179 show_block_type(__entry->type),
1180 show_file_type(__entry->dir),
1181 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001182 __entry->dirty,
1183 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001184);
1185
Chao Yuecda0de2014-05-06 16:48:26 +08001186DEFINE_EVENT(f2fs__page, f2fs_writepage,
1187
1188 TP_PROTO(struct page *page, int type),
1189
1190 TP_ARGS(page, type)
1191);
1192
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001193DEFINE_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 Yuc20e89c2014-05-06 16:53:08 +08001200DEFINE_EVENT(f2fs__page, f2fs_readpage,
1201
1202 TP_PROTO(struct page *page, int type),
1203
1204 TP_ARGS(page, type)
1205);
1206
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001207DEFINE_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 Kime943a102013-10-25 14:26:31 +09001214DEFINE_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 Kim8ce67cb2015-03-17 17:58:08 -07001221DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1222
1223 TP_PROTO(struct page *page, int type),
1224
1225 TP_ARGS(page, type)
1226);
1227
1228DEFINE_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 Yue5748432014-05-06 16:51:24 +08001235TRACE_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 Yub8c29402015-10-12 17:02:26 +08001299TRACE_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 Jeon2af4bd62013-04-23 18:26:54 +09001325TRACE_EVENT(f2fs_write_checkpoint,
1326
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001327 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001328
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001329 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001330
1331 TP_STRUCT__entry(
1332 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001333 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001334 __field(char *, msg)
1335 ),
1336
1337 TP_fast_assign(
1338 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001339 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001340 __entry->msg = msg;
1341 ),
1342
1343 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001344 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001345 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001346 __entry->msg)
1347);
1348
Chao Yu0243a5f2017-04-15 14:09:38 +08001349DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001350
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001351 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001352
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001353 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001354
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 Kimd50aaee2017-02-15 11:14:06 -08001362 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001363 __entry->blkstart = blkstart;
1364 __entry->blklen = blklen;
1365 ),
1366
1367 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001368 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001369 (unsigned long long)__entry->blkstart,
1370 (unsigned long long)__entry->blklen)
1371);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001372
Chao Yu0243a5f2017-04-15 14:09:38 +08001373DEFINE_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
1380DEFINE_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 Yu2ec6f2e2017-10-04 09:08:36 +08001387DEFINE_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 Moal126606c2016-10-28 17:45:07 +09001394TRACE_EVENT(f2fs_issue_reset_zone,
1395
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001396 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001397
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001398 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001399
1400 TP_STRUCT__entry(
1401 __field(dev_t, dev)
1402 __field(block_t, blkstart)
1403 ),
1404
1405 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001406 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001407 __entry->blkstart = blkstart;
1408 ),
1409
1410 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001411 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001412 (unsigned long long)__entry->blkstart)
1413);
1414
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001415TRACE_EVENT(f2fs_issue_flush,
1416
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001417 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001418 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001419
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001420 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001421
1422 TP_STRUCT__entry(
1423 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001424 __field(unsigned int, nobarrier)
1425 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001426 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001427 ),
1428
1429 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001430 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001431 __entry->nobarrier = nobarrier;
1432 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001433 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001434 ),
1435
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001436 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001437 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001438 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001439 __entry->flush_merge ? " with flush_merge" : "",
1440 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001441);
Chao Yu1ec46102015-02-05 17:59:59 +08001442
1443TRACE_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
1466TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1467
1468 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001469 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001470
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001471 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001472
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001473 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001474
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 Kim84bc9262015-06-29 16:01:14 -07001488 __entry->fofs = ei->fofs;
1489 __entry->blk = ei->blk;
1490 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001491 ),
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 Yu744288c2015-09-06 17:50:13 +08001502TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001503
Chao Yu744288c2015-09-06 17:50:13 +08001504 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1505 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001506
Chao Yu744288c2015-09-06 17:50:13 +08001507 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001508
1509 TP_STRUCT__entry(
1510 __field(dev_t, dev)
1511 __field(ino_t, ino)
1512 __field(unsigned int, pgofs)
1513 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001514 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001515 ),
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 Yu744288c2015-09-06 17:50:13 +08001522 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001523 ),
1524
Chao Yu744288c2015-09-06 17:50:13 +08001525 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1526 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001527 show_dev_ino(__entry),
1528 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001529 __entry->blk,
1530 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001531);
1532
1533TRACE_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 Kimd50aaee2017-02-15 11:14:06 -08001553 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001554 __entry->node_cnt,
1555 __entry->tree_cnt)
1556);
1557
1558TRACE_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 Yu4cf18532015-12-17 17:17:16 +08001581DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1582
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001583 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001584
1585 TP_ARGS(sb, type, count),
1586
1587 TP_STRUCT__entry(
1588 __field(dev_t, dev)
1589 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001590 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001591 ),
1592
1593 TP_fast_assign(
1594 __entry->dev = sb->s_dev;
1595 __entry->type = type;
1596 __entry->count = count;
1597 ),
1598
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001599 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001600 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001601 show_file_type(__entry->type),
1602 __entry->count)
1603);
1604
1605DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1606
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001607 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001608
1609 TP_ARGS(sb, type, count)
1610);
1611
1612DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1613
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001614 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001615
1616 TP_ARGS(sb, type, count)
1617);
1618
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001619#endif /* _TRACE_F2FS_H */
1620
1621 /* This part must be outside protection */
1622#include <trace/define_trace.h>