diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2013-04-23 03:38:02 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-23 03:40:43 -0400 |
commit | 848753aa3b19a6513315ca54f22ba1e2732ea94a (patch) | |
tree | ce20c2bc01505b67a9ce3fe0291b84bff22dde5d /include/trace | |
parent | 51dd62493477923723c797c6da60121ed39900ed (diff) |
f2fs: add tracepoint for tracing the page i/o
Add tracepoints for page i/o operations and block allocation
tracing during page read operation.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Pankaj Kumar <pankaj.km@samsung.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
[Jaegeuk: combine and modify the tracepoint structures]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/f2fs.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 4bbd19f79d27..924e69aa984f 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
@@ -8,6 +8,15 @@ | |||
8 | 8 | ||
9 | #define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev) | 9 | #define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev) |
10 | #define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino | 10 | #define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino |
11 | #define show_bio_type(type) \ | ||
12 | __print_symbolic(type, \ | ||
13 | { READ, "READ" }, \ | ||
14 | { READA, "READAHEAD" }, \ | ||
15 | { READ_SYNC, "READ_SYNC" }, \ | ||
16 | { WRITE, "WRITE" }, \ | ||
17 | { WRITE_SYNC, "WRITE_SYNC" }, \ | ||
18 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ | ||
19 | { WRITE_FUA, "WRITE_FUA" }) | ||
11 | 20 | ||
12 | DECLARE_EVENT_CLASS(f2fs__inode, | 21 | DECLARE_EVENT_CLASS(f2fs__inode, |
13 | 22 | ||
@@ -365,6 +374,71 @@ TRACE_EVENT(f2fs_truncate_partial_nodes, | |||
365 | __entry->err) | 374 | __entry->err) |
366 | ); | 375 | ); |
367 | 376 | ||
377 | TRACE_EVENT_CONDITION(f2fs_readpage, | ||
378 | |||
379 | TP_PROTO(struct page *page, sector_t blkaddr, int type), | ||
380 | |||
381 | TP_ARGS(page, blkaddr, type), | ||
382 | |||
383 | TP_CONDITION(page->mapping), | ||
384 | |||
385 | TP_STRUCT__entry( | ||
386 | __field(dev_t, dev) | ||
387 | __field(ino_t, ino) | ||
388 | __field(pgoff_t, index) | ||
389 | __field(sector_t, blkaddr) | ||
390 | __field(int, type) | ||
391 | ), | ||
392 | |||
393 | TP_fast_assign( | ||
394 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
395 | __entry->ino = page->mapping->host->i_ino; | ||
396 | __entry->index = page->index; | ||
397 | __entry->blkaddr = blkaddr; | ||
398 | __entry->type = type; | ||
399 | ), | ||
400 | |||
401 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | ||
402 | "blkaddr = 0x%llx, bio_type = %s", | ||
403 | show_dev_ino(__entry), | ||
404 | (unsigned long)__entry->index, | ||
405 | (unsigned long long)__entry->blkaddr, | ||
406 | show_bio_type(__entry->type)) | ||
407 | ); | ||
408 | |||
409 | TRACE_EVENT(f2fs_get_data_block, | ||
410 | TP_PROTO(struct inode *inode, sector_t iblock, | ||
411 | struct buffer_head *bh, int ret), | ||
412 | |||
413 | TP_ARGS(inode, iblock, bh, ret), | ||
414 | |||
415 | TP_STRUCT__entry( | ||
416 | __field(dev_t, dev) | ||
417 | __field(ino_t, ino) | ||
418 | __field(sector_t, iblock) | ||
419 | __field(sector_t, bh_start) | ||
420 | __field(size_t, bh_size) | ||
421 | __field(int, ret) | ||
422 | ), | ||
423 | |||
424 | TP_fast_assign( | ||
425 | __entry->dev = inode->i_sb->s_dev; | ||
426 | __entry->ino = inode->i_ino; | ||
427 | __entry->iblock = iblock; | ||
428 | __entry->bh_start = bh->b_blocknr; | ||
429 | __entry->bh_size = bh->b_size; | ||
430 | __entry->ret = ret; | ||
431 | ), | ||
432 | |||
433 | TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, " | ||
434 | "start blkaddr = 0x%llx, len = 0x%llx bytes, err = %d", | ||
435 | show_dev_ino(__entry), | ||
436 | (unsigned long long)__entry->iblock, | ||
437 | (unsigned long long)__entry->bh_start, | ||
438 | (unsigned long long)__entry->bh_size, | ||
439 | __entry->ret) | ||
440 | ); | ||
441 | |||
368 | #endif /* _TRACE_F2FS_H */ | 442 | #endif /* _TRACE_F2FS_H */ |
369 | 443 | ||
370 | /* This part must be outside protection */ | 444 | /* This part must be outside protection */ |