blob: 04c527410ecceb68a208841a055f16dbd8d02db7 [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
9#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
10#define show_dev_ino(entry) show_dev(entry), (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);
18TRACE_DEFINE_ENUM(IPU);
19TRACE_DEFINE_ENUM(OPU);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040020TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
21TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
22TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
23TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
24TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
25TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
26TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
27TRACE_DEFINE_ENUM(GC_GREEDY);
28TRACE_DEFINE_ENUM(GC_CB);
29TRACE_DEFINE_ENUM(FG_GC);
30TRACE_DEFINE_ENUM(BG_GC);
31TRACE_DEFINE_ENUM(LFS);
32TRACE_DEFINE_ENUM(SSR);
33TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040034TRACE_DEFINE_ENUM(__REQ_SYNC);
Christoph Hellwiga2b80962016-11-01 07:40:09 -060035TRACE_DEFINE_ENUM(__REQ_IDLE);
Mike Christie28a8f0d2016-06-05 14:32:25 -050036TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040037TRACE_DEFINE_ENUM(__REQ_FUA);
38TRACE_DEFINE_ENUM(__REQ_PRIO);
39TRACE_DEFINE_ENUM(__REQ_META);
40TRACE_DEFINE_ENUM(CP_UMOUNT);
41TRACE_DEFINE_ENUM(CP_FASTBOOT);
42TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070043TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040044TRACE_DEFINE_ENUM(CP_DISCARD);
45
Namjae Jeon6ec178d2013-04-23 17:51:43 +090046#define show_block_type(type) \
47 __print_symbolic(type, \
48 { NODE, "NODE" }, \
49 { DATA, "DATA" }, \
50 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070051 { META_FLUSH, "META_FLUSH" }, \
52 { INMEM, "INMEM" }, \
53 { INMEM_DROP, "INMEM_DROP" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080054 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070055 { IPU, "IN-PLACE" }, \
56 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090057
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080058#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_PREFLUSH | REQ_META |\
59 REQ_PRIO)
60#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090061
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080062#define show_bio_type(op,op_flags) show_bio_op(op), \
63 show_bio_op_flags(op_flags)
64
65#define show_bio_op(op) \
66 __print_symbolic(op, \
67 { REQ_OP_READ, "READ" }, \
68 { REQ_OP_WRITE, "WRITE" }, \
69 { REQ_OP_FLUSH, "FLUSH" }, \
70 { REQ_OP_DISCARD, "DISCARD" }, \
71 { REQ_OP_ZONE_REPORT, "ZONE_REPORT" }, \
72 { REQ_OP_SECURE_ERASE, "SECURE_ERASE" }, \
73 { REQ_OP_ZONE_RESET, "ZONE_RESET" }, \
74 { REQ_OP_WRITE_SAME, "WRITE_SAME" }, \
75 { REQ_OP_WRITE_ZEROES, "WRITE_ZEROES" })
Mike Christie04d328d2016-06-05 14:31:55 -050076
77#define show_bio_op_flags(flags) \
78 __print_symbolic(F2FS_BIO_FLAG_MASK(flags), \
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080079 { REQ_RAHEAD, "(RA)" }, \
80 { REQ_SYNC, "(S)" }, \
81 { REQ_SYNC | REQ_PRIO, "(SP)" }, \
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090082 { REQ_META, "(M)" }, \
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090083 { REQ_META | REQ_PRIO, "(MP)" }, \
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080084 { REQ_SYNC | REQ_META | REQ_PRIO, "(SMP)" }, \
85 { REQ_PREFLUSH | REQ_META | REQ_PRIO, "(FMP)" }, \
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090086 { 0, " \b" })
87
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090088#define show_data_type(type) \
89 __print_symbolic(type, \
90 { CURSEG_HOT_DATA, "Hot DATA" }, \
91 { CURSEG_WARM_DATA, "Warm DATA" }, \
92 { CURSEG_COLD_DATA, "Cold DATA" }, \
93 { CURSEG_HOT_NODE, "Hot NODE" }, \
94 { CURSEG_WARM_NODE, "Warm NODE" }, \
95 { CURSEG_COLD_NODE, "Cold NODE" }, \
96 { NO_CHECK_TYPE, "No TYPE" })
97
Jaegeuk Kim26c6b882013-10-24 17:53:29 +090098#define show_file_type(type) \
99 __print_symbolic(type, \
100 { 0, "FILE" }, \
101 { 1, "DIR" })
102
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900103#define show_gc_type(type) \
104 __print_symbolic(type, \
105 { FG_GC, "Foreground GC" }, \
106 { BG_GC, "Background GC" })
107
108#define show_alloc_mode(type) \
109 __print_symbolic(type, \
110 { LFS, "LFS-mode" }, \
111 { SSR, "SSR-mode" })
112
113#define show_victim_policy(type) \
114 __print_symbolic(type, \
115 { GC_GREEDY, "Greedy" }, \
116 { GC_CB, "Cost-Benefit" })
117
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700118#define show_cpreason(type) \
119 __print_symbolic(type, \
120 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800121 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700122 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700123 { CP_RECOVERY, "Recovery" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700124 { CP_DISCARD, "Discard" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700125
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900126struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700127struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900128
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900129DECLARE_EVENT_CLASS(f2fs__inode,
130
131 TP_PROTO(struct inode *inode),
132
133 TP_ARGS(inode),
134
135 TP_STRUCT__entry(
136 __field(dev_t, dev)
137 __field(ino_t, ino)
138 __field(ino_t, pino)
139 __field(umode_t, mode)
140 __field(loff_t, size)
141 __field(unsigned int, nlink)
142 __field(blkcnt_t, blocks)
143 __field(__u8, advise)
144 ),
145
146 TP_fast_assign(
147 __entry->dev = inode->i_sb->s_dev;
148 __entry->ino = inode->i_ino;
149 __entry->pino = F2FS_I(inode)->i_pino;
150 __entry->mode = inode->i_mode;
151 __entry->nlink = inode->i_nlink;
152 __entry->size = inode->i_size;
153 __entry->blocks = inode->i_blocks;
154 __entry->advise = F2FS_I(inode)->i_advise;
155 ),
156
157 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
158 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
159 show_dev_ino(__entry),
160 (unsigned long)__entry->pino,
161 __entry->mode,
162 __entry->size,
163 (unsigned int)__entry->nlink,
164 (unsigned long long)__entry->blocks,
165 (unsigned char)__entry->advise)
166);
167
168DECLARE_EVENT_CLASS(f2fs__inode_exit,
169
170 TP_PROTO(struct inode *inode, int ret),
171
172 TP_ARGS(inode, ret),
173
174 TP_STRUCT__entry(
175 __field(dev_t, dev)
176 __field(ino_t, ino)
177 __field(int, ret)
178 ),
179
180 TP_fast_assign(
181 __entry->dev = inode->i_sb->s_dev;
182 __entry->ino = inode->i_ino;
183 __entry->ret = ret;
184 ),
185
186 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
187 show_dev_ino(__entry),
188 __entry->ret)
189);
190
191DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
192
193 TP_PROTO(struct inode *inode),
194
195 TP_ARGS(inode)
196);
197
198TRACE_EVENT(f2fs_sync_file_exit,
199
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800200 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900201
202 TP_ARGS(inode, need_cp, datasync, ret),
203
204 TP_STRUCT__entry(
205 __field(dev_t, dev)
206 __field(ino_t, ino)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800207 __field(int, need_cp)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900208 __field(int, datasync)
209 __field(int, ret)
210 ),
211
212 TP_fast_assign(
213 __entry->dev = inode->i_sb->s_dev;
214 __entry->ino = inode->i_ino;
215 __entry->need_cp = need_cp;
216 __entry->datasync = datasync;
217 __entry->ret = ret;
218 ),
219
220 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
221 "datasync = %d, ret = %d",
222 show_dev_ino(__entry),
223 __entry->need_cp ? "needed" : "not needed",
224 __entry->datasync,
225 __entry->ret)
226);
227
228TRACE_EVENT(f2fs_sync_fs,
229
230 TP_PROTO(struct super_block *sb, int wait),
231
232 TP_ARGS(sb, wait),
233
234 TP_STRUCT__entry(
235 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800236 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900237 __field(int, wait)
238 ),
239
240 TP_fast_assign(
241 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800242 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900243 __entry->wait = wait;
244 ),
245
246 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
247 show_dev(__entry),
248 __entry->dirty ? "dirty" : "not dirty",
249 __entry->wait)
250);
251
252DEFINE_EVENT(f2fs__inode, f2fs_iget,
253
254 TP_PROTO(struct inode *inode),
255
256 TP_ARGS(inode)
257);
258
259DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
260
261 TP_PROTO(struct inode *inode, int ret),
262
263 TP_ARGS(inode, ret)
264);
265
266DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
267
268 TP_PROTO(struct inode *inode),
269
270 TP_ARGS(inode)
271);
272
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900273DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
274
275 TP_PROTO(struct inode *inode, int ret),
276
277 TP_ARGS(inode, ret)
278);
279
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900280TRACE_EVENT(f2fs_unlink_enter,
281
282 TP_PROTO(struct inode *dir, struct dentry *dentry),
283
284 TP_ARGS(dir, dentry),
285
286 TP_STRUCT__entry(
287 __field(dev_t, dev)
288 __field(ino_t, ino)
289 __field(loff_t, size)
290 __field(blkcnt_t, blocks)
291 __field(const char *, name)
292 ),
293
294 TP_fast_assign(
295 __entry->dev = dir->i_sb->s_dev;
296 __entry->ino = dir->i_ino;
297 __entry->size = dir->i_size;
298 __entry->blocks = dir->i_blocks;
299 __entry->name = dentry->d_name.name;
300 ),
301
302 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
303 "i_blocks = %llu, name = %s",
304 show_dev_ino(__entry),
305 __entry->size,
306 (unsigned long long)__entry->blocks,
307 __entry->name)
308);
309
310DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
311
312 TP_PROTO(struct inode *inode, int ret),
313
314 TP_ARGS(inode, ret)
315);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900316
317DEFINE_EVENT(f2fs__inode, f2fs_truncate,
318
319 TP_PROTO(struct inode *inode),
320
321 TP_ARGS(inode)
322);
323
324TRACE_EVENT(f2fs_truncate_data_blocks_range,
325
326 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
327
328 TP_ARGS(inode, nid, ofs, free),
329
330 TP_STRUCT__entry(
331 __field(dev_t, dev)
332 __field(ino_t, ino)
333 __field(nid_t, nid)
334 __field(unsigned int, ofs)
335 __field(int, free)
336 ),
337
338 TP_fast_assign(
339 __entry->dev = inode->i_sb->s_dev;
340 __entry->ino = inode->i_ino;
341 __entry->nid = nid;
342 __entry->ofs = ofs;
343 __entry->free = free;
344 ),
345
346 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
347 show_dev_ino(__entry),
348 (unsigned int)__entry->nid,
349 __entry->ofs,
350 __entry->free)
351);
352
353DECLARE_EVENT_CLASS(f2fs__truncate_op,
354
355 TP_PROTO(struct inode *inode, u64 from),
356
357 TP_ARGS(inode, from),
358
359 TP_STRUCT__entry(
360 __field(dev_t, dev)
361 __field(ino_t, ino)
362 __field(loff_t, size)
363 __field(blkcnt_t, blocks)
364 __field(u64, from)
365 ),
366
367 TP_fast_assign(
368 __entry->dev = inode->i_sb->s_dev;
369 __entry->ino = inode->i_ino;
370 __entry->size = inode->i_size;
371 __entry->blocks = inode->i_blocks;
372 __entry->from = from;
373 ),
374
375 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
376 "start file offset = %llu",
377 show_dev_ino(__entry),
378 __entry->size,
379 (unsigned long long)__entry->blocks,
380 (unsigned long long)__entry->from)
381);
382
383DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
384
385 TP_PROTO(struct inode *inode, u64 from),
386
387 TP_ARGS(inode, from)
388);
389
390DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
391
392 TP_PROTO(struct inode *inode, int ret),
393
394 TP_ARGS(inode, ret)
395);
396
397DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
398
399 TP_PROTO(struct inode *inode, u64 from),
400
401 TP_ARGS(inode, from)
402);
403
404DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
405
406 TP_PROTO(struct inode *inode, int ret),
407
408 TP_ARGS(inode, ret)
409);
410
411DECLARE_EVENT_CLASS(f2fs__truncate_node,
412
413 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
414
415 TP_ARGS(inode, nid, blk_addr),
416
417 TP_STRUCT__entry(
418 __field(dev_t, dev)
419 __field(ino_t, ino)
420 __field(nid_t, nid)
421 __field(block_t, blk_addr)
422 ),
423
424 TP_fast_assign(
425 __entry->dev = inode->i_sb->s_dev;
426 __entry->ino = inode->i_ino;
427 __entry->nid = nid;
428 __entry->blk_addr = blk_addr;
429 ),
430
431 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
432 show_dev_ino(__entry),
433 (unsigned int)__entry->nid,
434 (unsigned long long)__entry->blk_addr)
435);
436
437DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
438
439 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
440
441 TP_ARGS(inode, nid, blk_addr)
442);
443
444DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
445
446 TP_PROTO(struct inode *inode, int ret),
447
448 TP_ARGS(inode, ret)
449);
450
451DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
452
453 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
454
455 TP_ARGS(inode, nid, blk_addr)
456);
457
458TRACE_EVENT(f2fs_truncate_partial_nodes,
459
460 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
461
462 TP_ARGS(inode, nid, depth, err),
463
464 TP_STRUCT__entry(
465 __field(dev_t, dev)
466 __field(ino_t, ino)
467 __field(nid_t, nid[3])
468 __field(int, depth)
469 __field(int, err)
470 ),
471
472 TP_fast_assign(
473 __entry->dev = inode->i_sb->s_dev;
474 __entry->ino = inode->i_ino;
475 __entry->nid[0] = nid[0];
476 __entry->nid[1] = nid[1];
477 __entry->nid[2] = nid[2];
478 __entry->depth = depth;
479 __entry->err = err;
480 ),
481
482 TP_printk("dev = (%d,%d), ino = %lu, "
483 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
484 show_dev_ino(__entry),
485 (unsigned int)__entry->nid[0],
486 (unsigned int)__entry->nid[1],
487 (unsigned int)__entry->nid[2],
488 __entry->depth,
489 __entry->err)
490);
491
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700492TRACE_EVENT(f2fs_map_blocks,
493 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900494
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700495 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900496
497 TP_STRUCT__entry(
498 __field(dev_t, dev)
499 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700500 __field(block_t, m_lblk)
501 __field(block_t, m_pblk)
502 __field(unsigned int, m_len)
Namjae Jeon848753a2013-04-23 16:38:02 +0900503 __field(int, ret)
504 ),
505
506 TP_fast_assign(
507 __entry->dev = inode->i_sb->s_dev;
508 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700509 __entry->m_lblk = map->m_lblk;
510 __entry->m_pblk = map->m_pblk;
511 __entry->m_len = map->m_len;
Namjae Jeon848753a2013-04-23 16:38:02 +0900512 __entry->ret = ret;
513 ),
514
515 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700516 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900517 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700518 (unsigned long long)__entry->m_lblk,
519 (unsigned long long)__entry->m_pblk,
520 (unsigned long long)__entry->m_len,
Namjae Jeon848753a2013-04-23 16:38:02 +0900521 __entry->ret)
522);
523
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700524TRACE_EVENT(f2fs_background_gc,
525
526 TP_PROTO(struct super_block *sb, long wait_ms,
527 unsigned int prefree, unsigned int free),
528
529 TP_ARGS(sb, wait_ms, prefree, free),
530
531 TP_STRUCT__entry(
532 __field(dev_t, dev)
533 __field(long, wait_ms)
534 __field(unsigned int, prefree)
535 __field(unsigned int, free)
536 ),
537
538 TP_fast_assign(
539 __entry->dev = sb->s_dev;
540 __entry->wait_ms = wait_ms;
541 __entry->prefree = prefree;
542 __entry->free = free;
543 ),
544
545 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
546 show_dev(__entry),
547 __entry->wait_ms,
548 __entry->prefree,
549 __entry->free)
550);
551
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900552TRACE_EVENT(f2fs_get_victim,
553
554 TP_PROTO(struct super_block *sb, int type, int gc_type,
555 struct victim_sel_policy *p, unsigned int pre_victim,
556 unsigned int prefree, unsigned int free),
557
558 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
559
560 TP_STRUCT__entry(
561 __field(dev_t, dev)
562 __field(int, type)
563 __field(int, gc_type)
564 __field(int, alloc_mode)
565 __field(int, gc_mode)
566 __field(unsigned int, victim)
567 __field(unsigned int, ofs_unit)
568 __field(unsigned int, pre_victim)
569 __field(unsigned int, prefree)
570 __field(unsigned int, free)
571 ),
572
573 TP_fast_assign(
574 __entry->dev = sb->s_dev;
575 __entry->type = type;
576 __entry->gc_type = gc_type;
577 __entry->alloc_mode = p->alloc_mode;
578 __entry->gc_mode = p->gc_mode;
579 __entry->victim = p->min_segno;
580 __entry->ofs_unit = p->ofs_unit;
581 __entry->pre_victim = pre_victim;
582 __entry->prefree = prefree;
583 __entry->free = free;
584 ),
585
586 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
587 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
588 show_dev(__entry),
589 show_data_type(__entry->type),
590 show_gc_type(__entry->gc_type),
591 show_alloc_mode(__entry->alloc_mode),
592 show_victim_policy(__entry->gc_mode),
593 __entry->victim,
594 __entry->ofs_unit,
595 (int)__entry->pre_victim,
596 __entry->prefree,
597 __entry->free)
598);
599
Namjae Jeonc01e2852013-04-23 17:00:52 +0900600TRACE_EVENT(f2fs_fallocate,
601
602 TP_PROTO(struct inode *inode, int mode,
603 loff_t offset, loff_t len, int ret),
604
605 TP_ARGS(inode, mode, offset, len, ret),
606
607 TP_STRUCT__entry(
608 __field(dev_t, dev)
609 __field(ino_t, ino)
610 __field(int, mode)
611 __field(loff_t, offset)
612 __field(loff_t, len)
613 __field(loff_t, size)
614 __field(blkcnt_t, blocks)
615 __field(int, ret)
616 ),
617
618 TP_fast_assign(
619 __entry->dev = inode->i_sb->s_dev;
620 __entry->ino = inode->i_ino;
621 __entry->mode = mode;
622 __entry->offset = offset;
623 __entry->len = len;
624 __entry->size = inode->i_size;
625 __entry->blocks = inode->i_blocks;
626 __entry->ret = ret;
627 ),
628
629 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
630 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
631 show_dev_ino(__entry),
632 __entry->mode,
633 (unsigned long long)__entry->offset,
634 (unsigned long long)__entry->len,
635 (unsigned long long)__entry->size,
636 (unsigned long long)__entry->blocks,
637 __entry->ret)
638);
639
Chao Yu70407fad2014-07-31 21:11:22 +0800640TRACE_EVENT(f2fs_direct_IO_enter,
641
642 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
643
644 TP_ARGS(inode, offset, len, rw),
645
646 TP_STRUCT__entry(
647 __field(dev_t, dev)
648 __field(ino_t, ino)
649 __field(loff_t, pos)
650 __field(unsigned long, len)
651 __field(int, rw)
652 ),
653
654 TP_fast_assign(
655 __entry->dev = inode->i_sb->s_dev;
656 __entry->ino = inode->i_ino;
657 __entry->pos = offset;
658 __entry->len = len;
659 __entry->rw = rw;
660 ),
661
662 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
663 show_dev_ino(__entry),
664 __entry->pos,
665 __entry->len,
666 __entry->rw)
667);
668
669TRACE_EVENT(f2fs_direct_IO_exit,
670
671 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
672 int rw, int ret),
673
674 TP_ARGS(inode, offset, len, rw, ret),
675
676 TP_STRUCT__entry(
677 __field(dev_t, dev)
678 __field(ino_t, ino)
679 __field(loff_t, pos)
680 __field(unsigned long, len)
681 __field(int, rw)
682 __field(int, ret)
683 ),
684
685 TP_fast_assign(
686 __entry->dev = inode->i_sb->s_dev;
687 __entry->ino = inode->i_ino;
688 __entry->pos = offset;
689 __entry->len = len;
690 __entry->rw = rw;
691 __entry->ret = ret;
692 ),
693
694 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
695 "rw = %d ret = %d",
696 show_dev_ino(__entry),
697 __entry->pos,
698 __entry->len,
699 __entry->rw,
700 __entry->ret)
701);
702
Chao Yu46008c62016-05-09 19:56:30 +0800703TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900704
Chao Yu46008c62016-05-09 19:56:30 +0800705 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
706 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900707
Chao Yu46008c62016-05-09 19:56:30 +0800708 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900709
710 TP_STRUCT__entry(
711 __field(dev_t, dev)
712 __field(nid_t, nid)
713 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800714 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900715 ),
716
717 TP_fast_assign(
718 __entry->dev = inode->i_sb->s_dev;
719 __entry->nid = nid;
720 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +0800721 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +0900722 ),
723
Chao Yu46008c62016-05-09 19:56:30 +0800724 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Namjae Jeonc01e2852013-04-23 17:00:52 +0900725 show_dev(__entry),
726 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +0800727 __entry->ofs_in_node,
728 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900729);
730
Chao Yu3e1c8f12014-12-23 16:35:21 +0800731DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
732
Chao Yu2ace38e2014-12-24 16:08:14 +0800733 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800734
Chao Yu2ace38e2014-12-24 16:08:14 +0800735 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800736
737 TP_STRUCT__entry(
738 __field(dev_t, dev)
739 __field(ino_t, ino)
740 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +0800741 __field(block_t, old_blkaddr)
742 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -0500743 __field(int, op)
744 __field(int, op_flags)
Chao Yu3e1c8f12014-12-23 16:35:21 +0800745 __field(int, type)
746 ),
747
748 TP_fast_assign(
749 __entry->dev = page->mapping->host->i_sb->s_dev;
750 __entry->ino = page->mapping->host->i_ino;
751 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +0800752 __entry->old_blkaddr = fio->old_blkaddr;
753 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -0500754 __entry->op = fio->op;
755 __entry->op_flags = fio->op_flags;
Chao Yu2ace38e2014-12-24 16:08:14 +0800756 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +0800757 ),
758
759 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Chao Yu44819a72016-08-06 21:09:40 +0800760 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s%s, type = %s",
Chao Yu3e1c8f12014-12-23 16:35:21 +0800761 show_dev_ino(__entry),
762 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +0800763 (unsigned long long)__entry->old_blkaddr,
764 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -0800765 show_bio_type(__entry->op, __entry->op_flags),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800766 show_block_type(__entry->type))
767);
768
769DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
770
Chao Yu2ace38e2014-12-24 16:08:14 +0800771 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800772
Chao Yu2ace38e2014-12-24 16:08:14 +0800773 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800774
775 TP_CONDITION(page->mapping)
776);
777
778DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
779
Chao Yu2ace38e2014-12-24 16:08:14 +0800780 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800781
Chao Yu2ace38e2014-12-24 16:08:14 +0800782 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800783
784 TP_CONDITION(page->mapping)
785);
786
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800787DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900788
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800789 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900790
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800791 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900792
793 TP_STRUCT__entry(
794 __field(dev_t, dev)
Mike Christie04d328d2016-06-05 14:31:55 -0500795 __field(int, op)
796 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +0900797 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900798 __field(sector_t, sector)
799 __field(unsigned int, size)
800 ),
801
802 TP_fast_assign(
803 __entry->dev = sb->s_dev;
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800804 __entry->op = bio_op(bio);
805 __entry->op_flags = bio->bi_opf;
806 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -0700807 __entry->sector = bio->bi_iter.bi_sector;
808 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900809 ),
810
Chao Yu44819a72016-08-06 21:09:40 +0800811 TP_printk("dev = (%d,%d), rw = %s%s, %s, sector = %lld, size = %u",
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900812 show_dev(__entry),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -0800813 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +0900814 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900815 (unsigned long long)__entry->sector,
816 __entry->size)
817);
818
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800819DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +0900820
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800821 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +0900822
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800823 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900824
825 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +0900826);
827
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800828DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +0900829
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800830 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +0900831
Jaegeuk Kim554b5122016-12-21 12:13:03 -0800832 TP_ARGS(sb, type, bio),
833
834 TP_CONDITION(bio)
835);
836
837DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
838
839 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
840
841 TP_ARGS(sb, type, bio),
842
843 TP_CONDITION(bio)
844);
845
846DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
847
848 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
849
850 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900851
852 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +0900853);
854
Chao Yu62aed042014-05-06 16:46:04 +0800855TRACE_EVENT(f2fs_write_begin,
856
857 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
858 unsigned int flags),
859
860 TP_ARGS(inode, pos, len, flags),
861
862 TP_STRUCT__entry(
863 __field(dev_t, dev)
864 __field(ino_t, ino)
865 __field(loff_t, pos)
866 __field(unsigned int, len)
867 __field(unsigned int, flags)
868 ),
869
870 TP_fast_assign(
871 __entry->dev = inode->i_sb->s_dev;
872 __entry->ino = inode->i_ino;
873 __entry->pos = pos;
874 __entry->len = len;
875 __entry->flags = flags;
876 ),
877
878 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
879 show_dev_ino(__entry),
880 (unsigned long long)__entry->pos,
881 __entry->len,
882 __entry->flags)
883);
884
Chao Yudfb2bf32014-05-06 16:47:23 +0800885TRACE_EVENT(f2fs_write_end,
886
887 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
888 unsigned int copied),
889
890 TP_ARGS(inode, pos, len, copied),
891
892 TP_STRUCT__entry(
893 __field(dev_t, dev)
894 __field(ino_t, ino)
895 __field(loff_t, pos)
896 __field(unsigned int, len)
897 __field(unsigned int, copied)
898 ),
899
900 TP_fast_assign(
901 __entry->dev = inode->i_sb->s_dev;
902 __entry->ino = inode->i_ino;
903 __entry->pos = pos;
904 __entry->len = len;
905 __entry->copied = copied;
906 ),
907
908 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
909 show_dev_ino(__entry),
910 (unsigned long long)__entry->pos,
911 __entry->len,
912 __entry->copied)
913);
914
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900915DECLARE_EVENT_CLASS(f2fs__page,
916
917 TP_PROTO(struct page *page, int type),
918
919 TP_ARGS(page, type),
920
921 TP_STRUCT__entry(
922 __field(dev_t, dev)
923 __field(ino_t, ino)
924 __field(int, type)
925 __field(int, dir)
926 __field(pgoff_t, index)
927 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +0800928 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900929 ),
930
931 TP_fast_assign(
932 __entry->dev = page->mapping->host->i_sb->s_dev;
933 __entry->ino = page->mapping->host->i_ino;
934 __entry->type = type;
935 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
936 __entry->index = page->index;
937 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +0800938 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900939 ),
940
Chao Yuc20e89c2014-05-06 16:53:08 +0800941 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
942 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900943 show_dev_ino(__entry),
944 show_block_type(__entry->type),
945 show_file_type(__entry->dir),
946 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +0800947 __entry->dirty,
948 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900949);
950
Chao Yuecda0de2014-05-06 16:48:26 +0800951DEFINE_EVENT(f2fs__page, f2fs_writepage,
952
953 TP_PROTO(struct page *page, int type),
954
955 TP_ARGS(page, type)
956);
957
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -0700958DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
959
960 TP_PROTO(struct page *page, int type),
961
962 TP_ARGS(page, type)
963);
964
Chao Yuc20e89c2014-05-06 16:53:08 +0800965DEFINE_EVENT(f2fs__page, f2fs_readpage,
966
967 TP_PROTO(struct page *page, int type),
968
969 TP_ARGS(page, type)
970);
971
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900972DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
973
974 TP_PROTO(struct page *page, int type),
975
976 TP_ARGS(page, type)
977);
978
Jaegeuk Kime943a102013-10-25 14:26:31 +0900979DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
980
981 TP_PROTO(struct page *page, int type),
982
983 TP_ARGS(page, type)
984);
985
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -0700986DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
987
988 TP_PROTO(struct page *page, int type),
989
990 TP_ARGS(page, type)
991);
992
993DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
994
995 TP_PROTO(struct page *page, int type),
996
997 TP_ARGS(page, type)
998);
999
Chao Yue5748432014-05-06 16:51:24 +08001000TRACE_EVENT(f2fs_writepages,
1001
1002 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1003
1004 TP_ARGS(inode, wbc, type),
1005
1006 TP_STRUCT__entry(
1007 __field(dev_t, dev)
1008 __field(ino_t, ino)
1009 __field(int, type)
1010 __field(int, dir)
1011 __field(long, nr_to_write)
1012 __field(long, pages_skipped)
1013 __field(loff_t, range_start)
1014 __field(loff_t, range_end)
1015 __field(pgoff_t, writeback_index)
1016 __field(int, sync_mode)
1017 __field(char, for_kupdate)
1018 __field(char, for_background)
1019 __field(char, tagged_writepages)
1020 __field(char, for_reclaim)
1021 __field(char, range_cyclic)
1022 __field(char, for_sync)
1023 ),
1024
1025 TP_fast_assign(
1026 __entry->dev = inode->i_sb->s_dev;
1027 __entry->ino = inode->i_ino;
1028 __entry->type = type;
1029 __entry->dir = S_ISDIR(inode->i_mode);
1030 __entry->nr_to_write = wbc->nr_to_write;
1031 __entry->pages_skipped = wbc->pages_skipped;
1032 __entry->range_start = wbc->range_start;
1033 __entry->range_end = wbc->range_end;
1034 __entry->writeback_index = inode->i_mapping->writeback_index;
1035 __entry->sync_mode = wbc->sync_mode;
1036 __entry->for_kupdate = wbc->for_kupdate;
1037 __entry->for_background = wbc->for_background;
1038 __entry->tagged_writepages = wbc->tagged_writepages;
1039 __entry->for_reclaim = wbc->for_reclaim;
1040 __entry->range_cyclic = wbc->range_cyclic;
1041 __entry->for_sync = wbc->for_sync;
1042 ),
1043
1044 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1045 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1046 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1047 show_dev_ino(__entry),
1048 show_block_type(__entry->type),
1049 show_file_type(__entry->dir),
1050 __entry->nr_to_write,
1051 __entry->pages_skipped,
1052 __entry->range_start,
1053 __entry->range_end,
1054 (unsigned long)__entry->writeback_index,
1055 __entry->sync_mode,
1056 __entry->for_kupdate,
1057 __entry->for_background,
1058 __entry->tagged_writepages,
1059 __entry->for_reclaim,
1060 __entry->range_cyclic,
1061 __entry->for_sync)
1062);
1063
Chao Yub8c29402015-10-12 17:02:26 +08001064TRACE_EVENT(f2fs_readpages,
1065
1066 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1067
1068 TP_ARGS(inode, page, nrpage),
1069
1070 TP_STRUCT__entry(
1071 __field(dev_t, dev)
1072 __field(ino_t, ino)
1073 __field(pgoff_t, start)
1074 __field(unsigned int, nrpage)
1075 ),
1076
1077 TP_fast_assign(
1078 __entry->dev = inode->i_sb->s_dev;
1079 __entry->ino = inode->i_ino;
1080 __entry->start = page->index;
1081 __entry->nrpage = nrpage;
1082 ),
1083
1084 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1085 show_dev_ino(__entry),
1086 (unsigned long)__entry->start,
1087 __entry->nrpage)
1088);
1089
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001090TRACE_EVENT(f2fs_write_checkpoint,
1091
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001092 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001093
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001094 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001095
1096 TP_STRUCT__entry(
1097 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001098 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001099 __field(char *, msg)
1100 ),
1101
1102 TP_fast_assign(
1103 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001104 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001105 __entry->msg = msg;
1106 ),
1107
1108 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1109 show_dev(__entry),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001110 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001111 __entry->msg)
1112);
1113
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001114TRACE_EVENT(f2fs_issue_discard,
1115
1116 TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
1117
1118 TP_ARGS(sb, blkstart, blklen),
1119
1120 TP_STRUCT__entry(
1121 __field(dev_t, dev)
1122 __field(block_t, blkstart)
1123 __field(block_t, blklen)
1124 ),
1125
1126 TP_fast_assign(
1127 __entry->dev = sb->s_dev;
1128 __entry->blkstart = blkstart;
1129 __entry->blklen = blklen;
1130 ),
1131
1132 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1133 show_dev(__entry),
1134 (unsigned long long)__entry->blkstart,
1135 (unsigned long long)__entry->blklen)
1136);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001137
Damien Le Moal126606c2016-10-28 17:45:07 +09001138TRACE_EVENT(f2fs_issue_reset_zone,
1139
1140 TP_PROTO(struct super_block *sb, block_t blkstart),
1141
1142 TP_ARGS(sb, blkstart),
1143
1144 TP_STRUCT__entry(
1145 __field(dev_t, dev)
1146 __field(block_t, blkstart)
1147 ),
1148
1149 TP_fast_assign(
1150 __entry->dev = sb->s_dev;
1151 __entry->blkstart = blkstart;
1152 ),
1153
1154 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
1155 show_dev(__entry),
1156 (unsigned long long)__entry->blkstart)
1157);
1158
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001159TRACE_EVENT(f2fs_issue_flush,
1160
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001161 TP_PROTO(struct super_block *sb, unsigned int nobarrier,
1162 unsigned int flush_merge),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001163
1164 TP_ARGS(sb, nobarrier, flush_merge),
1165
1166 TP_STRUCT__entry(
1167 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001168 __field(unsigned int, nobarrier)
1169 __field(unsigned int, flush_merge)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001170 ),
1171
1172 TP_fast_assign(
1173 __entry->dev = sb->s_dev;
1174 __entry->nobarrier = nobarrier;
1175 __entry->flush_merge = flush_merge;
1176 ),
1177
1178 TP_printk("dev = (%d,%d), %s %s",
1179 show_dev(__entry),
1180 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1181 __entry->flush_merge ? " with flush_merge" : "")
1182);
Chao Yu1ec46102015-02-05 17:59:59 +08001183
1184TRACE_EVENT(f2fs_lookup_extent_tree_start,
1185
1186 TP_PROTO(struct inode *inode, unsigned int pgofs),
1187
1188 TP_ARGS(inode, pgofs),
1189
1190 TP_STRUCT__entry(
1191 __field(dev_t, dev)
1192 __field(ino_t, ino)
1193 __field(unsigned int, pgofs)
1194 ),
1195
1196 TP_fast_assign(
1197 __entry->dev = inode->i_sb->s_dev;
1198 __entry->ino = inode->i_ino;
1199 __entry->pgofs = pgofs;
1200 ),
1201
1202 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1203 show_dev_ino(__entry),
1204 __entry->pgofs)
1205);
1206
1207TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1208
1209 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001210 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001211
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001212 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001213
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001214 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001215
1216 TP_STRUCT__entry(
1217 __field(dev_t, dev)
1218 __field(ino_t, ino)
1219 __field(unsigned int, pgofs)
1220 __field(unsigned int, fofs)
1221 __field(u32, blk)
1222 __field(unsigned int, len)
1223 ),
1224
1225 TP_fast_assign(
1226 __entry->dev = inode->i_sb->s_dev;
1227 __entry->ino = inode->i_ino;
1228 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001229 __entry->fofs = ei->fofs;
1230 __entry->blk = ei->blk;
1231 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001232 ),
1233
1234 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1235 "ext_info(fofs: %u, blk: %u, len: %u)",
1236 show_dev_ino(__entry),
1237 __entry->pgofs,
1238 __entry->fofs,
1239 __entry->blk,
1240 __entry->len)
1241);
1242
Chao Yu744288c2015-09-06 17:50:13 +08001243TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001244
Chao Yu744288c2015-09-06 17:50:13 +08001245 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1246 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001247
Chao Yu744288c2015-09-06 17:50:13 +08001248 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001249
1250 TP_STRUCT__entry(
1251 __field(dev_t, dev)
1252 __field(ino_t, ino)
1253 __field(unsigned int, pgofs)
1254 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001255 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001256 ),
1257
1258 TP_fast_assign(
1259 __entry->dev = inode->i_sb->s_dev;
1260 __entry->ino = inode->i_ino;
1261 __entry->pgofs = pgofs;
1262 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001263 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001264 ),
1265
Chao Yu744288c2015-09-06 17:50:13 +08001266 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1267 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001268 show_dev_ino(__entry),
1269 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001270 __entry->blk,
1271 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001272);
1273
1274TRACE_EVENT(f2fs_shrink_extent_tree,
1275
1276 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1277 unsigned int tree_cnt),
1278
1279 TP_ARGS(sbi, node_cnt, tree_cnt),
1280
1281 TP_STRUCT__entry(
1282 __field(dev_t, dev)
1283 __field(unsigned int, node_cnt)
1284 __field(unsigned int, tree_cnt)
1285 ),
1286
1287 TP_fast_assign(
1288 __entry->dev = sbi->sb->s_dev;
1289 __entry->node_cnt = node_cnt;
1290 __entry->tree_cnt = tree_cnt;
1291 ),
1292
1293 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1294 show_dev(__entry),
1295 __entry->node_cnt,
1296 __entry->tree_cnt)
1297);
1298
1299TRACE_EVENT(f2fs_destroy_extent_tree,
1300
1301 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1302
1303 TP_ARGS(inode, node_cnt),
1304
1305 TP_STRUCT__entry(
1306 __field(dev_t, dev)
1307 __field(ino_t, ino)
1308 __field(unsigned int, node_cnt)
1309 ),
1310
1311 TP_fast_assign(
1312 __entry->dev = inode->i_sb->s_dev;
1313 __entry->ino = inode->i_ino;
1314 __entry->node_cnt = node_cnt;
1315 ),
1316
1317 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1318 show_dev_ino(__entry),
1319 __entry->node_cnt)
1320);
1321
Chao Yu4cf18532015-12-17 17:17:16 +08001322DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1323
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001324 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001325
1326 TP_ARGS(sb, type, count),
1327
1328 TP_STRUCT__entry(
1329 __field(dev_t, dev)
1330 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001331 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001332 ),
1333
1334 TP_fast_assign(
1335 __entry->dev = sb->s_dev;
1336 __entry->type = type;
1337 __entry->count = count;
1338 ),
1339
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001340 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Chao Yu4cf18532015-12-17 17:17:16 +08001341 show_dev(__entry),
1342 show_file_type(__entry->type),
1343 __entry->count)
1344);
1345
1346DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1347
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001348 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001349
1350 TP_ARGS(sb, type, count)
1351);
1352
1353DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1354
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001355 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001356
1357 TP_ARGS(sb, type, count)
1358);
1359
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001360#endif /* _TRACE_F2FS_H */
1361
1362 /* This part must be outside protection */
1363#include <trace/define_trace.h>