blob: f701bb23f83c439e5d8c6171b55422769d2e172c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM f2fs
4
5#if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_F2FS_H
7
8#include <linux/tracepoint.h>
Chao Yufa4320c2020-11-02 14:21:31 +08009#include <uapi/linux/f2fs.h>
Namjae Jeona2a4a7e2013-04-20 01:28:40 +090010
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -080011#define show_dev(dev) MAJOR(dev), MINOR(dev)
12#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
Namjae Jeon6ec178d2013-04-23 17:51:43 +090013
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040014TRACE_DEFINE_ENUM(NODE);
15TRACE_DEFINE_ENUM(DATA);
16TRACE_DEFINE_ENUM(META);
17TRACE_DEFINE_ENUM(META_FLUSH);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070018TRACE_DEFINE_ENUM(INMEM);
19TRACE_DEFINE_ENUM(INMEM_DROP);
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080020TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
Chao Yua58f2442017-03-17 18:46:14 +080021TRACE_DEFINE_ENUM(INMEM_REVOKE);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070022TRACE_DEFINE_ENUM(IPU);
23TRACE_DEFINE_ENUM(OPU);
Jaegeuk Kima912b542017-05-10 11:18:25 -070024TRACE_DEFINE_ENUM(HOT);
25TRACE_DEFINE_ENUM(WARM);
26TRACE_DEFINE_ENUM(COLD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040027TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
28TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
29TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
30TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
31TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
32TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
33TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
34TRACE_DEFINE_ENUM(GC_GREEDY);
35TRACE_DEFINE_ENUM(GC_CB);
36TRACE_DEFINE_ENUM(FG_GC);
37TRACE_DEFINE_ENUM(BG_GC);
38TRACE_DEFINE_ENUM(LFS);
39TRACE_DEFINE_ENUM(SSR);
40TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040041TRACE_DEFINE_ENUM(__REQ_SYNC);
Christoph Hellwiga2b80962016-11-01 07:40:09 -060042TRACE_DEFINE_ENUM(__REQ_IDLE);
Mike Christie28a8f0d2016-06-05 14:32:25 -050043TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040044TRACE_DEFINE_ENUM(__REQ_FUA);
45TRACE_DEFINE_ENUM(__REQ_PRIO);
46TRACE_DEFINE_ENUM(__REQ_META);
47TRACE_DEFINE_ENUM(CP_UMOUNT);
48TRACE_DEFINE_ENUM(CP_FASTBOOT);
49TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070050TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040051TRACE_DEFINE_ENUM(CP_DISCARD);
Chao Yu1f43e2a2017-04-28 13:56:08 +080052TRACE_DEFINE_ENUM(CP_TRIMMED);
Sahitya Tummalafad5fbc2020-01-03 08:49:28 +053053TRACE_DEFINE_ENUM(CP_PAUSE);
Jaegeuk Kimb4b10062020-03-31 11:43:07 -070054TRACE_DEFINE_ENUM(CP_RESIZE);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040055
Namjae Jeon6ec178d2013-04-23 17:51:43 +090056#define show_block_type(type) \
57 __print_symbolic(type, \
58 { NODE, "NODE" }, \
59 { DATA, "DATA" }, \
60 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070061 { META_FLUSH, "META_FLUSH" }, \
62 { INMEM, "INMEM" }, \
63 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080064 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080065 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070066 { IPU, "IN-PLACE" }, \
67 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090068
Jaegeuk Kima912b542017-05-10 11:18:25 -070069#define show_block_temp(temp) \
70 __print_symbolic(temp, \
71 { HOT, "HOT" }, \
72 { WARM, "WARM" }, \
73 { COLD, "COLD" })
74
Chao Yubaaabbb2017-05-04 09:35:43 +080075#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
76 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080077#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090078
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080079#define show_bio_type(op,op_flags) show_bio_op(op), \
80 show_bio_op_flags(op_flags)
81
Chaitanya Kulkarni0ce35372019-06-20 10:59:19 -070082#define show_bio_op(op) blk_op_str(op)
Mike Christie04d328d2016-06-05 14:31:55 -050083
84#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080085 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
86 { REQ_RAHEAD, "R" }, \
87 { REQ_SYNC, "S" }, \
88 { REQ_META, "M" }, \
89 { REQ_PRIO, "P" }, \
90 { REQ_PREFLUSH, "PF" }, \
91 { REQ_FUA, "FUA" })
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090092
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090093#define show_data_type(type) \
94 __print_symbolic(type, \
95 { CURSEG_HOT_DATA, "Hot DATA" }, \
96 { CURSEG_WARM_DATA, "Warm DATA" }, \
97 { CURSEG_COLD_DATA, "Cold DATA" }, \
98 { CURSEG_HOT_NODE, "Hot NODE" }, \
99 { CURSEG_WARM_NODE, "Warm NODE" }, \
100 { CURSEG_COLD_NODE, "Cold NODE" }, \
101 { NO_CHECK_TYPE, "No TYPE" })
102
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900103#define show_file_type(type) \
104 __print_symbolic(type, \
105 { 0, "FILE" }, \
106 { 1, "DIR" })
107
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900108#define show_gc_type(type) \
109 __print_symbolic(type, \
110 { FG_GC, "Foreground GC" }, \
111 { BG_GC, "Background GC" })
112
113#define show_alloc_mode(type) \
114 __print_symbolic(type, \
Chao Yu093749e2020-08-04 21:14:49 +0800115 { LFS, "LFS-mode" }, \
116 { SSR, "SSR-mode" }, \
117 { AT_SSR, "AT_SSR-mode" })
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900118
119#define show_victim_policy(type) \
120 __print_symbolic(type, \
121 { GC_GREEDY, "Greedy" }, \
Chao Yu093749e2020-08-04 21:14:49 +0800122 { GC_CB, "Cost-Benefit" }, \
123 { GC_AT, "Age-threshold" })
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900124
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700125#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800126 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700127 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800128 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700129 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700130 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800131 { CP_DISCARD, "Discard" }, \
Sahitya Tummalafad5fbc2020-01-03 08:49:28 +0530132 { CP_PAUSE, "Pause" }, \
Jaegeuk Kimb4b10062020-03-31 11:43:07 -0700133 { CP_TRIMMED, "Trimmed" }, \
134 { CP_RESIZE, "Resize" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700135
Chao Yua5fd5052017-11-06 22:51:45 +0800136#define show_fsync_cpreason(type) \
137 __print_symbolic(type, \
138 { CP_NO_NEEDED, "no needed" }, \
139 { CP_NON_REGULAR, "non regular" }, \
Chao Yu32c0fec2020-09-03 10:15:15 +0800140 { CP_COMPRESSED, "compressed" }, \
Chao Yua5fd5052017-11-06 22:51:45 +0800141 { CP_HARDLINK, "hardlink" }, \
142 { CP_SB_NEED_CP, "sb needs cp" }, \
143 { CP_WRONG_PINO, "wrong pino" }, \
144 { CP_NO_SPC_ROLL, "no space roll forward" }, \
145 { CP_NODE_NEED_CP, "node needs cp" }, \
146 { CP_FASTBOOT_MODE, "fastboot mode" }, \
Jaegeuk Kim0a007b972017-12-28 08:09:44 -0800147 { CP_SPEC_LOG_NUM, "log type is 2" }, \
148 { CP_RECOVER_DIR, "dir needs recovery" })
Chao Yua5fd5052017-11-06 22:51:45 +0800149
Chao Yu559e87c2019-02-26 19:01:15 +0800150#define show_shutdown_mode(type) \
151 __print_symbolic(type, \
152 { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \
153 { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \
154 { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \
155 { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \
156 { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" })
157
Chao Yu4c8ff702019-11-01 18:07:14 +0800158#define show_compress_algorithm(type) \
159 __print_symbolic(type, \
160 { COMPRESS_LZO, "LZO" }, \
Chao Yu50cfa662020-03-03 17:46:02 +0800161 { COMPRESS_LZ4, "LZ4" }, \
Chao Yu6d92b202020-04-08 19:56:32 +0800162 { COMPRESS_ZSTD, "ZSTD" }, \
163 { COMPRESS_LZORLE, "LZO-RLE" })
Chao Yu4c8ff702019-11-01 18:07:14 +0800164
Zhikang Zhang539cd352019-01-03 20:06:38 +0800165struct f2fs_sb_info;
166struct f2fs_io_info;
167struct extent_info;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900168struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700169struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900170
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900171DECLARE_EVENT_CLASS(f2fs__inode,
172
173 TP_PROTO(struct inode *inode),
174
175 TP_ARGS(inode),
176
177 TP_STRUCT__entry(
178 __field(dev_t, dev)
179 __field(ino_t, ino)
180 __field(ino_t, pino)
181 __field(umode_t, mode)
182 __field(loff_t, size)
183 __field(unsigned int, nlink)
184 __field(blkcnt_t, blocks)
185 __field(__u8, advise)
186 ),
187
188 TP_fast_assign(
189 __entry->dev = inode->i_sb->s_dev;
190 __entry->ino = inode->i_ino;
191 __entry->pino = F2FS_I(inode)->i_pino;
192 __entry->mode = inode->i_mode;
193 __entry->nlink = inode->i_nlink;
194 __entry->size = inode->i_size;
195 __entry->blocks = inode->i_blocks;
196 __entry->advise = F2FS_I(inode)->i_advise;
197 ),
198
199 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
200 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
201 show_dev_ino(__entry),
202 (unsigned long)__entry->pino,
203 __entry->mode,
204 __entry->size,
205 (unsigned int)__entry->nlink,
206 (unsigned long long)__entry->blocks,
207 (unsigned char)__entry->advise)
208);
209
210DECLARE_EVENT_CLASS(f2fs__inode_exit,
211
212 TP_PROTO(struct inode *inode, int ret),
213
214 TP_ARGS(inode, ret),
215
216 TP_STRUCT__entry(
217 __field(dev_t, dev)
218 __field(ino_t, ino)
219 __field(int, ret)
220 ),
221
222 TP_fast_assign(
223 __entry->dev = inode->i_sb->s_dev;
224 __entry->ino = inode->i_ino;
225 __entry->ret = ret;
226 ),
227
228 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
229 show_dev_ino(__entry),
230 __entry->ret)
231);
232
233DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
234
235 TP_PROTO(struct inode *inode),
236
237 TP_ARGS(inode)
238);
239
240TRACE_EVENT(f2fs_sync_file_exit,
241
Chao Yua5fd5052017-11-06 22:51:45 +0800242 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900243
Chao Yua5fd5052017-11-06 22:51:45 +0800244 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900245
246 TP_STRUCT__entry(
247 __field(dev_t, dev)
248 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800249 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900250 __field(int, datasync)
251 __field(int, ret)
252 ),
253
254 TP_fast_assign(
255 __entry->dev = inode->i_sb->s_dev;
256 __entry->ino = inode->i_ino;
Chao Yua5fd5052017-11-06 22:51:45 +0800257 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900258 __entry->datasync = datasync;
259 __entry->ret = ret;
260 ),
261
Chao Yua5fd5052017-11-06 22:51:45 +0800262 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900263 "datasync = %d, ret = %d",
264 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800265 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900266 __entry->datasync,
267 __entry->ret)
268);
269
270TRACE_EVENT(f2fs_sync_fs,
271
272 TP_PROTO(struct super_block *sb, int wait),
273
274 TP_ARGS(sb, wait),
275
276 TP_STRUCT__entry(
277 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800278 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900279 __field(int, wait)
280 ),
281
282 TP_fast_assign(
283 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800284 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900285 __entry->wait = wait;
286 ),
287
288 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800289 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900290 __entry->dirty ? "dirty" : "not dirty",
291 __entry->wait)
292);
293
294DEFINE_EVENT(f2fs__inode, f2fs_iget,
295
296 TP_PROTO(struct inode *inode),
297
298 TP_ARGS(inode)
299);
300
301DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
302
303 TP_PROTO(struct inode *inode, int ret),
304
305 TP_ARGS(inode, ret)
306);
307
308DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
309
310 TP_PROTO(struct inode *inode),
311
312 TP_ARGS(inode)
313);
314
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900315DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
316
317 TP_PROTO(struct inode *inode, int ret),
318
319 TP_ARGS(inode, ret)
320);
321
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900322TRACE_EVENT(f2fs_unlink_enter,
323
324 TP_PROTO(struct inode *dir, struct dentry *dentry),
325
326 TP_ARGS(dir, dentry),
327
328 TP_STRUCT__entry(
329 __field(dev_t, dev)
330 __field(ino_t, ino)
331 __field(loff_t, size)
332 __field(blkcnt_t, blocks)
333 __field(const char *, name)
334 ),
335
336 TP_fast_assign(
337 __entry->dev = dir->i_sb->s_dev;
338 __entry->ino = dir->i_ino;
339 __entry->size = dir->i_size;
340 __entry->blocks = dir->i_blocks;
341 __entry->name = dentry->d_name.name;
342 ),
343
344 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
345 "i_blocks = %llu, name = %s",
346 show_dev_ino(__entry),
347 __entry->size,
348 (unsigned long long)__entry->blocks,
349 __entry->name)
350);
351
352DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
353
354 TP_PROTO(struct inode *inode, int ret),
355
356 TP_ARGS(inode, ret)
357);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900358
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000359DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
360
361 TP_PROTO(struct inode *inode, int ret),
362
363 TP_ARGS(inode, ret)
364);
365
Namjae Jeon51dd6242013-04-20 01:28:52 +0900366DEFINE_EVENT(f2fs__inode, f2fs_truncate,
367
368 TP_PROTO(struct inode *inode),
369
370 TP_ARGS(inode)
371);
372
373TRACE_EVENT(f2fs_truncate_data_blocks_range,
374
375 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
376
377 TP_ARGS(inode, nid, ofs, free),
378
379 TP_STRUCT__entry(
380 __field(dev_t, dev)
381 __field(ino_t, ino)
382 __field(nid_t, nid)
383 __field(unsigned int, ofs)
384 __field(int, free)
385 ),
386
387 TP_fast_assign(
388 __entry->dev = inode->i_sb->s_dev;
389 __entry->ino = inode->i_ino;
390 __entry->nid = nid;
391 __entry->ofs = ofs;
392 __entry->free = free;
393 ),
394
395 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
396 show_dev_ino(__entry),
397 (unsigned int)__entry->nid,
398 __entry->ofs,
399 __entry->free)
400);
401
402DECLARE_EVENT_CLASS(f2fs__truncate_op,
403
404 TP_PROTO(struct inode *inode, u64 from),
405
406 TP_ARGS(inode, from),
407
408 TP_STRUCT__entry(
409 __field(dev_t, dev)
410 __field(ino_t, ino)
411 __field(loff_t, size)
412 __field(blkcnt_t, blocks)
413 __field(u64, from)
414 ),
415
416 TP_fast_assign(
417 __entry->dev = inode->i_sb->s_dev;
418 __entry->ino = inode->i_ino;
419 __entry->size = inode->i_size;
420 __entry->blocks = inode->i_blocks;
421 __entry->from = from;
422 ),
423
424 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
425 "start file offset = %llu",
426 show_dev_ino(__entry),
427 __entry->size,
428 (unsigned long long)__entry->blocks,
429 (unsigned long long)__entry->from)
430);
431
432DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
433
434 TP_PROTO(struct inode *inode, u64 from),
435
436 TP_ARGS(inode, from)
437);
438
439DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
440
441 TP_PROTO(struct inode *inode, int ret),
442
443 TP_ARGS(inode, ret)
444);
445
446DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
447
448 TP_PROTO(struct inode *inode, u64 from),
449
450 TP_ARGS(inode, from)
451);
452
453DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
454
455 TP_PROTO(struct inode *inode, int ret),
456
457 TP_ARGS(inode, ret)
458);
459
460DECLARE_EVENT_CLASS(f2fs__truncate_node,
461
462 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
463
464 TP_ARGS(inode, nid, blk_addr),
465
466 TP_STRUCT__entry(
467 __field(dev_t, dev)
468 __field(ino_t, ino)
469 __field(nid_t, nid)
470 __field(block_t, blk_addr)
471 ),
472
473 TP_fast_assign(
474 __entry->dev = inode->i_sb->s_dev;
475 __entry->ino = inode->i_ino;
476 __entry->nid = nid;
477 __entry->blk_addr = blk_addr;
478 ),
479
480 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
481 show_dev_ino(__entry),
482 (unsigned int)__entry->nid,
483 (unsigned long long)__entry->blk_addr)
484);
485
486DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
487
488 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
489
490 TP_ARGS(inode, nid, blk_addr)
491);
492
493DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
494
495 TP_PROTO(struct inode *inode, int ret),
496
497 TP_ARGS(inode, ret)
498);
499
500DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
501
502 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
503
504 TP_ARGS(inode, nid, blk_addr)
505);
506
507TRACE_EVENT(f2fs_truncate_partial_nodes,
508
Alexei Starovoitovc1055472018-03-28 12:05:32 -0700509 TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
Namjae Jeon51dd6242013-04-20 01:28:52 +0900510
511 TP_ARGS(inode, nid, depth, err),
512
513 TP_STRUCT__entry(
514 __field(dev_t, dev)
515 __field(ino_t, ino)
516 __field(nid_t, nid[3])
517 __field(int, depth)
518 __field(int, err)
519 ),
520
521 TP_fast_assign(
522 __entry->dev = inode->i_sb->s_dev;
523 __entry->ino = inode->i_ino;
524 __entry->nid[0] = nid[0];
525 __entry->nid[1] = nid[1];
526 __entry->nid[2] = nid[2];
527 __entry->depth = depth;
528 __entry->err = err;
529 ),
530
531 TP_printk("dev = (%d,%d), ino = %lu, "
532 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
533 show_dev_ino(__entry),
534 (unsigned int)__entry->nid[0],
535 (unsigned int)__entry->nid[1],
536 (unsigned int)__entry->nid[2],
537 __entry->depth,
538 __entry->err)
539);
540
Chao Yu126ce722019-04-02 18:52:22 +0800541TRACE_EVENT(f2fs_file_write_iter,
542
Eric Biggersccf7cf92021-07-16 09:39:15 -0500543 TP_PROTO(struct inode *inode, loff_t offset, size_t length,
544 ssize_t ret),
Chao Yu126ce722019-04-02 18:52:22 +0800545
546 TP_ARGS(inode, offset, length, ret),
547
548 TP_STRUCT__entry(
549 __field(dev_t, dev)
550 __field(ino_t, ino)
Eric Biggersccf7cf92021-07-16 09:39:15 -0500551 __field(loff_t, offset)
552 __field(size_t, length)
553 __field(ssize_t, ret)
Chao Yu126ce722019-04-02 18:52:22 +0800554 ),
555
556 TP_fast_assign(
557 __entry->dev = inode->i_sb->s_dev;
558 __entry->ino = inode->i_ino;
559 __entry->offset = offset;
560 __entry->length = length;
561 __entry->ret = ret;
562 ),
563
564 TP_printk("dev = (%d,%d), ino = %lu, "
Eric Biggersccf7cf92021-07-16 09:39:15 -0500565 "offset = %lld, length = %zu, written(err) = %zd",
Chao Yu126ce722019-04-02 18:52:22 +0800566 show_dev_ino(__entry),
567 __entry->offset,
568 __entry->length,
569 __entry->ret)
570);
571
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700572TRACE_EVENT(f2fs_map_blocks,
Chao Yu71f2c822021-09-01 14:39:20 +0800573 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map,
574 int create, int flag, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900575
Chao Yu71f2c822021-09-01 14:39:20 +0800576 TP_ARGS(inode, map, create, flag, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900577
578 TP_STRUCT__entry(
579 __field(dev_t, dev)
580 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700581 __field(block_t, m_lblk)
582 __field(block_t, m_pblk)
583 __field(unsigned int, m_len)
Chao Yu76630f22019-02-26 19:01:16 +0800584 __field(unsigned int, m_flags)
585 __field(int, m_seg_type)
586 __field(bool, m_may_create)
Chao Yu71f2c822021-09-01 14:39:20 +0800587 __field(bool, m_multidev_dio)
588 __field(int, create)
589 __field(int, flag)
Namjae Jeon848753a2013-04-23 16:38:02 +0900590 __field(int, ret)
591 ),
592
593 TP_fast_assign(
Chao Yu71f2c822021-09-01 14:39:20 +0800594 __entry->dev = map->m_bdev->bd_dev;
Namjae Jeon848753a2013-04-23 16:38:02 +0900595 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700596 __entry->m_lblk = map->m_lblk;
597 __entry->m_pblk = map->m_pblk;
598 __entry->m_len = map->m_len;
Chao Yu76630f22019-02-26 19:01:16 +0800599 __entry->m_flags = map->m_flags;
600 __entry->m_seg_type = map->m_seg_type;
601 __entry->m_may_create = map->m_may_create;
Chao Yu71f2c822021-09-01 14:39:20 +0800602 __entry->m_multidev_dio = map->m_multidev_dio;
603 __entry->create = create;
604 __entry->flag = flag;
Namjae Jeon848753a2013-04-23 16:38:02 +0900605 __entry->ret = ret;
606 ),
607
608 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Chao Yu71f2c822021-09-01 14:39:20 +0800609 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u, "
610 "seg_type = %d, may_create = %d, multidevice = %d, "
611 "create = %d, flag = %d, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900612 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700613 (unsigned long long)__entry->m_lblk,
614 (unsigned long long)__entry->m_pblk,
615 (unsigned long long)__entry->m_len,
Chao Yu76630f22019-02-26 19:01:16 +0800616 __entry->m_flags,
617 __entry->m_seg_type,
618 __entry->m_may_create,
Chao Yu71f2c822021-09-01 14:39:20 +0800619 __entry->m_multidev_dio,
620 __entry->create,
621 __entry->flag,
Namjae Jeon848753a2013-04-23 16:38:02 +0900622 __entry->ret)
623);
624
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700625TRACE_EVENT(f2fs_background_gc,
626
Chao Yub8c502b2017-08-07 23:12:46 +0800627 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700628 unsigned int prefree, unsigned int free),
629
630 TP_ARGS(sb, wait_ms, prefree, free),
631
632 TP_STRUCT__entry(
633 __field(dev_t, dev)
Chao Yub8c502b2017-08-07 23:12:46 +0800634 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700635 __field(unsigned int, prefree)
636 __field(unsigned int, free)
637 ),
638
639 TP_fast_assign(
640 __entry->dev = sb->s_dev;
641 __entry->wait_ms = wait_ms;
642 __entry->prefree = prefree;
643 __entry->free = free;
644 ),
645
Chao Yub8c502b2017-08-07 23:12:46 +0800646 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800647 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700648 __entry->wait_ms,
649 __entry->prefree,
650 __entry->free)
651);
652
Chao Yuc56f16d2017-08-11 18:00:15 +0800653TRACE_EVENT(f2fs_gc_begin,
654
655 TP_PROTO(struct super_block *sb, bool sync, bool background,
656 long long dirty_nodes, long long dirty_dents,
657 long long dirty_imeta, unsigned int free_sec,
658 unsigned int free_seg, int reserved_seg,
659 unsigned int prefree_seg),
660
661 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
662 free_sec, free_seg, reserved_seg, prefree_seg),
663
664 TP_STRUCT__entry(
665 __field(dev_t, dev)
666 __field(bool, sync)
667 __field(bool, background)
668 __field(long long, dirty_nodes)
669 __field(long long, dirty_dents)
670 __field(long long, dirty_imeta)
671 __field(unsigned int, free_sec)
672 __field(unsigned int, free_seg)
673 __field(int, reserved_seg)
674 __field(unsigned int, prefree_seg)
675 ),
676
677 TP_fast_assign(
678 __entry->dev = sb->s_dev;
679 __entry->sync = sync;
680 __entry->background = background;
681 __entry->dirty_nodes = dirty_nodes;
682 __entry->dirty_dents = dirty_dents;
683 __entry->dirty_imeta = dirty_imeta;
684 __entry->free_sec = free_sec;
685 __entry->free_seg = free_seg;
686 __entry->reserved_seg = reserved_seg;
687 __entry->prefree_seg = prefree_seg;
688 ),
689
690 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
691 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
692 "rsv_seg:%d, prefree_seg:%u",
693 show_dev(__entry->dev),
694 __entry->sync,
695 __entry->background,
696 __entry->dirty_nodes,
697 __entry->dirty_dents,
698 __entry->dirty_imeta,
699 __entry->free_sec,
700 __entry->free_seg,
701 __entry->reserved_seg,
702 __entry->prefree_seg)
703);
704
705TRACE_EVENT(f2fs_gc_end,
706
707 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
708 int sec_freed, long long dirty_nodes,
709 long long dirty_dents, long long dirty_imeta,
710 unsigned int free_sec, unsigned int free_seg,
711 int reserved_seg, unsigned int prefree_seg),
712
713 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
714 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
715
716 TP_STRUCT__entry(
717 __field(dev_t, dev)
718 __field(int, ret)
719 __field(int, seg_freed)
720 __field(int, sec_freed)
721 __field(long long, dirty_nodes)
722 __field(long long, dirty_dents)
723 __field(long long, dirty_imeta)
724 __field(unsigned int, free_sec)
725 __field(unsigned int, free_seg)
726 __field(int, reserved_seg)
727 __field(unsigned int, prefree_seg)
728 ),
729
730 TP_fast_assign(
731 __entry->dev = sb->s_dev;
732 __entry->ret = ret;
733 __entry->seg_freed = seg_freed;
734 __entry->sec_freed = sec_freed;
735 __entry->dirty_nodes = dirty_nodes;
736 __entry->dirty_dents = dirty_dents;
737 __entry->dirty_imeta = dirty_imeta;
738 __entry->free_sec = free_sec;
739 __entry->free_seg = free_seg;
740 __entry->reserved_seg = reserved_seg;
741 __entry->prefree_seg = prefree_seg;
742 ),
743
744 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
745 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
746 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
747 show_dev(__entry->dev),
748 __entry->ret,
749 __entry->seg_freed,
750 __entry->sec_freed,
751 __entry->dirty_nodes,
752 __entry->dirty_dents,
753 __entry->dirty_imeta,
754 __entry->free_sec,
755 __entry->free_seg,
756 __entry->reserved_seg,
757 __entry->prefree_seg)
758);
759
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900760TRACE_EVENT(f2fs_get_victim,
761
762 TP_PROTO(struct super_block *sb, int type, int gc_type,
763 struct victim_sel_policy *p, unsigned int pre_victim,
764 unsigned int prefree, unsigned int free),
765
766 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
767
768 TP_STRUCT__entry(
769 __field(dev_t, dev)
770 __field(int, type)
771 __field(int, gc_type)
772 __field(int, alloc_mode)
773 __field(int, gc_mode)
774 __field(unsigned int, victim)
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800775 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900776 __field(unsigned int, ofs_unit)
777 __field(unsigned int, pre_victim)
778 __field(unsigned int, prefree)
779 __field(unsigned int, free)
780 ),
781
782 TP_fast_assign(
783 __entry->dev = sb->s_dev;
784 __entry->type = type;
785 __entry->gc_type = gc_type;
786 __entry->alloc_mode = p->alloc_mode;
787 __entry->gc_mode = p->gc_mode;
788 __entry->victim = p->min_segno;
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800789 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900790 __entry->ofs_unit = p->ofs_unit;
791 __entry->pre_victim = pre_victim;
792 __entry->prefree = prefree;
793 __entry->free = free;
794 ),
795
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800796 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
797 "victim = %u, cost = %u, ofs_unit = %u, "
798 "pre_victim_secno = %d, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800799 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900800 show_data_type(__entry->type),
801 show_gc_type(__entry->gc_type),
802 show_alloc_mode(__entry->alloc_mode),
803 show_victim_policy(__entry->gc_mode),
804 __entry->victim,
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800805 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900806 __entry->ofs_unit,
807 (int)__entry->pre_victim,
808 __entry->prefree,
809 __entry->free)
810);
811
Chao Yu0c5e36d2017-10-17 17:33:41 +0800812TRACE_EVENT(f2fs_lookup_start,
813
814 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
815
816 TP_ARGS(dir, dentry, flags),
817
818 TP_STRUCT__entry(
819 __field(dev_t, dev)
820 __field(ino_t, ino)
Gao Xiang70a9ac32021-09-21 22:37:30 +0800821 __string(name, dentry->d_name.name)
Chao Yu0c5e36d2017-10-17 17:33:41 +0800822 __field(unsigned int, flags)
823 ),
824
825 TP_fast_assign(
826 __entry->dev = dir->i_sb->s_dev;
827 __entry->ino = dir->i_ino;
Gao Xiang70a9ac32021-09-21 22:37:30 +0800828 __assign_str(name, dentry->d_name.name);
Chao Yu0c5e36d2017-10-17 17:33:41 +0800829 __entry->flags = flags;
830 ),
831
832 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
833 show_dev_ino(__entry),
Gao Xiang70a9ac32021-09-21 22:37:30 +0800834 __get_str(name),
Chao Yu0c5e36d2017-10-17 17:33:41 +0800835 __entry->flags)
836);
837
838TRACE_EVENT(f2fs_lookup_end,
839
840 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
841 int err),
842
843 TP_ARGS(dir, dentry, ino, err),
844
845 TP_STRUCT__entry(
846 __field(dev_t, dev)
847 __field(ino_t, ino)
Gao Xiang70a9ac32021-09-21 22:37:30 +0800848 __string(name, dentry->d_name.name)
Chao Yu0c5e36d2017-10-17 17:33:41 +0800849 __field(nid_t, cino)
850 __field(int, err)
851 ),
852
853 TP_fast_assign(
854 __entry->dev = dir->i_sb->s_dev;
855 __entry->ino = dir->i_ino;
Gao Xiang70a9ac32021-09-21 22:37:30 +0800856 __assign_str(name, dentry->d_name.name);
Chao Yu0c5e36d2017-10-17 17:33:41 +0800857 __entry->cino = ino;
858 __entry->err = err;
859 ),
860
861 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
862 show_dev_ino(__entry),
Gao Xiang70a9ac32021-09-21 22:37:30 +0800863 __get_str(name),
Chao Yu0c5e36d2017-10-17 17:33:41 +0800864 __entry->cino,
865 __entry->err)
866);
867
Chao Yue97a3c42017-10-13 18:01:33 +0800868TRACE_EVENT(f2fs_readdir,
869
870 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
871
872 TP_ARGS(dir, start_pos, end_pos, err),
873
874 TP_STRUCT__entry(
875 __field(dev_t, dev)
876 __field(ino_t, ino)
877 __field(loff_t, start)
878 __field(loff_t, end)
879 __field(int, err)
880 ),
881
882 TP_fast_assign(
883 __entry->dev = dir->i_sb->s_dev;
884 __entry->ino = dir->i_ino;
885 __entry->start = start_pos;
886 __entry->end = end_pos;
887 __entry->err = err;
888 ),
889
890 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
891 show_dev_ino(__entry),
892 __entry->start,
893 __entry->end,
894 __entry->err)
895);
896
Namjae Jeonc01e2852013-04-23 17:00:52 +0900897TRACE_EVENT(f2fs_fallocate,
898
899 TP_PROTO(struct inode *inode, int mode,
900 loff_t offset, loff_t len, int ret),
901
902 TP_ARGS(inode, mode, offset, len, ret),
903
904 TP_STRUCT__entry(
905 __field(dev_t, dev)
906 __field(ino_t, ino)
907 __field(int, mode)
908 __field(loff_t, offset)
909 __field(loff_t, len)
910 __field(loff_t, size)
911 __field(blkcnt_t, blocks)
912 __field(int, ret)
913 ),
914
915 TP_fast_assign(
916 __entry->dev = inode->i_sb->s_dev;
917 __entry->ino = inode->i_ino;
918 __entry->mode = mode;
919 __entry->offset = offset;
920 __entry->len = len;
921 __entry->size = inode->i_size;
922 __entry->blocks = inode->i_blocks;
923 __entry->ret = ret;
924 ),
925
926 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
927 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
928 show_dev_ino(__entry),
929 __entry->mode,
930 (unsigned long long)__entry->offset,
931 (unsigned long long)__entry->len,
932 (unsigned long long)__entry->size,
933 (unsigned long long)__entry->blocks,
934 __entry->ret)
935);
936
Chao Yu70407fa2014-07-31 21:11:22 +0800937TRACE_EVENT(f2fs_direct_IO_enter,
938
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800939 TP_PROTO(struct inode *inode, struct kiocb *iocb, long len, int rw),
Chao Yu70407fa2014-07-31 21:11:22 +0800940
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800941 TP_ARGS(inode, iocb, len, rw),
Chao Yu70407fa2014-07-31 21:11:22 +0800942
943 TP_STRUCT__entry(
944 __field(dev_t, dev)
945 __field(ino_t, ino)
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800946 __field(struct kiocb *, iocb)
Chao Yu70407fa2014-07-31 21:11:22 +0800947 __field(unsigned long, len)
948 __field(int, rw)
949 ),
950
951 TP_fast_assign(
952 __entry->dev = inode->i_sb->s_dev;
953 __entry->ino = inode->i_ino;
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800954 __entry->iocb = iocb;
Chao Yu70407fa2014-07-31 21:11:22 +0800955 __entry->len = len;
956 __entry->rw = rw;
957 ),
958
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800959 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_hint = %x ki_ioprio = %x rw = %d",
Chao Yu70407fa2014-07-31 21:11:22 +0800960 show_dev_ino(__entry),
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800961 __entry->iocb->ki_pos,
Chao Yu70407fa2014-07-31 21:11:22 +0800962 __entry->len,
Jaegeuk Kimbd984c02021-11-19 11:20:33 -0800963 __entry->iocb->ki_flags,
964 __entry->iocb->ki_hint,
965 __entry->iocb->ki_ioprio,
Chao Yu70407fa2014-07-31 21:11:22 +0800966 __entry->rw)
967);
968
969TRACE_EVENT(f2fs_direct_IO_exit,
970
971 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
972 int rw, int ret),
973
974 TP_ARGS(inode, offset, len, rw, ret),
975
976 TP_STRUCT__entry(
977 __field(dev_t, dev)
978 __field(ino_t, ino)
979 __field(loff_t, pos)
980 __field(unsigned long, len)
981 __field(int, rw)
982 __field(int, ret)
983 ),
984
985 TP_fast_assign(
986 __entry->dev = inode->i_sb->s_dev;
987 __entry->ino = inode->i_ino;
988 __entry->pos = offset;
989 __entry->len = len;
990 __entry->rw = rw;
991 __entry->ret = ret;
992 ),
993
994 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
995 "rw = %d ret = %d",
996 show_dev_ino(__entry),
997 __entry->pos,
998 __entry->len,
999 __entry->rw,
1000 __entry->ret)
1001);
1002
Chao Yu46008c62016-05-09 19:56:30 +08001003TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +09001004
Chao Yu46008c62016-05-09 19:56:30 +08001005 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
1006 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001007
Chao Yu46008c62016-05-09 19:56:30 +08001008 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001009
1010 TP_STRUCT__entry(
1011 __field(dev_t, dev)
1012 __field(nid_t, nid)
1013 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +08001014 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +09001015 ),
1016
1017 TP_fast_assign(
1018 __entry->dev = inode->i_sb->s_dev;
1019 __entry->nid = nid;
1020 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +08001021 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +09001022 ),
1023
Chao Yu46008c62016-05-09 19:56:30 +08001024 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001025 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001026 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +08001027 __entry->ofs_in_node,
1028 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +09001029);
1030
Chao Yu3e1c8f12014-12-23 16:35:21 +08001031DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1032
Chao Yu2ace38e2014-12-24 16:08:14 +08001033 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001034
Chao Yu2ace38e2014-12-24 16:08:14 +08001035 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001036
1037 TP_STRUCT__entry(
1038 __field(dev_t, dev)
1039 __field(ino_t, ino)
1040 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +08001041 __field(block_t, old_blkaddr)
1042 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -05001043 __field(int, op)
1044 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -07001045 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +08001046 __field(int, type)
1047 ),
1048
1049 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001050 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1051 __entry->ino = page_file_mapping(page)->host->i_ino;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001052 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +08001053 __entry->old_blkaddr = fio->old_blkaddr;
1054 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -05001055 __entry->op = fio->op;
1056 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -07001057 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +08001058 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001059 ),
1060
1061 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -07001062 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +08001063 show_dev_ino(__entry),
1064 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +08001065 (unsigned long long)__entry->old_blkaddr,
1066 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001067 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -07001068 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001069 show_block_type(__entry->type))
1070);
1071
1072DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1073
Chao Yu2ace38e2014-12-24 16:08:14 +08001074 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001075
Chao Yu2ace38e2014-12-24 16:08:14 +08001076 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001077
1078 TP_CONDITION(page->mapping)
1079);
1080
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001081DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001082
Chao Yu2ace38e2014-12-24 16:08:14 +08001083 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001084
Chao Yu2ace38e2014-12-24 16:08:14 +08001085 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001086
1087 TP_CONDITION(page->mapping)
1088);
1089
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001090DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001091
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001092 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001093
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001094 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001095
1096 TP_STRUCT__entry(
1097 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001098 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001099 __field(int, op)
1100 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001101 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001102 __field(sector_t, sector)
1103 __field(unsigned int, size)
1104 ),
1105
1106 TP_fast_assign(
1107 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001108 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001109 __entry->op = bio_op(bio);
1110 __entry->op_flags = bio->bi_opf;
1111 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001112 __entry->sector = bio->bi_iter.bi_sector;
1113 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001114 ),
1115
Chao Yubaaabbb2017-05-04 09:35:43 +08001116 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001117 show_dev(__entry->target),
1118 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001119 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001120 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001121 (unsigned long long)__entry->sector,
1122 __entry->size)
1123);
1124
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001125DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001126
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001127 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001128
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001129 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001130
1131 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001132);
1133
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001134DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001135
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001136 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001137
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001138 TP_ARGS(sb, type, bio),
1139
1140 TP_CONDITION(bio)
1141);
1142
1143DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1144
1145 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1146
1147 TP_ARGS(sb, type, bio),
1148
1149 TP_CONDITION(bio)
1150);
1151
1152DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1153
1154 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1155
1156 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001157
1158 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001159);
1160
Chao Yu62aed042014-05-06 16:46:04 +08001161TRACE_EVENT(f2fs_write_begin,
1162
1163 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1164 unsigned int flags),
1165
1166 TP_ARGS(inode, pos, len, flags),
1167
1168 TP_STRUCT__entry(
1169 __field(dev_t, dev)
1170 __field(ino_t, ino)
1171 __field(loff_t, pos)
1172 __field(unsigned int, len)
1173 __field(unsigned int, flags)
1174 ),
1175
1176 TP_fast_assign(
1177 __entry->dev = inode->i_sb->s_dev;
1178 __entry->ino = inode->i_ino;
1179 __entry->pos = pos;
1180 __entry->len = len;
1181 __entry->flags = flags;
1182 ),
1183
1184 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1185 show_dev_ino(__entry),
1186 (unsigned long long)__entry->pos,
1187 __entry->len,
1188 __entry->flags)
1189);
1190
Chao Yudfb2bf32014-05-06 16:47:23 +08001191TRACE_EVENT(f2fs_write_end,
1192
1193 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1194 unsigned int copied),
1195
1196 TP_ARGS(inode, pos, len, copied),
1197
1198 TP_STRUCT__entry(
1199 __field(dev_t, dev)
1200 __field(ino_t, ino)
1201 __field(loff_t, pos)
1202 __field(unsigned int, len)
1203 __field(unsigned int, copied)
1204 ),
1205
1206 TP_fast_assign(
1207 __entry->dev = inode->i_sb->s_dev;
1208 __entry->ino = inode->i_ino;
1209 __entry->pos = pos;
1210 __entry->len = len;
1211 __entry->copied = copied;
1212 ),
1213
1214 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1215 show_dev_ino(__entry),
1216 (unsigned long long)__entry->pos,
1217 __entry->len,
1218 __entry->copied)
1219);
1220
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001221DECLARE_EVENT_CLASS(f2fs__page,
1222
1223 TP_PROTO(struct page *page, int type),
1224
1225 TP_ARGS(page, type),
1226
1227 TP_STRUCT__entry(
1228 __field(dev_t, dev)
1229 __field(ino_t, ino)
1230 __field(int, type)
1231 __field(int, dir)
1232 __field(pgoff_t, index)
1233 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +08001234 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001235 ),
1236
1237 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001238 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1239 __entry->ino = page_file_mapping(page)->host->i_ino;
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001240 __entry->type = type;
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001241 __entry->dir =
1242 S_ISDIR(page_file_mapping(page)->host->i_mode);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001243 __entry->index = page->index;
1244 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +08001245 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001246 ),
1247
Chao Yuc20e89c2014-05-06 16:53:08 +08001248 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1249 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001250 show_dev_ino(__entry),
1251 show_block_type(__entry->type),
1252 show_file_type(__entry->dir),
1253 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001254 __entry->dirty,
1255 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001256);
1257
Chao Yuecda0de2014-05-06 16:48:26 +08001258DEFINE_EVENT(f2fs__page, f2fs_writepage,
1259
1260 TP_PROTO(struct page *page, int type),
1261
1262 TP_ARGS(page, type)
1263);
1264
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001265DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1266
1267 TP_PROTO(struct page *page, int type),
1268
1269 TP_ARGS(page, type)
1270);
1271
Chao Yuc20e89c2014-05-06 16:53:08 +08001272DEFINE_EVENT(f2fs__page, f2fs_readpage,
1273
1274 TP_PROTO(struct page *page, int type),
1275
1276 TP_ARGS(page, type)
1277);
1278
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001279DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1280
1281 TP_PROTO(struct page *page, int type),
1282
1283 TP_ARGS(page, type)
1284);
1285
Jaegeuk Kime943a102013-10-25 14:26:31 +09001286DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1287
1288 TP_PROTO(struct page *page, int type),
1289
1290 TP_ARGS(page, type)
1291);
1292
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001293DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1294
1295 TP_PROTO(struct page *page, int type),
1296
1297 TP_ARGS(page, type)
1298);
1299
1300DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1301
1302 TP_PROTO(struct page *page, int type),
1303
1304 TP_ARGS(page, type)
1305);
1306
Chao Yud7648342019-04-15 15:22:19 +08001307TRACE_EVENT(f2fs_filemap_fault,
1308
1309 TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1310
1311 TP_ARGS(inode, index, ret),
1312
1313 TP_STRUCT__entry(
1314 __field(dev_t, dev)
1315 __field(ino_t, ino)
1316 __field(pgoff_t, index)
1317 __field(unsigned long, ret)
1318 ),
1319
1320 TP_fast_assign(
1321 __entry->dev = inode->i_sb->s_dev;
1322 __entry->ino = inode->i_ino;
1323 __entry->index = index;
1324 __entry->ret = ret;
1325 ),
1326
1327 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1328 show_dev_ino(__entry),
1329 (unsigned long)__entry->index,
1330 __entry->ret)
1331);
1332
Chao Yue5748432014-05-06 16:51:24 +08001333TRACE_EVENT(f2fs_writepages,
1334
1335 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1336
1337 TP_ARGS(inode, wbc, type),
1338
1339 TP_STRUCT__entry(
1340 __field(dev_t, dev)
1341 __field(ino_t, ino)
1342 __field(int, type)
1343 __field(int, dir)
1344 __field(long, nr_to_write)
1345 __field(long, pages_skipped)
1346 __field(loff_t, range_start)
1347 __field(loff_t, range_end)
1348 __field(pgoff_t, writeback_index)
1349 __field(int, sync_mode)
1350 __field(char, for_kupdate)
1351 __field(char, for_background)
1352 __field(char, tagged_writepages)
1353 __field(char, for_reclaim)
1354 __field(char, range_cyclic)
1355 __field(char, for_sync)
1356 ),
1357
1358 TP_fast_assign(
1359 __entry->dev = inode->i_sb->s_dev;
1360 __entry->ino = inode->i_ino;
1361 __entry->type = type;
1362 __entry->dir = S_ISDIR(inode->i_mode);
1363 __entry->nr_to_write = wbc->nr_to_write;
1364 __entry->pages_skipped = wbc->pages_skipped;
1365 __entry->range_start = wbc->range_start;
1366 __entry->range_end = wbc->range_end;
1367 __entry->writeback_index = inode->i_mapping->writeback_index;
1368 __entry->sync_mode = wbc->sync_mode;
1369 __entry->for_kupdate = wbc->for_kupdate;
1370 __entry->for_background = wbc->for_background;
1371 __entry->tagged_writepages = wbc->tagged_writepages;
1372 __entry->for_reclaim = wbc->for_reclaim;
1373 __entry->range_cyclic = wbc->range_cyclic;
1374 __entry->for_sync = wbc->for_sync;
1375 ),
1376
1377 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1378 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1379 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1380 show_dev_ino(__entry),
1381 show_block_type(__entry->type),
1382 show_file_type(__entry->dir),
1383 __entry->nr_to_write,
1384 __entry->pages_skipped,
1385 __entry->range_start,
1386 __entry->range_end,
1387 (unsigned long)__entry->writeback_index,
1388 __entry->sync_mode,
1389 __entry->for_kupdate,
1390 __entry->for_background,
1391 __entry->tagged_writepages,
1392 __entry->for_reclaim,
1393 __entry->range_cyclic,
1394 __entry->for_sync)
1395);
1396
Chao Yub8c29402015-10-12 17:02:26 +08001397TRACE_EVENT(f2fs_readpages,
1398
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001399 TP_PROTO(struct inode *inode, pgoff_t start, unsigned int nrpage),
Chao Yub8c29402015-10-12 17:02:26 +08001400
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001401 TP_ARGS(inode, start, nrpage),
Chao Yub8c29402015-10-12 17:02:26 +08001402
1403 TP_STRUCT__entry(
1404 __field(dev_t, dev)
1405 __field(ino_t, ino)
1406 __field(pgoff_t, start)
1407 __field(unsigned int, nrpage)
1408 ),
1409
1410 TP_fast_assign(
1411 __entry->dev = inode->i_sb->s_dev;
1412 __entry->ino = inode->i_ino;
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001413 __entry->start = start;
Chao Yub8c29402015-10-12 17:02:26 +08001414 __entry->nrpage = nrpage;
1415 ),
1416
1417 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1418 show_dev_ino(__entry),
1419 (unsigned long)__entry->start,
1420 __entry->nrpage)
1421);
1422
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001423TRACE_EVENT(f2fs_write_checkpoint,
1424
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001425 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001426
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001427 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001428
1429 TP_STRUCT__entry(
1430 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001431 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001432 __field(char *, msg)
1433 ),
1434
1435 TP_fast_assign(
1436 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001437 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001438 __entry->msg = msg;
1439 ),
1440
1441 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001442 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001443 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001444 __entry->msg)
1445);
1446
Chao Yu0243a5f2017-04-15 14:09:38 +08001447DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001448
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001449 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001450
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001451 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001452
1453 TP_STRUCT__entry(
1454 __field(dev_t, dev)
1455 __field(block_t, blkstart)
1456 __field(block_t, blklen)
1457 ),
1458
1459 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001460 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001461 __entry->blkstart = blkstart;
1462 __entry->blklen = blklen;
1463 ),
1464
1465 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001466 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001467 (unsigned long long)__entry->blkstart,
1468 (unsigned long long)__entry->blklen)
1469);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001470
Chao Yu0243a5f2017-04-15 14:09:38 +08001471DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1472
1473 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1474
1475 TP_ARGS(dev, blkstart, blklen)
1476);
1477
1478DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1479
1480 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1481
1482 TP_ARGS(dev, blkstart, blklen)
1483);
1484
Chao Yu2ec6f2e2017-10-04 09:08:36 +08001485DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1486
1487 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1488
1489 TP_ARGS(dev, blkstart, blklen)
1490);
1491
Damien Le Moal126606c2016-10-28 17:45:07 +09001492TRACE_EVENT(f2fs_issue_reset_zone,
1493
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001494 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001495
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001496 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001497
1498 TP_STRUCT__entry(
1499 __field(dev_t, dev)
1500 __field(block_t, blkstart)
1501 ),
1502
1503 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001504 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001505 __entry->blkstart = blkstart;
1506 ),
1507
1508 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001509 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001510 (unsigned long long)__entry->blkstart)
1511);
1512
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001513TRACE_EVENT(f2fs_issue_flush,
1514
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001515 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001516 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001517
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001518 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001519
1520 TP_STRUCT__entry(
1521 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001522 __field(unsigned int, nobarrier)
1523 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001524 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001525 ),
1526
1527 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001528 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001529 __entry->nobarrier = nobarrier;
1530 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001531 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001532 ),
1533
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001534 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001535 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001536 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001537 __entry->flush_merge ? " with flush_merge" : "",
1538 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001539);
Chao Yu1ec46102015-02-05 17:59:59 +08001540
1541TRACE_EVENT(f2fs_lookup_extent_tree_start,
1542
1543 TP_PROTO(struct inode *inode, unsigned int pgofs),
1544
1545 TP_ARGS(inode, pgofs),
1546
1547 TP_STRUCT__entry(
1548 __field(dev_t, dev)
1549 __field(ino_t, ino)
1550 __field(unsigned int, pgofs)
1551 ),
1552
1553 TP_fast_assign(
1554 __entry->dev = inode->i_sb->s_dev;
1555 __entry->ino = inode->i_ino;
1556 __entry->pgofs = pgofs;
1557 ),
1558
1559 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1560 show_dev_ino(__entry),
1561 __entry->pgofs)
1562);
1563
1564TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1565
1566 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001567 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001568
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001569 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001570
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001571 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001572
1573 TP_STRUCT__entry(
1574 __field(dev_t, dev)
1575 __field(ino_t, ino)
1576 __field(unsigned int, pgofs)
1577 __field(unsigned int, fofs)
1578 __field(u32, blk)
1579 __field(unsigned int, len)
1580 ),
1581
1582 TP_fast_assign(
1583 __entry->dev = inode->i_sb->s_dev;
1584 __entry->ino = inode->i_ino;
1585 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001586 __entry->fofs = ei->fofs;
1587 __entry->blk = ei->blk;
1588 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001589 ),
1590
1591 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1592 "ext_info(fofs: %u, blk: %u, len: %u)",
1593 show_dev_ino(__entry),
1594 __entry->pgofs,
1595 __entry->fofs,
1596 __entry->blk,
1597 __entry->len)
1598);
1599
Chao Yu744288c2015-09-06 17:50:13 +08001600TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001601
Chao Yu744288c2015-09-06 17:50:13 +08001602 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1603 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001604
Chao Yu744288c2015-09-06 17:50:13 +08001605 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001606
1607 TP_STRUCT__entry(
1608 __field(dev_t, dev)
1609 __field(ino_t, ino)
1610 __field(unsigned int, pgofs)
1611 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001612 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001613 ),
1614
1615 TP_fast_assign(
1616 __entry->dev = inode->i_sb->s_dev;
1617 __entry->ino = inode->i_ino;
1618 __entry->pgofs = pgofs;
1619 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001620 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001621 ),
1622
Chao Yu744288c2015-09-06 17:50:13 +08001623 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1624 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001625 show_dev_ino(__entry),
1626 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001627 __entry->blk,
1628 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001629);
1630
1631TRACE_EVENT(f2fs_shrink_extent_tree,
1632
1633 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1634 unsigned int tree_cnt),
1635
1636 TP_ARGS(sbi, node_cnt, tree_cnt),
1637
1638 TP_STRUCT__entry(
1639 __field(dev_t, dev)
1640 __field(unsigned int, node_cnt)
1641 __field(unsigned int, tree_cnt)
1642 ),
1643
1644 TP_fast_assign(
1645 __entry->dev = sbi->sb->s_dev;
1646 __entry->node_cnt = node_cnt;
1647 __entry->tree_cnt = tree_cnt;
1648 ),
1649
1650 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001651 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001652 __entry->node_cnt,
1653 __entry->tree_cnt)
1654);
1655
1656TRACE_EVENT(f2fs_destroy_extent_tree,
1657
1658 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1659
1660 TP_ARGS(inode, node_cnt),
1661
1662 TP_STRUCT__entry(
1663 __field(dev_t, dev)
1664 __field(ino_t, ino)
1665 __field(unsigned int, node_cnt)
1666 ),
1667
1668 TP_fast_assign(
1669 __entry->dev = inode->i_sb->s_dev;
1670 __entry->ino = inode->i_ino;
1671 __entry->node_cnt = node_cnt;
1672 ),
1673
1674 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1675 show_dev_ino(__entry),
1676 __entry->node_cnt)
1677);
1678
Chao Yu4cf18532015-12-17 17:17:16 +08001679DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1680
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001681 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001682
1683 TP_ARGS(sb, type, count),
1684
1685 TP_STRUCT__entry(
1686 __field(dev_t, dev)
1687 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001688 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001689 ),
1690
1691 TP_fast_assign(
1692 __entry->dev = sb->s_dev;
1693 __entry->type = type;
1694 __entry->count = count;
1695 ),
1696
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001697 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001698 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001699 show_file_type(__entry->type),
1700 __entry->count)
1701);
1702
1703DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1704
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001705 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001706
1707 TP_ARGS(sb, type, count)
1708);
1709
1710DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1711
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001712 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001713
1714 TP_ARGS(sb, type, count)
1715);
1716
Chao Yu559e87c2019-02-26 19:01:15 +08001717TRACE_EVENT(f2fs_shutdown,
1718
1719 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1720
1721 TP_ARGS(sbi, mode, ret),
1722
1723 TP_STRUCT__entry(
1724 __field(dev_t, dev)
1725 __field(unsigned int, mode)
1726 __field(int, ret)
1727 ),
1728
1729 TP_fast_assign(
1730 __entry->dev = sbi->sb->s_dev;
1731 __entry->mode = mode;
1732 __entry->ret = ret;
1733 ),
1734
1735 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1736 show_dev(__entry->dev),
1737 show_shutdown_mode(__entry->mode),
1738 __entry->ret)
1739);
1740
Chao Yu4c8ff702019-11-01 18:07:14 +08001741DECLARE_EVENT_CLASS(f2fs_zip_start,
1742
1743 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1744 unsigned int cluster_size, unsigned char algtype),
1745
1746 TP_ARGS(inode, cluster_idx, cluster_size, algtype),
1747
1748 TP_STRUCT__entry(
1749 __field(dev_t, dev)
1750 __field(ino_t, ino)
1751 __field(pgoff_t, idx)
1752 __field(unsigned int, size)
1753 __field(unsigned int, algtype)
1754 ),
1755
1756 TP_fast_assign(
1757 __entry->dev = inode->i_sb->s_dev;
1758 __entry->ino = inode->i_ino;
1759 __entry->idx = cluster_idx;
1760 __entry->size = cluster_size;
1761 __entry->algtype = algtype;
1762 ),
1763
1764 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1765 "cluster_size = %u, algorithm = %s",
1766 show_dev_ino(__entry),
1767 __entry->idx,
1768 __entry->size,
1769 show_compress_algorithm(__entry->algtype))
1770);
1771
1772DECLARE_EVENT_CLASS(f2fs_zip_end,
1773
1774 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1775 unsigned int compressed_size, int ret),
1776
1777 TP_ARGS(inode, cluster_idx, compressed_size, ret),
1778
1779 TP_STRUCT__entry(
1780 __field(dev_t, dev)
1781 __field(ino_t, ino)
1782 __field(pgoff_t, idx)
1783 __field(unsigned int, size)
1784 __field(unsigned int, ret)
1785 ),
1786
1787 TP_fast_assign(
1788 __entry->dev = inode->i_sb->s_dev;
1789 __entry->ino = inode->i_ino;
1790 __entry->idx = cluster_idx;
1791 __entry->size = compressed_size;
1792 __entry->ret = ret;
1793 ),
1794
1795 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1796 "compressed_size = %u, ret = %d",
1797 show_dev_ino(__entry),
1798 __entry->idx,
1799 __entry->size,
1800 __entry->ret)
1801);
1802
1803DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start,
1804
1805 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1806 unsigned int cluster_size, unsigned char algtype),
1807
1808 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1809);
1810
1811DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start,
1812
1813 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1814 unsigned int cluster_size, unsigned char algtype),
1815
1816 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1817);
1818
1819DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end,
1820
1821 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1822 unsigned int compressed_size, int ret),
1823
1824 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1825);
1826
1827DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
1828
1829 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1830 unsigned int compressed_size, int ret),
1831
1832 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1833);
1834
Daeho Jeong52118742021-08-19 20:52:28 -07001835#ifdef CONFIG_F2FS_IOSTAT
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001836TRACE_EVENT(f2fs_iostat,
1837
1838 TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat),
1839
1840 TP_ARGS(sbi, iostat),
1841
1842 TP_STRUCT__entry(
1843 __field(dev_t, dev)
1844 __field(unsigned long long, app_dio)
1845 __field(unsigned long long, app_bio)
1846 __field(unsigned long long, app_wio)
1847 __field(unsigned long long, app_mio)
1848 __field(unsigned long long, fs_dio)
1849 __field(unsigned long long, fs_nio)
1850 __field(unsigned long long, fs_mio)
1851 __field(unsigned long long, fs_gc_dio)
1852 __field(unsigned long long, fs_gc_nio)
1853 __field(unsigned long long, fs_cp_dio)
1854 __field(unsigned long long, fs_cp_nio)
1855 __field(unsigned long long, fs_cp_mio)
Chao Yu8b83ac82020-04-16 18:16:56 +08001856 __field(unsigned long long, app_drio)
1857 __field(unsigned long long, app_brio)
1858 __field(unsigned long long, app_rio)
1859 __field(unsigned long long, app_mrio)
1860 __field(unsigned long long, fs_drio)
Chao Yu9c122382020-04-23 18:03:06 +08001861 __field(unsigned long long, fs_gdrio)
1862 __field(unsigned long long, fs_cdrio)
Chao Yu8b83ac82020-04-16 18:16:56 +08001863 __field(unsigned long long, fs_nrio)
1864 __field(unsigned long long, fs_mrio)
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001865 __field(unsigned long long, fs_discard)
1866 ),
1867
1868 TP_fast_assign(
1869 __entry->dev = sbi->sb->s_dev;
1870 __entry->app_dio = iostat[APP_DIRECT_IO];
1871 __entry->app_bio = iostat[APP_BUFFERED_IO];
1872 __entry->app_wio = iostat[APP_WRITE_IO];
1873 __entry->app_mio = iostat[APP_MAPPED_IO];
1874 __entry->fs_dio = iostat[FS_DATA_IO];
1875 __entry->fs_nio = iostat[FS_NODE_IO];
1876 __entry->fs_mio = iostat[FS_META_IO];
1877 __entry->fs_gc_dio = iostat[FS_GC_DATA_IO];
1878 __entry->fs_gc_nio = iostat[FS_GC_NODE_IO];
1879 __entry->fs_cp_dio = iostat[FS_CP_DATA_IO];
1880 __entry->fs_cp_nio = iostat[FS_CP_NODE_IO];
1881 __entry->fs_cp_mio = iostat[FS_CP_META_IO];
Chao Yu8b83ac82020-04-16 18:16:56 +08001882 __entry->app_drio = iostat[APP_DIRECT_READ_IO];
1883 __entry->app_brio = iostat[APP_BUFFERED_READ_IO];
1884 __entry->app_rio = iostat[APP_READ_IO];
1885 __entry->app_mrio = iostat[APP_MAPPED_READ_IO];
1886 __entry->fs_drio = iostat[FS_DATA_READ_IO];
Chao Yu9c122382020-04-23 18:03:06 +08001887 __entry->fs_gdrio = iostat[FS_GDATA_READ_IO];
1888 __entry->fs_cdrio = iostat[FS_CDATA_READ_IO];
Chao Yu8b83ac82020-04-16 18:16:56 +08001889 __entry->fs_nrio = iostat[FS_NODE_READ_IO];
1890 __entry->fs_mrio = iostat[FS_META_READ_IO];
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001891 __entry->fs_discard = iostat[FS_DISCARD];
1892 ),
1893
1894 TP_printk("dev = (%d,%d), "
1895 "app [write=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
1896 "fs [data=%llu, node=%llu, meta=%llu, discard=%llu], "
1897 "gc [data=%llu, node=%llu], "
Chao Yu8b83ac82020-04-16 18:16:56 +08001898 "cp [data=%llu, node=%llu, meta=%llu], "
1899 "app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
Chao Yu9c122382020-04-23 18:03:06 +08001900 "fs [data=%llu, (gc_data=%llu, compr_data=%llu), "
1901 "node=%llu, meta=%llu]",
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001902 show_dev(__entry->dev), __entry->app_wio, __entry->app_dio,
1903 __entry->app_bio, __entry->app_mio, __entry->fs_dio,
1904 __entry->fs_nio, __entry->fs_mio, __entry->fs_discard,
1905 __entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio,
Chao Yu8b83ac82020-04-16 18:16:56 +08001906 __entry->fs_cp_nio, __entry->fs_cp_mio,
1907 __entry->app_rio, __entry->app_drio, __entry->app_brio,
Chao Yu9c122382020-04-23 18:03:06 +08001908 __entry->app_mrio, __entry->fs_drio, __entry->fs_gdrio,
1909 __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio)
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001910);
Daeho Jeonga4b68172021-08-20 15:29:09 -07001911
1912#ifndef __F2FS_IOSTAT_LATENCY_TYPE
1913#define __F2FS_IOSTAT_LATENCY_TYPE
1914struct f2fs_iostat_latency {
1915 unsigned int peak_lat;
1916 unsigned int avg_lat;
1917 unsigned int cnt;
1918};
1919#endif /* __F2FS_IOSTAT_LATENCY_TYPE */
1920
1921TRACE_EVENT(f2fs_iostat_latency,
1922
1923 TP_PROTO(struct f2fs_sb_info *sbi, struct f2fs_iostat_latency (*iostat_lat)[NR_PAGE_TYPE]),
1924
1925 TP_ARGS(sbi, iostat_lat),
1926
1927 TP_STRUCT__entry(
1928 __field(dev_t, dev)
1929 __field(unsigned int, d_rd_peak)
1930 __field(unsigned int, d_rd_avg)
1931 __field(unsigned int, d_rd_cnt)
1932 __field(unsigned int, n_rd_peak)
1933 __field(unsigned int, n_rd_avg)
1934 __field(unsigned int, n_rd_cnt)
1935 __field(unsigned int, m_rd_peak)
1936 __field(unsigned int, m_rd_avg)
1937 __field(unsigned int, m_rd_cnt)
1938 __field(unsigned int, d_wr_s_peak)
1939 __field(unsigned int, d_wr_s_avg)
1940 __field(unsigned int, d_wr_s_cnt)
1941 __field(unsigned int, n_wr_s_peak)
1942 __field(unsigned int, n_wr_s_avg)
1943 __field(unsigned int, n_wr_s_cnt)
1944 __field(unsigned int, m_wr_s_peak)
1945 __field(unsigned int, m_wr_s_avg)
1946 __field(unsigned int, m_wr_s_cnt)
1947 __field(unsigned int, d_wr_as_peak)
1948 __field(unsigned int, d_wr_as_avg)
1949 __field(unsigned int, d_wr_as_cnt)
1950 __field(unsigned int, n_wr_as_peak)
1951 __field(unsigned int, n_wr_as_avg)
1952 __field(unsigned int, n_wr_as_cnt)
1953 __field(unsigned int, m_wr_as_peak)
1954 __field(unsigned int, m_wr_as_avg)
1955 __field(unsigned int, m_wr_as_cnt)
1956 ),
1957
1958 TP_fast_assign(
1959 __entry->dev = sbi->sb->s_dev;
1960 __entry->d_rd_peak = iostat_lat[0][DATA].peak_lat;
1961 __entry->d_rd_avg = iostat_lat[0][DATA].avg_lat;
1962 __entry->d_rd_cnt = iostat_lat[0][DATA].cnt;
1963 __entry->n_rd_peak = iostat_lat[0][NODE].peak_lat;
1964 __entry->n_rd_avg = iostat_lat[0][NODE].avg_lat;
1965 __entry->n_rd_cnt = iostat_lat[0][NODE].cnt;
1966 __entry->m_rd_peak = iostat_lat[0][META].peak_lat;
1967 __entry->m_rd_avg = iostat_lat[0][META].avg_lat;
1968 __entry->m_rd_cnt = iostat_lat[0][META].cnt;
1969 __entry->d_wr_s_peak = iostat_lat[1][DATA].peak_lat;
1970 __entry->d_wr_s_avg = iostat_lat[1][DATA].avg_lat;
1971 __entry->d_wr_s_cnt = iostat_lat[1][DATA].cnt;
1972 __entry->n_wr_s_peak = iostat_lat[1][NODE].peak_lat;
1973 __entry->n_wr_s_avg = iostat_lat[1][NODE].avg_lat;
1974 __entry->n_wr_s_cnt = iostat_lat[1][NODE].cnt;
1975 __entry->m_wr_s_peak = iostat_lat[1][META].peak_lat;
1976 __entry->m_wr_s_avg = iostat_lat[1][META].avg_lat;
1977 __entry->m_wr_s_cnt = iostat_lat[1][META].cnt;
1978 __entry->d_wr_as_peak = iostat_lat[2][DATA].peak_lat;
1979 __entry->d_wr_as_avg = iostat_lat[2][DATA].avg_lat;
1980 __entry->d_wr_as_cnt = iostat_lat[2][DATA].cnt;
1981 __entry->n_wr_as_peak = iostat_lat[2][NODE].peak_lat;
1982 __entry->n_wr_as_avg = iostat_lat[2][NODE].avg_lat;
1983 __entry->n_wr_as_cnt = iostat_lat[2][NODE].cnt;
1984 __entry->m_wr_as_peak = iostat_lat[2][META].peak_lat;
1985 __entry->m_wr_as_avg = iostat_lat[2][META].avg_lat;
1986 __entry->m_wr_as_cnt = iostat_lat[2][META].cnt;
1987 ),
1988
1989 TP_printk("dev = (%d,%d), "
1990 "iotype [peak lat.(ms)/avg lat.(ms)/count], "
1991 "rd_data [%u/%u/%u], rd_node [%u/%u/%u], rd_meta [%u/%u/%u], "
1992 "wr_sync_data [%u/%u/%u], wr_sync_node [%u/%u/%u], "
1993 "wr_sync_meta [%u/%u/%u], wr_async_data [%u/%u/%u], "
1994 "wr_async_node [%u/%u/%u], wr_async_meta [%u/%u/%u]",
1995 show_dev(__entry->dev),
1996 __entry->d_rd_peak, __entry->d_rd_avg, __entry->d_rd_cnt,
1997 __entry->n_rd_peak, __entry->n_rd_avg, __entry->n_rd_cnt,
1998 __entry->m_rd_peak, __entry->m_rd_avg, __entry->m_rd_cnt,
1999 __entry->d_wr_s_peak, __entry->d_wr_s_avg, __entry->d_wr_s_cnt,
2000 __entry->n_wr_s_peak, __entry->n_wr_s_avg, __entry->n_wr_s_cnt,
2001 __entry->m_wr_s_peak, __entry->m_wr_s_avg, __entry->m_wr_s_cnt,
2002 __entry->d_wr_as_peak, __entry->d_wr_as_avg, __entry->d_wr_as_cnt,
2003 __entry->n_wr_as_peak, __entry->n_wr_as_avg, __entry->n_wr_as_cnt,
2004 __entry->m_wr_as_peak, __entry->m_wr_as_avg, __entry->m_wr_as_cnt)
2005);
Daeho Jeong52118742021-08-19 20:52:28 -07002006#endif
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00002007
Chao Yub79b0a32020-06-29 20:13:12 +08002008TRACE_EVENT(f2fs_bmap,
2009
2010 TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock),
2011
2012 TP_ARGS(inode, lblock, pblock),
2013
2014 TP_STRUCT__entry(
2015 __field(dev_t, dev)
2016 __field(ino_t, ino)
2017 __field(sector_t, lblock)
2018 __field(sector_t, pblock)
2019 ),
2020
2021 TP_fast_assign(
2022 __entry->dev = inode->i_sb->s_dev;
2023 __entry->ino = inode->i_ino;
2024 __entry->lblock = lblock;
2025 __entry->pblock = pblock;
2026 ),
2027
2028 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld",
2029 show_dev_ino(__entry),
2030 (unsigned long long)__entry->lblock,
2031 (unsigned long long)__entry->pblock)
2032);
2033
Chao Yudd5a09b2020-06-29 20:13:13 +08002034TRACE_EVENT(f2fs_fiemap,
2035
2036 TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock,
2037 unsigned long long len, unsigned int flags, int ret),
2038
2039 TP_ARGS(inode, lblock, pblock, len, flags, ret),
2040
2041 TP_STRUCT__entry(
2042 __field(dev_t, dev)
2043 __field(ino_t, ino)
2044 __field(sector_t, lblock)
2045 __field(sector_t, pblock)
2046 __field(unsigned long long, len)
2047 __field(unsigned int, flags)
2048 __field(int, ret)
2049 ),
2050
2051 TP_fast_assign(
2052 __entry->dev = inode->i_sb->s_dev;
2053 __entry->ino = inode->i_ino;
2054 __entry->lblock = lblock;
2055 __entry->pblock = pblock;
2056 __entry->len = len;
2057 __entry->flags = flags;
2058 __entry->ret = ret;
2059 ),
2060
2061 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, "
2062 "len:%llu, flags:%u, ret:%d",
2063 show_dev_ino(__entry),
2064 (unsigned long long)__entry->lblock,
2065 (unsigned long long)__entry->pblock,
2066 __entry->len,
2067 __entry->flags,
2068 __entry->ret)
2069);
2070
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09002071#endif /* _TRACE_F2FS_H */
2072
2073 /* This part must be outside protection */
2074#include <trace/define_trace.h>