blob: 30d30399db026d249ad32b4675351b27d363fe89 [file] [log] [blame]
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM f2fs
3
4#if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_F2FS_H
6
7#include <linux/tracepoint.h>
8
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08009#define show_dev(dev) MAJOR(dev), MINOR(dev)
10#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
Namjae Jeon6ec178d2013-04-23 17:51:43 +090011
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040012TRACE_DEFINE_ENUM(NODE);
13TRACE_DEFINE_ENUM(DATA);
14TRACE_DEFINE_ENUM(META);
15TRACE_DEFINE_ENUM(META_FLUSH);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070016TRACE_DEFINE_ENUM(INMEM);
17TRACE_DEFINE_ENUM(INMEM_DROP);
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080018TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
Chao Yua58f2442017-03-17 18:46:14 +080019TRACE_DEFINE_ENUM(INMEM_REVOKE);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070020TRACE_DEFINE_ENUM(IPU);
21TRACE_DEFINE_ENUM(OPU);
Jaegeuk Kima912b542017-05-10 11:18:25 -070022TRACE_DEFINE_ENUM(HOT);
23TRACE_DEFINE_ENUM(WARM);
24TRACE_DEFINE_ENUM(COLD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040025TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
26TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
27TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
28TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
29TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
30TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
31TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
32TRACE_DEFINE_ENUM(GC_GREEDY);
33TRACE_DEFINE_ENUM(GC_CB);
34TRACE_DEFINE_ENUM(FG_GC);
35TRACE_DEFINE_ENUM(BG_GC);
36TRACE_DEFINE_ENUM(LFS);
37TRACE_DEFINE_ENUM(SSR);
38TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040039TRACE_DEFINE_ENUM(__REQ_SYNC);
Christoph Hellwiga2b80962016-11-01 07:40:09 -060040TRACE_DEFINE_ENUM(__REQ_IDLE);
Mike Christie28a8f0d2016-06-05 14:32:25 -050041TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040042TRACE_DEFINE_ENUM(__REQ_FUA);
43TRACE_DEFINE_ENUM(__REQ_PRIO);
44TRACE_DEFINE_ENUM(__REQ_META);
45TRACE_DEFINE_ENUM(CP_UMOUNT);
46TRACE_DEFINE_ENUM(CP_FASTBOOT);
47TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070048TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040049TRACE_DEFINE_ENUM(CP_DISCARD);
Chao Yu1f43e2a2017-04-28 13:56:08 +080050TRACE_DEFINE_ENUM(CP_TRIMMED);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040051
Namjae Jeon6ec178d2013-04-23 17:51:43 +090052#define show_block_type(type) \
53 __print_symbolic(type, \
54 { NODE, "NODE" }, \
55 { DATA, "DATA" }, \
56 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070057 { META_FLUSH, "META_FLUSH" }, \
58 { INMEM, "INMEM" }, \
59 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080060 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080061 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070062 { IPU, "IN-PLACE" }, \
63 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090064
Jaegeuk Kima912b542017-05-10 11:18:25 -070065#define show_block_temp(temp) \
66 __print_symbolic(temp, \
67 { HOT, "HOT" }, \
68 { WARM, "WARM" }, \
69 { COLD, "COLD" })
70
Chao Yubaaabbb2017-05-04 09:35:43 +080071#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
72 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080073#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090074
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080075#define show_bio_type(op,op_flags) show_bio_op(op), \
76 show_bio_op_flags(op_flags)
77
78#define show_bio_op(op) \
79 __print_symbolic(op, \
80 { REQ_OP_READ, "READ" }, \
81 { REQ_OP_WRITE, "WRITE" }, \
82 { REQ_OP_FLUSH, "FLUSH" }, \
83 { REQ_OP_DISCARD, "DISCARD" }, \
84 { REQ_OP_ZONE_REPORT, "ZONE_REPORT" }, \
85 { REQ_OP_SECURE_ERASE, "SECURE_ERASE" }, \
86 { REQ_OP_ZONE_RESET, "ZONE_RESET" }, \
87 { REQ_OP_WRITE_SAME, "WRITE_SAME" }, \
88 { REQ_OP_WRITE_ZEROES, "WRITE_ZEROES" })
Mike Christie04d328d2016-06-05 14:31:55 -050089
90#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080091 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
92 { REQ_RAHEAD, "R" }, \
93 { REQ_SYNC, "S" }, \
94 { REQ_META, "M" }, \
95 { REQ_PRIO, "P" }, \
96 { REQ_PREFLUSH, "PF" }, \
97 { REQ_FUA, "FUA" })
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090098
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090099#define show_data_type(type) \
100 __print_symbolic(type, \
101 { CURSEG_HOT_DATA, "Hot DATA" }, \
102 { CURSEG_WARM_DATA, "Warm DATA" }, \
103 { CURSEG_COLD_DATA, "Cold DATA" }, \
104 { CURSEG_HOT_NODE, "Hot NODE" }, \
105 { CURSEG_WARM_NODE, "Warm NODE" }, \
106 { CURSEG_COLD_NODE, "Cold NODE" }, \
107 { NO_CHECK_TYPE, "No TYPE" })
108
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900109#define show_file_type(type) \
110 __print_symbolic(type, \
111 { 0, "FILE" }, \
112 { 1, "DIR" })
113
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900114#define show_gc_type(type) \
115 __print_symbolic(type, \
116 { FG_GC, "Foreground GC" }, \
117 { BG_GC, "Background GC" })
118
119#define show_alloc_mode(type) \
120 __print_symbolic(type, \
121 { LFS, "LFS-mode" }, \
122 { SSR, "SSR-mode" })
123
124#define show_victim_policy(type) \
125 __print_symbolic(type, \
126 { GC_GREEDY, "Greedy" }, \
127 { GC_CB, "Cost-Benefit" })
128
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700129#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800130 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700131 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800132 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700133 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700134 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800135 { CP_DISCARD, "Discard" }, \
Chao Yubaaabbb2017-05-04 09:35:43 +0800136 { CP_UMOUNT, "Umount" }, \
137 { CP_TRIMMED, "Trimmed" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700138
Chao Yua5fd5052017-11-06 22:51:45 +0800139#define show_fsync_cpreason(type) \
140 __print_symbolic(type, \
141 { CP_NO_NEEDED, "no needed" }, \
142 { CP_NON_REGULAR, "non regular" }, \
143 { CP_HARDLINK, "hardlink" }, \
144 { CP_SB_NEED_CP, "sb needs cp" }, \
145 { CP_WRONG_PINO, "wrong pino" }, \
146 { CP_NO_SPC_ROLL, "no space roll forward" }, \
147 { CP_NODE_NEED_CP, "node needs cp" }, \
148 { CP_FASTBOOT_MODE, "fastboot mode" }, \
149 { CP_SPEC_LOG_NUM, "log type is 2" })
150
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900151struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700152struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900153
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900154DECLARE_EVENT_CLASS(f2fs__inode,
155
156 TP_PROTO(struct inode *inode),
157
158 TP_ARGS(inode),
159
160 TP_STRUCT__entry(
161 __field(dev_t, dev)
162 __field(ino_t, ino)
163 __field(ino_t, pino)
164 __field(umode_t, mode)
165 __field(loff_t, size)
166 __field(unsigned int, nlink)
167 __field(blkcnt_t, blocks)
168 __field(__u8, advise)
169 ),
170
171 TP_fast_assign(
172 __entry->dev = inode->i_sb->s_dev;
173 __entry->ino = inode->i_ino;
174 __entry->pino = F2FS_I(inode)->i_pino;
175 __entry->mode = inode->i_mode;
176 __entry->nlink = inode->i_nlink;
177 __entry->size = inode->i_size;
178 __entry->blocks = inode->i_blocks;
179 __entry->advise = F2FS_I(inode)->i_advise;
180 ),
181
182 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
183 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
184 show_dev_ino(__entry),
185 (unsigned long)__entry->pino,
186 __entry->mode,
187 __entry->size,
188 (unsigned int)__entry->nlink,
189 (unsigned long long)__entry->blocks,
190 (unsigned char)__entry->advise)
191);
192
193DECLARE_EVENT_CLASS(f2fs__inode_exit,
194
195 TP_PROTO(struct inode *inode, int ret),
196
197 TP_ARGS(inode, ret),
198
199 TP_STRUCT__entry(
200 __field(dev_t, dev)
201 __field(ino_t, ino)
202 __field(int, ret)
203 ),
204
205 TP_fast_assign(
206 __entry->dev = inode->i_sb->s_dev;
207 __entry->ino = inode->i_ino;
208 __entry->ret = ret;
209 ),
210
211 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
212 show_dev_ino(__entry),
213 __entry->ret)
214);
215
216DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
217
218 TP_PROTO(struct inode *inode),
219
220 TP_ARGS(inode)
221);
222
223TRACE_EVENT(f2fs_sync_file_exit,
224
Chao Yua5fd5052017-11-06 22:51:45 +0800225 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900226
Chao Yua5fd5052017-11-06 22:51:45 +0800227 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900228
229 TP_STRUCT__entry(
230 __field(dev_t, dev)
231 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800232 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900233 __field(int, datasync)
234 __field(int, ret)
235 ),
236
237 TP_fast_assign(
238 __entry->dev = inode->i_sb->s_dev;
239 __entry->ino = inode->i_ino;
Chao Yua5fd5052017-11-06 22:51:45 +0800240 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900241 __entry->datasync = datasync;
242 __entry->ret = ret;
243 ),
244
Chao Yua5fd5052017-11-06 22:51:45 +0800245 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900246 "datasync = %d, ret = %d",
247 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800248 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900249 __entry->datasync,
250 __entry->ret)
251);
252
253TRACE_EVENT(f2fs_sync_fs,
254
255 TP_PROTO(struct super_block *sb, int wait),
256
257 TP_ARGS(sb, wait),
258
259 TP_STRUCT__entry(
260 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800261 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900262 __field(int, wait)
263 ),
264
265 TP_fast_assign(
266 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800267 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900268 __entry->wait = wait;
269 ),
270
271 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800272 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900273 __entry->dirty ? "dirty" : "not dirty",
274 __entry->wait)
275);
276
277DEFINE_EVENT(f2fs__inode, f2fs_iget,
278
279 TP_PROTO(struct inode *inode),
280
281 TP_ARGS(inode)
282);
283
284DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
285
286 TP_PROTO(struct inode *inode, int ret),
287
288 TP_ARGS(inode, ret)
289);
290
291DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
292
293 TP_PROTO(struct inode *inode),
294
295 TP_ARGS(inode)
296);
297
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900298DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
299
300 TP_PROTO(struct inode *inode, int ret),
301
302 TP_ARGS(inode, ret)
303);
304
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900305TRACE_EVENT(f2fs_unlink_enter,
306
307 TP_PROTO(struct inode *dir, struct dentry *dentry),
308
309 TP_ARGS(dir, dentry),
310
311 TP_STRUCT__entry(
312 __field(dev_t, dev)
313 __field(ino_t, ino)
314 __field(loff_t, size)
315 __field(blkcnt_t, blocks)
316 __field(const char *, name)
317 ),
318
319 TP_fast_assign(
320 __entry->dev = dir->i_sb->s_dev;
321 __entry->ino = dir->i_ino;
322 __entry->size = dir->i_size;
323 __entry->blocks = dir->i_blocks;
324 __entry->name = dentry->d_name.name;
325 ),
326
327 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
328 "i_blocks = %llu, name = %s",
329 show_dev_ino(__entry),
330 __entry->size,
331 (unsigned long long)__entry->blocks,
332 __entry->name)
333);
334
335DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
336
337 TP_PROTO(struct inode *inode, int ret),
338
339 TP_ARGS(inode, ret)
340);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900341
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000342DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
343
344 TP_PROTO(struct inode *inode, int ret),
345
346 TP_ARGS(inode, ret)
347);
348
Namjae Jeon51dd6242013-04-20 01:28:52 +0900349DEFINE_EVENT(f2fs__inode, f2fs_truncate,
350
351 TP_PROTO(struct inode *inode),
352
353 TP_ARGS(inode)
354);
355
356TRACE_EVENT(f2fs_truncate_data_blocks_range,
357
358 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
359
360 TP_ARGS(inode, nid, ofs, free),
361
362 TP_STRUCT__entry(
363 __field(dev_t, dev)
364 __field(ino_t, ino)
365 __field(nid_t, nid)
366 __field(unsigned int, ofs)
367 __field(int, free)
368 ),
369
370 TP_fast_assign(
371 __entry->dev = inode->i_sb->s_dev;
372 __entry->ino = inode->i_ino;
373 __entry->nid = nid;
374 __entry->ofs = ofs;
375 __entry->free = free;
376 ),
377
378 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
379 show_dev_ino(__entry),
380 (unsigned int)__entry->nid,
381 __entry->ofs,
382 __entry->free)
383);
384
385DECLARE_EVENT_CLASS(f2fs__truncate_op,
386
387 TP_PROTO(struct inode *inode, u64 from),
388
389 TP_ARGS(inode, from),
390
391 TP_STRUCT__entry(
392 __field(dev_t, dev)
393 __field(ino_t, ino)
394 __field(loff_t, size)
395 __field(blkcnt_t, blocks)
396 __field(u64, from)
397 ),
398
399 TP_fast_assign(
400 __entry->dev = inode->i_sb->s_dev;
401 __entry->ino = inode->i_ino;
402 __entry->size = inode->i_size;
403 __entry->blocks = inode->i_blocks;
404 __entry->from = from;
405 ),
406
407 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
408 "start file offset = %llu",
409 show_dev_ino(__entry),
410 __entry->size,
411 (unsigned long long)__entry->blocks,
412 (unsigned long long)__entry->from)
413);
414
415DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
416
417 TP_PROTO(struct inode *inode, u64 from),
418
419 TP_ARGS(inode, from)
420);
421
422DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
423
424 TP_PROTO(struct inode *inode, int ret),
425
426 TP_ARGS(inode, ret)
427);
428
429DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
430
431 TP_PROTO(struct inode *inode, u64 from),
432
433 TP_ARGS(inode, from)
434);
435
436DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
437
438 TP_PROTO(struct inode *inode, int ret),
439
440 TP_ARGS(inode, ret)
441);
442
443DECLARE_EVENT_CLASS(f2fs__truncate_node,
444
445 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
446
447 TP_ARGS(inode, nid, blk_addr),
448
449 TP_STRUCT__entry(
450 __field(dev_t, dev)
451 __field(ino_t, ino)
452 __field(nid_t, nid)
453 __field(block_t, blk_addr)
454 ),
455
456 TP_fast_assign(
457 __entry->dev = inode->i_sb->s_dev;
458 __entry->ino = inode->i_ino;
459 __entry->nid = nid;
460 __entry->blk_addr = blk_addr;
461 ),
462
463 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
464 show_dev_ino(__entry),
465 (unsigned int)__entry->nid,
466 (unsigned long long)__entry->blk_addr)
467);
468
469DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
470
471 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
472
473 TP_ARGS(inode, nid, blk_addr)
474);
475
476DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
477
478 TP_PROTO(struct inode *inode, int ret),
479
480 TP_ARGS(inode, ret)
481);
482
483DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
484
485 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
486
487 TP_ARGS(inode, nid, blk_addr)
488);
489
490TRACE_EVENT(f2fs_truncate_partial_nodes,
491
492 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
493
494 TP_ARGS(inode, nid, depth, err),
495
496 TP_STRUCT__entry(
497 __field(dev_t, dev)
498 __field(ino_t, ino)
499 __field(nid_t, nid[3])
500 __field(int, depth)
501 __field(int, err)
502 ),
503
504 TP_fast_assign(
505 __entry->dev = inode->i_sb->s_dev;
506 __entry->ino = inode->i_ino;
507 __entry->nid[0] = nid[0];
508 __entry->nid[1] = nid[1];
509 __entry->nid[2] = nid[2];
510 __entry->depth = depth;
511 __entry->err = err;
512 ),
513
514 TP_printk("dev = (%d,%d), ino = %lu, "
515 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
516 show_dev_ino(__entry),
517 (unsigned int)__entry->nid[0],
518 (unsigned int)__entry->nid[1],
519 (unsigned int)__entry->nid[2],
520 __entry->depth,
521 __entry->err)
522);
523
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700524TRACE_EVENT(f2fs_map_blocks,
525 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900526
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700527 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900528
529 TP_STRUCT__entry(
530 __field(dev_t, dev)
531 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700532 __field(block_t, m_lblk)
533 __field(block_t, m_pblk)
534 __field(unsigned int, m_len)
Namjae Jeon848753a2013-04-23 16:38:02 +0900535 __field(int, ret)
536 ),
537
538 TP_fast_assign(
539 __entry->dev = inode->i_sb->s_dev;
540 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700541 __entry->m_lblk = map->m_lblk;
542 __entry->m_pblk = map->m_pblk;
543 __entry->m_len = map->m_len;
Namjae Jeon848753a2013-04-23 16:38:02 +0900544 __entry->ret = ret;
545 ),
546
547 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700548 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900549 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700550 (unsigned long long)__entry->m_lblk,
551 (unsigned long long)__entry->m_pblk,
552 (unsigned long long)__entry->m_len,
Namjae Jeon848753a2013-04-23 16:38:02 +0900553 __entry->ret)
554);
555
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700556TRACE_EVENT(f2fs_background_gc,
557
Chao Yub8c502b2017-08-07 23:12:46 +0800558 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700559 unsigned int prefree, unsigned int free),
560
561 TP_ARGS(sb, wait_ms, prefree, free),
562
563 TP_STRUCT__entry(
564 __field(dev_t, dev)
Chao Yub8c502b2017-08-07 23:12:46 +0800565 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700566 __field(unsigned int, prefree)
567 __field(unsigned int, free)
568 ),
569
570 TP_fast_assign(
571 __entry->dev = sb->s_dev;
572 __entry->wait_ms = wait_ms;
573 __entry->prefree = prefree;
574 __entry->free = free;
575 ),
576
Chao Yub8c502b2017-08-07 23:12:46 +0800577 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800578 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700579 __entry->wait_ms,
580 __entry->prefree,
581 __entry->free)
582);
583
Chao Yuc56f16d2017-08-11 18:00:15 +0800584TRACE_EVENT(f2fs_gc_begin,
585
586 TP_PROTO(struct super_block *sb, bool sync, bool background,
587 long long dirty_nodes, long long dirty_dents,
588 long long dirty_imeta, unsigned int free_sec,
589 unsigned int free_seg, int reserved_seg,
590 unsigned int prefree_seg),
591
592 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
593 free_sec, free_seg, reserved_seg, prefree_seg),
594
595 TP_STRUCT__entry(
596 __field(dev_t, dev)
597 __field(bool, sync)
598 __field(bool, background)
599 __field(long long, dirty_nodes)
600 __field(long long, dirty_dents)
601 __field(long long, dirty_imeta)
602 __field(unsigned int, free_sec)
603 __field(unsigned int, free_seg)
604 __field(int, reserved_seg)
605 __field(unsigned int, prefree_seg)
606 ),
607
608 TP_fast_assign(
609 __entry->dev = sb->s_dev;
610 __entry->sync = sync;
611 __entry->background = background;
612 __entry->dirty_nodes = dirty_nodes;
613 __entry->dirty_dents = dirty_dents;
614 __entry->dirty_imeta = dirty_imeta;
615 __entry->free_sec = free_sec;
616 __entry->free_seg = free_seg;
617 __entry->reserved_seg = reserved_seg;
618 __entry->prefree_seg = prefree_seg;
619 ),
620
621 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
622 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
623 "rsv_seg:%d, prefree_seg:%u",
624 show_dev(__entry->dev),
625 __entry->sync,
626 __entry->background,
627 __entry->dirty_nodes,
628 __entry->dirty_dents,
629 __entry->dirty_imeta,
630 __entry->free_sec,
631 __entry->free_seg,
632 __entry->reserved_seg,
633 __entry->prefree_seg)
634);
635
636TRACE_EVENT(f2fs_gc_end,
637
638 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
639 int sec_freed, long long dirty_nodes,
640 long long dirty_dents, long long dirty_imeta,
641 unsigned int free_sec, unsigned int free_seg,
642 int reserved_seg, unsigned int prefree_seg),
643
644 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
645 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
646
647 TP_STRUCT__entry(
648 __field(dev_t, dev)
649 __field(int, ret)
650 __field(int, seg_freed)
651 __field(int, sec_freed)
652 __field(long long, dirty_nodes)
653 __field(long long, dirty_dents)
654 __field(long long, dirty_imeta)
655 __field(unsigned int, free_sec)
656 __field(unsigned int, free_seg)
657 __field(int, reserved_seg)
658 __field(unsigned int, prefree_seg)
659 ),
660
661 TP_fast_assign(
662 __entry->dev = sb->s_dev;
663 __entry->ret = ret;
664 __entry->seg_freed = seg_freed;
665 __entry->sec_freed = sec_freed;
666 __entry->dirty_nodes = dirty_nodes;
667 __entry->dirty_dents = dirty_dents;
668 __entry->dirty_imeta = dirty_imeta;
669 __entry->free_sec = free_sec;
670 __entry->free_seg = free_seg;
671 __entry->reserved_seg = reserved_seg;
672 __entry->prefree_seg = prefree_seg;
673 ),
674
675 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
676 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
677 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
678 show_dev(__entry->dev),
679 __entry->ret,
680 __entry->seg_freed,
681 __entry->sec_freed,
682 __entry->dirty_nodes,
683 __entry->dirty_dents,
684 __entry->dirty_imeta,
685 __entry->free_sec,
686 __entry->free_seg,
687 __entry->reserved_seg,
688 __entry->prefree_seg)
689);
690
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900691TRACE_EVENT(f2fs_get_victim,
692
693 TP_PROTO(struct super_block *sb, int type, int gc_type,
694 struct victim_sel_policy *p, unsigned int pre_victim,
695 unsigned int prefree, unsigned int free),
696
697 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
698
699 TP_STRUCT__entry(
700 __field(dev_t, dev)
701 __field(int, type)
702 __field(int, gc_type)
703 __field(int, alloc_mode)
704 __field(int, gc_mode)
705 __field(unsigned int, victim)
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800706 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900707 __field(unsigned int, ofs_unit)
708 __field(unsigned int, pre_victim)
709 __field(unsigned int, prefree)
710 __field(unsigned int, free)
711 ),
712
713 TP_fast_assign(
714 __entry->dev = sb->s_dev;
715 __entry->type = type;
716 __entry->gc_type = gc_type;
717 __entry->alloc_mode = p->alloc_mode;
718 __entry->gc_mode = p->gc_mode;
719 __entry->victim = p->min_segno;
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800720 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900721 __entry->ofs_unit = p->ofs_unit;
722 __entry->pre_victim = pre_victim;
723 __entry->prefree = prefree;
724 __entry->free = free;
725 ),
726
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800727 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
728 "victim = %u, cost = %u, ofs_unit = %u, "
729 "pre_victim_secno = %d, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800730 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900731 show_data_type(__entry->type),
732 show_gc_type(__entry->gc_type),
733 show_alloc_mode(__entry->alloc_mode),
734 show_victim_policy(__entry->gc_mode),
735 __entry->victim,
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800736 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900737 __entry->ofs_unit,
738 (int)__entry->pre_victim,
739 __entry->prefree,
740 __entry->free)
741);
742
Chao Yu0c5e36d2017-10-17 17:33:41 +0800743TRACE_EVENT(f2fs_lookup_start,
744
745 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
746
747 TP_ARGS(dir, dentry, flags),
748
749 TP_STRUCT__entry(
750 __field(dev_t, dev)
751 __field(ino_t, ino)
752 __field(const char *, name)
753 __field(unsigned int, flags)
754 ),
755
756 TP_fast_assign(
757 __entry->dev = dir->i_sb->s_dev;
758 __entry->ino = dir->i_ino;
759 __entry->name = dentry->d_name.name;
760 __entry->flags = flags;
761 ),
762
763 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
764 show_dev_ino(__entry),
765 __entry->name,
766 __entry->flags)
767);
768
769TRACE_EVENT(f2fs_lookup_end,
770
771 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
772 int err),
773
774 TP_ARGS(dir, dentry, ino, err),
775
776 TP_STRUCT__entry(
777 __field(dev_t, dev)
778 __field(ino_t, ino)
779 __field(const char *, name)
780 __field(nid_t, cino)
781 __field(int, err)
782 ),
783
784 TP_fast_assign(
785 __entry->dev = dir->i_sb->s_dev;
786 __entry->ino = dir->i_ino;
787 __entry->name = dentry->d_name.name;
788 __entry->cino = ino;
789 __entry->err = err;
790 ),
791
792 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
793 show_dev_ino(__entry),
794 __entry->name,
795 __entry->cino,
796 __entry->err)
797);
798
Chao Yue97a3c42017-10-13 18:01:33 +0800799TRACE_EVENT(f2fs_readdir,
800
801 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
802
803 TP_ARGS(dir, start_pos, end_pos, err),
804
805 TP_STRUCT__entry(
806 __field(dev_t, dev)
807 __field(ino_t, ino)
808 __field(loff_t, start)
809 __field(loff_t, end)
810 __field(int, err)
811 ),
812
813 TP_fast_assign(
814 __entry->dev = dir->i_sb->s_dev;
815 __entry->ino = dir->i_ino;
816 __entry->start = start_pos;
817 __entry->end = end_pos;
818 __entry->err = err;
819 ),
820
821 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
822 show_dev_ino(__entry),
823 __entry->start,
824 __entry->end,
825 __entry->err)
826);
827
Namjae Jeonc01e2852013-04-23 17:00:52 +0900828TRACE_EVENT(f2fs_fallocate,
829
830 TP_PROTO(struct inode *inode, int mode,
831 loff_t offset, loff_t len, int ret),
832
833 TP_ARGS(inode, mode, offset, len, ret),
834
835 TP_STRUCT__entry(
836 __field(dev_t, dev)
837 __field(ino_t, ino)
838 __field(int, mode)
839 __field(loff_t, offset)
840 __field(loff_t, len)
841 __field(loff_t, size)
842 __field(blkcnt_t, blocks)
843 __field(int, ret)
844 ),
845
846 TP_fast_assign(
847 __entry->dev = inode->i_sb->s_dev;
848 __entry->ino = inode->i_ino;
849 __entry->mode = mode;
850 __entry->offset = offset;
851 __entry->len = len;
852 __entry->size = inode->i_size;
853 __entry->blocks = inode->i_blocks;
854 __entry->ret = ret;
855 ),
856
857 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
858 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
859 show_dev_ino(__entry),
860 __entry->mode,
861 (unsigned long long)__entry->offset,
862 (unsigned long long)__entry->len,
863 (unsigned long long)__entry->size,
864 (unsigned long long)__entry->blocks,
865 __entry->ret)
866);
867
Chao Yu70407fa2014-07-31 21:11:22 +0800868TRACE_EVENT(f2fs_direct_IO_enter,
869
870 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
871
872 TP_ARGS(inode, offset, len, rw),
873
874 TP_STRUCT__entry(
875 __field(dev_t, dev)
876 __field(ino_t, ino)
877 __field(loff_t, pos)
878 __field(unsigned long, len)
879 __field(int, rw)
880 ),
881
882 TP_fast_assign(
883 __entry->dev = inode->i_sb->s_dev;
884 __entry->ino = inode->i_ino;
885 __entry->pos = offset;
886 __entry->len = len;
887 __entry->rw = rw;
888 ),
889
890 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
891 show_dev_ino(__entry),
892 __entry->pos,
893 __entry->len,
894 __entry->rw)
895);
896
897TRACE_EVENT(f2fs_direct_IO_exit,
898
899 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
900 int rw, int ret),
901
902 TP_ARGS(inode, offset, len, rw, ret),
903
904 TP_STRUCT__entry(
905 __field(dev_t, dev)
906 __field(ino_t, ino)
907 __field(loff_t, pos)
908 __field(unsigned long, len)
909 __field(int, rw)
910 __field(int, ret)
911 ),
912
913 TP_fast_assign(
914 __entry->dev = inode->i_sb->s_dev;
915 __entry->ino = inode->i_ino;
916 __entry->pos = offset;
917 __entry->len = len;
918 __entry->rw = rw;
919 __entry->ret = ret;
920 ),
921
922 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
923 "rw = %d ret = %d",
924 show_dev_ino(__entry),
925 __entry->pos,
926 __entry->len,
927 __entry->rw,
928 __entry->ret)
929);
930
Chao Yu46008c62016-05-09 19:56:30 +0800931TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900932
Chao Yu46008c62016-05-09 19:56:30 +0800933 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
934 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900935
Chao Yu46008c62016-05-09 19:56:30 +0800936 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900937
938 TP_STRUCT__entry(
939 __field(dev_t, dev)
940 __field(nid_t, nid)
941 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800942 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900943 ),
944
945 TP_fast_assign(
946 __entry->dev = inode->i_sb->s_dev;
947 __entry->nid = nid;
948 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +0800949 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +0900950 ),
951
Chao Yu46008c62016-05-09 19:56:30 +0800952 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800953 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900954 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +0800955 __entry->ofs_in_node,
956 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900957);
958
Chao Yu3e1c8f12014-12-23 16:35:21 +0800959DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
960
Chao Yu2ace38e2014-12-24 16:08:14 +0800961 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800962
Chao Yu2ace38e2014-12-24 16:08:14 +0800963 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800964
965 TP_STRUCT__entry(
966 __field(dev_t, dev)
967 __field(ino_t, ino)
968 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +0800969 __field(block_t, old_blkaddr)
970 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -0500971 __field(int, op)
972 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -0700973 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +0800974 __field(int, type)
975 ),
976
977 TP_fast_assign(
978 __entry->dev = page->mapping->host->i_sb->s_dev;
979 __entry->ino = page->mapping->host->i_ino;
980 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +0800981 __entry->old_blkaddr = fio->old_blkaddr;
982 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -0500983 __entry->op = fio->op;
984 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -0700985 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +0800986 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +0800987 ),
988
989 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -0700990 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +0800991 show_dev_ino(__entry),
992 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +0800993 (unsigned long long)__entry->old_blkaddr,
994 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -0800995 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -0700996 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800997 show_block_type(__entry->type))
998);
999
1000DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1001
Chao Yu2ace38e2014-12-24 16:08:14 +08001002 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001003
Chao Yu2ace38e2014-12-24 16:08:14 +08001004 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001005
1006 TP_CONDITION(page->mapping)
1007);
1008
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001009DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001010
Chao Yu2ace38e2014-12-24 16:08:14 +08001011 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001012
Chao Yu2ace38e2014-12-24 16:08:14 +08001013 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001014
1015 TP_CONDITION(page->mapping)
1016);
1017
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001018DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001019
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001020 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001021
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001022 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001023
1024 TP_STRUCT__entry(
1025 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001026 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001027 __field(int, op)
1028 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001029 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001030 __field(sector_t, sector)
1031 __field(unsigned int, size)
1032 ),
1033
1034 TP_fast_assign(
1035 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001036 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001037 __entry->op = bio_op(bio);
1038 __entry->op_flags = bio->bi_opf;
1039 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001040 __entry->sector = bio->bi_iter.bi_sector;
1041 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001042 ),
1043
Chao Yubaaabbb2017-05-04 09:35:43 +08001044 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001045 show_dev(__entry->target),
1046 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001047 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001048 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001049 (unsigned long long)__entry->sector,
1050 __entry->size)
1051);
1052
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001053DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001054
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001055 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001056
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001057 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001058
1059 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001060);
1061
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001062DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001063
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001064 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001065
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001066 TP_ARGS(sb, type, bio),
1067
1068 TP_CONDITION(bio)
1069);
1070
1071DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1072
1073 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1074
1075 TP_ARGS(sb, type, bio),
1076
1077 TP_CONDITION(bio)
1078);
1079
1080DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1081
1082 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1083
1084 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001085
1086 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001087);
1088
Chao Yu62aed042014-05-06 16:46:04 +08001089TRACE_EVENT(f2fs_write_begin,
1090
1091 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1092 unsigned int flags),
1093
1094 TP_ARGS(inode, pos, len, flags),
1095
1096 TP_STRUCT__entry(
1097 __field(dev_t, dev)
1098 __field(ino_t, ino)
1099 __field(loff_t, pos)
1100 __field(unsigned int, len)
1101 __field(unsigned int, flags)
1102 ),
1103
1104 TP_fast_assign(
1105 __entry->dev = inode->i_sb->s_dev;
1106 __entry->ino = inode->i_ino;
1107 __entry->pos = pos;
1108 __entry->len = len;
1109 __entry->flags = flags;
1110 ),
1111
1112 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1113 show_dev_ino(__entry),
1114 (unsigned long long)__entry->pos,
1115 __entry->len,
1116 __entry->flags)
1117);
1118
Chao Yudfb2bf32014-05-06 16:47:23 +08001119TRACE_EVENT(f2fs_write_end,
1120
1121 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1122 unsigned int copied),
1123
1124 TP_ARGS(inode, pos, len, copied),
1125
1126 TP_STRUCT__entry(
1127 __field(dev_t, dev)
1128 __field(ino_t, ino)
1129 __field(loff_t, pos)
1130 __field(unsigned int, len)
1131 __field(unsigned int, copied)
1132 ),
1133
1134 TP_fast_assign(
1135 __entry->dev = inode->i_sb->s_dev;
1136 __entry->ino = inode->i_ino;
1137 __entry->pos = pos;
1138 __entry->len = len;
1139 __entry->copied = copied;
1140 ),
1141
1142 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1143 show_dev_ino(__entry),
1144 (unsigned long long)__entry->pos,
1145 __entry->len,
1146 __entry->copied)
1147);
1148
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001149DECLARE_EVENT_CLASS(f2fs__page,
1150
1151 TP_PROTO(struct page *page, int type),
1152
1153 TP_ARGS(page, type),
1154
1155 TP_STRUCT__entry(
1156 __field(dev_t, dev)
1157 __field(ino_t, ino)
1158 __field(int, type)
1159 __field(int, dir)
1160 __field(pgoff_t, index)
1161 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +08001162 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001163 ),
1164
1165 TP_fast_assign(
1166 __entry->dev = page->mapping->host->i_sb->s_dev;
1167 __entry->ino = page->mapping->host->i_ino;
1168 __entry->type = type;
1169 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
1170 __entry->index = page->index;
1171 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +08001172 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001173 ),
1174
Chao Yuc20e89c2014-05-06 16:53:08 +08001175 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1176 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001177 show_dev_ino(__entry),
1178 show_block_type(__entry->type),
1179 show_file_type(__entry->dir),
1180 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001181 __entry->dirty,
1182 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001183);
1184
Chao Yuecda0de2014-05-06 16:48:26 +08001185DEFINE_EVENT(f2fs__page, f2fs_writepage,
1186
1187 TP_PROTO(struct page *page, int type),
1188
1189 TP_ARGS(page, type)
1190);
1191
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001192DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1193
1194 TP_PROTO(struct page *page, int type),
1195
1196 TP_ARGS(page, type)
1197);
1198
Chao Yuc20e89c2014-05-06 16:53:08 +08001199DEFINE_EVENT(f2fs__page, f2fs_readpage,
1200
1201 TP_PROTO(struct page *page, int type),
1202
1203 TP_ARGS(page, type)
1204);
1205
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001206DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1207
1208 TP_PROTO(struct page *page, int type),
1209
1210 TP_ARGS(page, type)
1211);
1212
Jaegeuk Kime943a102013-10-25 14:26:31 +09001213DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1214
1215 TP_PROTO(struct page *page, int type),
1216
1217 TP_ARGS(page, type)
1218);
1219
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001220DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1221
1222 TP_PROTO(struct page *page, int type),
1223
1224 TP_ARGS(page, type)
1225);
1226
1227DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1228
1229 TP_PROTO(struct page *page, int type),
1230
1231 TP_ARGS(page, type)
1232);
1233
Chao Yue5748432014-05-06 16:51:24 +08001234TRACE_EVENT(f2fs_writepages,
1235
1236 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1237
1238 TP_ARGS(inode, wbc, type),
1239
1240 TP_STRUCT__entry(
1241 __field(dev_t, dev)
1242 __field(ino_t, ino)
1243 __field(int, type)
1244 __field(int, dir)
1245 __field(long, nr_to_write)
1246 __field(long, pages_skipped)
1247 __field(loff_t, range_start)
1248 __field(loff_t, range_end)
1249 __field(pgoff_t, writeback_index)
1250 __field(int, sync_mode)
1251 __field(char, for_kupdate)
1252 __field(char, for_background)
1253 __field(char, tagged_writepages)
1254 __field(char, for_reclaim)
1255 __field(char, range_cyclic)
1256 __field(char, for_sync)
1257 ),
1258
1259 TP_fast_assign(
1260 __entry->dev = inode->i_sb->s_dev;
1261 __entry->ino = inode->i_ino;
1262 __entry->type = type;
1263 __entry->dir = S_ISDIR(inode->i_mode);
1264 __entry->nr_to_write = wbc->nr_to_write;
1265 __entry->pages_skipped = wbc->pages_skipped;
1266 __entry->range_start = wbc->range_start;
1267 __entry->range_end = wbc->range_end;
1268 __entry->writeback_index = inode->i_mapping->writeback_index;
1269 __entry->sync_mode = wbc->sync_mode;
1270 __entry->for_kupdate = wbc->for_kupdate;
1271 __entry->for_background = wbc->for_background;
1272 __entry->tagged_writepages = wbc->tagged_writepages;
1273 __entry->for_reclaim = wbc->for_reclaim;
1274 __entry->range_cyclic = wbc->range_cyclic;
1275 __entry->for_sync = wbc->for_sync;
1276 ),
1277
1278 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1279 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1280 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1281 show_dev_ino(__entry),
1282 show_block_type(__entry->type),
1283 show_file_type(__entry->dir),
1284 __entry->nr_to_write,
1285 __entry->pages_skipped,
1286 __entry->range_start,
1287 __entry->range_end,
1288 (unsigned long)__entry->writeback_index,
1289 __entry->sync_mode,
1290 __entry->for_kupdate,
1291 __entry->for_background,
1292 __entry->tagged_writepages,
1293 __entry->for_reclaim,
1294 __entry->range_cyclic,
1295 __entry->for_sync)
1296);
1297
Chao Yub8c29402015-10-12 17:02:26 +08001298TRACE_EVENT(f2fs_readpages,
1299
1300 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1301
1302 TP_ARGS(inode, page, nrpage),
1303
1304 TP_STRUCT__entry(
1305 __field(dev_t, dev)
1306 __field(ino_t, ino)
1307 __field(pgoff_t, start)
1308 __field(unsigned int, nrpage)
1309 ),
1310
1311 TP_fast_assign(
1312 __entry->dev = inode->i_sb->s_dev;
1313 __entry->ino = inode->i_ino;
1314 __entry->start = page->index;
1315 __entry->nrpage = nrpage;
1316 ),
1317
1318 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1319 show_dev_ino(__entry),
1320 (unsigned long)__entry->start,
1321 __entry->nrpage)
1322);
1323
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001324TRACE_EVENT(f2fs_write_checkpoint,
1325
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001326 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001327
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001328 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001329
1330 TP_STRUCT__entry(
1331 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001332 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001333 __field(char *, msg)
1334 ),
1335
1336 TP_fast_assign(
1337 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001338 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001339 __entry->msg = msg;
1340 ),
1341
1342 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001343 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001344 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001345 __entry->msg)
1346);
1347
Chao Yu0243a5f2017-04-15 14:09:38 +08001348DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001349
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001350 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001351
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001352 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001353
1354 TP_STRUCT__entry(
1355 __field(dev_t, dev)
1356 __field(block_t, blkstart)
1357 __field(block_t, blklen)
1358 ),
1359
1360 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001361 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001362 __entry->blkstart = blkstart;
1363 __entry->blklen = blklen;
1364 ),
1365
1366 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001367 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001368 (unsigned long long)__entry->blkstart,
1369 (unsigned long long)__entry->blklen)
1370);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001371
Chao Yu0243a5f2017-04-15 14:09:38 +08001372DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1373
1374 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1375
1376 TP_ARGS(dev, blkstart, blklen)
1377);
1378
1379DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1380
1381 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1382
1383 TP_ARGS(dev, blkstart, blklen)
1384);
1385
Chao Yu2ec6f2e2017-10-04 09:08:36 +08001386DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1387
1388 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1389
1390 TP_ARGS(dev, blkstart, blklen)
1391);
1392
Damien Le Moal126606c2016-10-28 17:45:07 +09001393TRACE_EVENT(f2fs_issue_reset_zone,
1394
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001395 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001396
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001397 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001398
1399 TP_STRUCT__entry(
1400 __field(dev_t, dev)
1401 __field(block_t, blkstart)
1402 ),
1403
1404 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001405 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001406 __entry->blkstart = blkstart;
1407 ),
1408
1409 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001410 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001411 (unsigned long long)__entry->blkstart)
1412);
1413
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001414TRACE_EVENT(f2fs_issue_flush,
1415
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001416 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001417 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001418
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001419 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001420
1421 TP_STRUCT__entry(
1422 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001423 __field(unsigned int, nobarrier)
1424 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001425 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001426 ),
1427
1428 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001429 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001430 __entry->nobarrier = nobarrier;
1431 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001432 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001433 ),
1434
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001435 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001436 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001437 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001438 __entry->flush_merge ? " with flush_merge" : "",
1439 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001440);
Chao Yu1ec46102015-02-05 17:59:59 +08001441
1442TRACE_EVENT(f2fs_lookup_extent_tree_start,
1443
1444 TP_PROTO(struct inode *inode, unsigned int pgofs),
1445
1446 TP_ARGS(inode, pgofs),
1447
1448 TP_STRUCT__entry(
1449 __field(dev_t, dev)
1450 __field(ino_t, ino)
1451 __field(unsigned int, pgofs)
1452 ),
1453
1454 TP_fast_assign(
1455 __entry->dev = inode->i_sb->s_dev;
1456 __entry->ino = inode->i_ino;
1457 __entry->pgofs = pgofs;
1458 ),
1459
1460 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1461 show_dev_ino(__entry),
1462 __entry->pgofs)
1463);
1464
1465TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1466
1467 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001468 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001469
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001470 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001471
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001472 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001473
1474 TP_STRUCT__entry(
1475 __field(dev_t, dev)
1476 __field(ino_t, ino)
1477 __field(unsigned int, pgofs)
1478 __field(unsigned int, fofs)
1479 __field(u32, blk)
1480 __field(unsigned int, len)
1481 ),
1482
1483 TP_fast_assign(
1484 __entry->dev = inode->i_sb->s_dev;
1485 __entry->ino = inode->i_ino;
1486 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001487 __entry->fofs = ei->fofs;
1488 __entry->blk = ei->blk;
1489 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001490 ),
1491
1492 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1493 "ext_info(fofs: %u, blk: %u, len: %u)",
1494 show_dev_ino(__entry),
1495 __entry->pgofs,
1496 __entry->fofs,
1497 __entry->blk,
1498 __entry->len)
1499);
1500
Chao Yu744288c2015-09-06 17:50:13 +08001501TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001502
Chao Yu744288c2015-09-06 17:50:13 +08001503 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1504 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001505
Chao Yu744288c2015-09-06 17:50:13 +08001506 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001507
1508 TP_STRUCT__entry(
1509 __field(dev_t, dev)
1510 __field(ino_t, ino)
1511 __field(unsigned int, pgofs)
1512 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001513 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001514 ),
1515
1516 TP_fast_assign(
1517 __entry->dev = inode->i_sb->s_dev;
1518 __entry->ino = inode->i_ino;
1519 __entry->pgofs = pgofs;
1520 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001521 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001522 ),
1523
Chao Yu744288c2015-09-06 17:50:13 +08001524 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1525 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001526 show_dev_ino(__entry),
1527 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001528 __entry->blk,
1529 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001530);
1531
1532TRACE_EVENT(f2fs_shrink_extent_tree,
1533
1534 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1535 unsigned int tree_cnt),
1536
1537 TP_ARGS(sbi, node_cnt, tree_cnt),
1538
1539 TP_STRUCT__entry(
1540 __field(dev_t, dev)
1541 __field(unsigned int, node_cnt)
1542 __field(unsigned int, tree_cnt)
1543 ),
1544
1545 TP_fast_assign(
1546 __entry->dev = sbi->sb->s_dev;
1547 __entry->node_cnt = node_cnt;
1548 __entry->tree_cnt = tree_cnt;
1549 ),
1550
1551 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001552 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001553 __entry->node_cnt,
1554 __entry->tree_cnt)
1555);
1556
1557TRACE_EVENT(f2fs_destroy_extent_tree,
1558
1559 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1560
1561 TP_ARGS(inode, node_cnt),
1562
1563 TP_STRUCT__entry(
1564 __field(dev_t, dev)
1565 __field(ino_t, ino)
1566 __field(unsigned int, node_cnt)
1567 ),
1568
1569 TP_fast_assign(
1570 __entry->dev = inode->i_sb->s_dev;
1571 __entry->ino = inode->i_ino;
1572 __entry->node_cnt = node_cnt;
1573 ),
1574
1575 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1576 show_dev_ino(__entry),
1577 __entry->node_cnt)
1578);
1579
Chao Yu4cf18532015-12-17 17:17:16 +08001580DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1581
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001582 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001583
1584 TP_ARGS(sb, type, count),
1585
1586 TP_STRUCT__entry(
1587 __field(dev_t, dev)
1588 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001589 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001590 ),
1591
1592 TP_fast_assign(
1593 __entry->dev = sb->s_dev;
1594 __entry->type = type;
1595 __entry->count = count;
1596 ),
1597
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001598 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001599 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001600 show_file_type(__entry->type),
1601 __entry->count)
1602);
1603
1604DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1605
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001606 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001607
1608 TP_ARGS(sb, type, count)
1609);
1610
1611DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1612
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001613 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001614
1615 TP_ARGS(sb, type, count)
1616);
1617
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001618#endif /* _TRACE_F2FS_H */
1619
1620 /* This part must be outside protection */
1621#include <trace/define_trace.h>