From: Gao Xiang <gaoxiang25@huawei.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<devel@driverdev.osuosl.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
<linux-erofs@lists.ozlabs.org>, "Chao Yu" <yuchao0@huawei.com>,
Miao Xie <miaoxie@huawei.com>, <weidu.du@huawei.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
Chen Gong <gongchen4@huawei.com>,
Gao Xiang <gaoxiang25@huawei.com>
Subject: [PATCH v2 7/8] staging: erofs: add trace points for reading zipped data
Date: Tue, 18 Sep 2018 22:27:27 +0800 [thread overview]
Message-ID: <1537280848-122331-3-git-send-email-gaoxiang25@huawei.com> (raw)
In-Reply-To: <1537280848-122331-1-git-send-email-gaoxiang25@huawei.com>
From: Chen Gong <gongchen4@huawei.com>
This patch adds trace points for reading zipped data.
Signed-off-by: Chen Gong <gongchen4@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
---
drivers/staging/erofs/include/trace/events/erofs.h | 20 ++++++++++++++++++--
drivers/staging/erofs/unzip_vle.c | 11 +++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/erofs/include/trace/events/erofs.h b/drivers/staging/erofs/include/trace/events/erofs.h
index 5aead93..660c92f 100644
--- a/drivers/staging/erofs/include/trace/events/erofs.h
+++ b/drivers/staging/erofs/include/trace/events/erofs.h
@@ -162,7 +162,8 @@
TP_printk("dev = (%d,%d), nid = %llu, la %llu llen %llu flags %s",
show_dev_nid(__entry),
- __entry->la, __entry->llen, show_map_flags(__entry->flags))
+ __entry->la, __entry->llen,
+ __entry->flags ? show_map_flags(__entry->flags) : "NULL")
);
DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_flatmode_enter,
@@ -172,6 +173,13 @@
TP_ARGS(inode, map, flags)
);
+DEFINE_EVENT(erofs__map_blocks_enter, z_erofs_map_blocks_iter_enter,
+ TP_PROTO(struct inode *inode, struct erofs_map_blocks *map,
+ unsigned int flags),
+
+ TP_ARGS(inode, map, flags)
+);
+
DECLARE_EVENT_CLASS(erofs__map_blocks_exit,
TP_PROTO(struct inode *inode, struct erofs_map_blocks *map,
unsigned int flags, int ret),
@@ -204,7 +212,8 @@
TP_printk("dev = (%d,%d), nid = %llu, flags %s "
"la %llu pa %llu llen %llu plen %llu mflags %s ret %d",
- show_dev_nid(__entry), show_map_flags(__entry->flags),
+ show_dev_nid(__entry),
+ __entry->flags ? show_map_flags(__entry->flags) : "NULL",
__entry->la, __entry->pa, __entry->llen, __entry->plen,
show_mflags(__entry->mflags), __entry->ret)
);
@@ -216,6 +225,13 @@
TP_ARGS(inode, map, flags, ret)
);
+DEFINE_EVENT(erofs__map_blocks_exit, z_erofs_map_blocks_iter_exit,
+ TP_PROTO(struct inode *inode, struct erofs_map_blocks *map,
+ unsigned int flags, int ret),
+
+ TP_ARGS(inode, map, flags, ret)
+);
+
TRACE_EVENT(erofs_destroy_inode,
TP_PROTO(struct inode *inode),
diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 08c424c..2b9b313 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -13,6 +13,8 @@
#include "unzip_vle.h"
#include <linux/prefetch.h>
+#include <trace/events/erofs.h>
+
static struct workqueue_struct *z_erofs_workqueue __read_mostly;
static struct kmem_cache *z_erofs_workgroup_cachep __read_mostly;
@@ -613,6 +615,8 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
unsigned int cur, end, spiltted, index;
int err = 0;
+ trace_erofs_readpage(page, false);
+
/* register locked file pages as online pages in pack */
z_erofs_onlinepage_init(page);
@@ -1348,6 +1352,9 @@ static inline int __z_erofs_vle_normalaccess_readpages(
struct page *head = NULL;
LIST_HEAD(pagepool);
+ trace_erofs_readpages(mapping->host, lru_to_page(pages),
+ nr_pages, false);
+
#if (EROFS_FS_ZIP_CACHE_LVL >= 2)
f.cachedzone_la = (erofs_off_t)lru_to_page(pages)->index << PAGE_SHIFT;
#endif
@@ -1571,6 +1578,8 @@ int z_erofs_map_blocks_iter(struct inode *inode,
unsigned int cluster_type, logical_cluster_ofs;
int err = 0;
+ trace_z_erofs_map_blocks_iter_enter(inode, map, flags);
+
/* when trying to read beyond EOF, leave it unmapped */
if (unlikely(map->m_la >= inode->i_size)) {
DBG_BUGON(!initial);
@@ -1689,6 +1698,8 @@ int z_erofs_map_blocks_iter(struct inode *inode,
__func__, map->m_la, map->m_pa,
map->m_llen, map->m_plen, map->m_flags);
+ trace_z_erofs_map_blocks_iter_exit(inode, map, flags, err);
+
/* aggressively BUG_ON iff CONFIG_EROFS_FS_DEBUG is on */
DBG_BUGON(err < 0 && err != -ENOMEM);
return err;
--
1.9.1
next prev parent reply other threads:[~2018-09-18 14:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 14:25 [PATCH v2 0/8] staging: erofs: error handing and more tracepoints Gao Xiang
2018-09-18 14:25 ` [PATCH v2 1/8] staging: erofs: fix a missing endian conversion Gao Xiang
2018-09-18 14:25 ` [PATCH v2 2/8] staging: erofs: clean up z_erofs_map_blocks_iter Gao Xiang
2018-09-18 14:25 ` [PATCH v2 3/8] staging: erofs: complete error handing of z_erofs_map_blocks_iter Gao Xiang
2018-09-18 14:25 ` [PATCH v2 4/8] staging: erofs: fix a bug when appling cache strategy Gao Xiang
2018-09-18 14:27 ` [PATCH v2 5/8] staging: erofs: complete error handing of z_erofs_do_read_page Gao Xiang
2018-09-18 14:27 ` [PATCH v2 6/8] staging: erofs: avoid magic constants when initializing clusterbits Gao Xiang
2018-09-18 14:27 ` Gao Xiang [this message]
2018-09-18 14:27 ` [PATCH v2 8/8] staging: erofs: replace BUG_ON with DBG_BUGON in data.c Gao Xiang
2018-09-18 14:36 ` [PATCH v2 0/8] staging: erofs: error handing and more tracepoints Greg Kroah-Hartman
2018-09-18 14:38 ` Gao Xiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1537280848-122331-3-git-send-email-gaoxiang25@huawei.com \
--to=gaoxiang25@huawei.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gongchen4@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=weidu.du@huawei.com \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®