diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-07-26 20:21:55 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-27 17:24:08 +0200 |
commit | 13f06f48f7bf8ebfa443e9496d382fa3d20b9ff3 (patch) | |
tree | 18087b4fe39da65673549e5e1aad0ccdadc4a75d /drivers/staging/erofs/data.c | |
parent | staging: erofs: introduce error injection infrastructure (diff) | |
download | linux-dev-13f06f48f7bf8ebfa443e9496d382fa3d20b9ff3.tar.xz linux-dev-13f06f48f7bf8ebfa443e9496d382fa3d20b9ff3.zip |
staging: erofs: support tracepoint
Add basic tracepoints for ->readpage{,s}, ->lookup,
->destroy_inode, fill_inode and map_blocks.
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/data.c')
-rw-r--r-- | drivers/staging/erofs/data.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c index 4ddb5c086b44..47d1787e99ef 100644 --- a/drivers/staging/erofs/data.c +++ b/drivers/staging/erofs/data.c @@ -13,6 +13,8 @@ #include "internal.h" #include <linux/prefetch.h> +#include <trace/events/erofs.h> + static inline void read_endio(struct bio *bio) { int i; @@ -113,6 +115,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode, u64 offset = map->m_la; struct erofs_vnode *vi = EROFS_V(inode); + trace_erofs_map_blocks_flatmode_enter(inode, map, flags); BUG_ON(is_inode_layout_compression(inode)); nblocks = DIV_ROUND_UP(inode->i_size, PAGE_SIZE); @@ -150,8 +153,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode, out: map->m_llen = map->m_plen; - debugln("%s, m_la 0x%llx m_pa %llx m_len %llu", - __func__, map->m_la, map->m_pa, map->m_plen); + trace_erofs_map_blocks_flatmode_exit(inode, map, flags, 0); return 0; } @@ -305,6 +307,8 @@ static int erofs_raw_access_readpage(struct file *file, struct page *page) erofs_off_t last_block; struct bio *bio; + trace_erofs_readpage(page, true); + bio = erofs_read_raw_page(NULL, page->mapping, page, &last_block, 1, false); @@ -322,9 +326,12 @@ static int erofs_raw_access_readpages(struct file *filp, erofs_off_t last_block; struct bio *bio = NULL; gfp_t gfp = readahead_gfp_mask(mapping); + struct page *page = list_last_entry(pages, struct page, lru); + + trace_erofs_readpages(mapping->host, page, nr_pages, true); for (; nr_pages; --nr_pages) { - struct page *page = list_entry(pages->prev, struct page, lru); + page = list_entry(pages->prev, struct page, lru); prefetchw(&page->flags); list_del(&page->lru); |