staging: erofs: add trace points for reading zipped data
PATCH 1/1 staging: erofs: add trace points for reading zipped data
This patch adds trace points for reading zipped data.
--- drivers/staging/erofs/include/trace/events/erofs.h | 20 ++++++++++++++++++-- drivers/staging/erofs/unzip_vle.c | 10 ++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)
drivers/staging/erofs/include/trace/events/erofs.h +18 -2
@@ -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) :"Z" ) ); 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 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) :"Z" , __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 flags, int ret), + +TP_ARGS (inode, map, flags, ret) +); + TRACE_EVENT(erofs_destroy_inode, TP_PROTO(struct inode *inode),
drivers/staging/erofs/unzip_vle.c +10 -0
@@ -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 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);
@@ -1347,6 +1351,8 @@ 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 =lru_to_page (pages)->index <<PAGE_SHIFT ;#endif
@@ -1569,6 +1575,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);
@@ -1687,6 +1695,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;
Signature · 1 line
1.9.1
PATCH 1/1 staging: erofs: add trace points for reading zipped data
Hi Chen,
Quoted 13 lines · Chen Gong
This patch adds trace points for reading zipped data.
Signed-off-by Chen Gong <gongchen4 at huawei.com>--- drivers/staging/erofs/include/trace/events/erofs.h | 20 ++++++++++++++++++-- drivers/staging/erofs/unzip_vle.c | 10 ++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)drivers/staging/erofs/include/trace/events/erofs.h +0
-0
drivers/staging/erofs/include/trace/events/erofs.h line 166
Quoted 6 lines
drivers/staging/erofs/include/trace/events/erofs.h +2
-1@@ -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) :"Z" )
I personally tend to use__entry->flags ? show_map_flags(__entry->flags) : "(default)" or__entry->flags ? show_map_flags(__entry->flags) : "(null)" here, since no flag doesn't only mean ZIPPED or something else.
Quoted 18 lines
drivers/staging/erofs/include/trace/events/erofs.h +7
-0); 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 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),
drivers/staging/erofs/include/trace/events/erofs.h line 216
Quoted 6 lines
drivers/staging/erofs/include/trace/events/erofs.h +2
-1@@ -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) : "Z",
ditto.
Thanks,
Gao Xiang
Quoted 67 lines
drivers/staging/erofs/include/trace/events/erofs.h +7
-0__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 flags, int ret), + +TP_ARGS (inode, map, flags, ret) +); + TRACE_EVENT(erofs_destroy_inode, TP_PROTO(struct inode *inode),drivers/staging/erofs/unzip_vle.c +10
-0@@ -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 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);@@ -1347,6 +1351,8 @@ 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 =lru_to_page (pages)->index <<PAGE_SHIFT ;#endif @@ -1569,6 +1575,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);@@ -1687,6 +1695,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;
Hi Xiang,
Thanks, I will change the "Z" flag to "NULL".
Hi Chao,
Do you have any other suggestions? Thanks.
-----????-----
??: Re: [PREVIEW] [PATCH] staging: erofs: add trace points for reading zipped data
Hi Chen,
Quoted 14 lines · Chen Gong
This patch adds trace points for reading zipped data.
Signed-off-by Chen Gong <gongchen4 at huawei.com>--- drivers/staging/erofs/include/trace/events/erofs.h | 20 ++++++++++++++++++-- drivers/staging/erofs/unzip_vle.c | 10 ++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)drivers/staging/erofs/include/trace/events/erofs.h +0
-0
drivers/staging/erofs/include/trace/events/erofs.h line 166
Quoted 6 lines
drivers/staging/erofs/include/trace/events/erofs.h +2
-1@@ -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) :"Z" )
I personally tend to use__entry->flags ? show_map_flags(__entry->flags) : "(default)" or__entry->flags ? show_map_flags(__entry->flags) : "(null)" here, since no flag doesn't only mean ZIPPED or something else.
Quoted 18 lines
drivers/staging/erofs/include/trace/events/erofs.h +0
-0); DEFINE_EVENT(erofs__map_blocks_enter,
erofs_map_blocks_flatmode_enter, @@ -172,6 +173,13 @@drivers/staging/erofs/include/trace/events/erofs.h +7
-0TP_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 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),
drivers/staging/erofs/include/trace/events/erofs.h line 216
Quoted 6 lines
drivers/staging/erofs/include/trace/events/erofs.h +2
-1@@ -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) : "Z",
ditto.
Thanks,
Gao Xiang
Quoted 67 lines
drivers/staging/erofs/include/trace/events/erofs.h +0
-0__entry->la, __entry->pa, __entry->llen, __entry->plen, show_mflags(__entry->mflags), __entry->ret) ); @@ -216,6 +225,13@@
drivers/staging/erofs/include/trace/events/erofs.h +7
-0TP_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 flags, int ret), + +TP_ARGS (inode, map, flags, ret) +); + TRACE_EVENT(erofs_destroy_inode, TP_PROTO(struct inode *inode),drivers/staging/erofs/unzip_vle.c +11
-0@@ -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 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);@@ -1347,6 +1351,8 @@ 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 =lru_to_page (pages)->index <<PAGE_SHIFT ;#endif @@ -1569,6 +1575,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);@@ -1687,6 +1695,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;
Hi Chen,
Quoted 7 lines · gongchen (E)
Hi Xiang,
Thanks, I will change the "Z" flag to "NULL".
Hi Chao,
Do you have any other suggestions? Thanks.
It needs to do cleanup as Xiang's suggestion, otherwise it looks good to me. ;)
You can add my Reviewed-by tag in v2.
Thanks,
Quoted 132 lines
-----????-----
??: Re: [PREVIEW] [PATCH] staging: erofs: add trace points for reading zipped dataHi Chen,
Quoted 14 lines · Chen Gong
This patch adds trace points for reading zipped data.
Signed-off-by Chen Gong <gongchen4 at huawei.com>--- drivers/staging/erofs/include/trace/events/erofs.h | 20 ++++++++++++++++++-- drivers/staging/erofs/unzip_vle.c | 10 ++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)drivers/staging/erofs/include/trace/events/erofs.h +0
-0drivers/staging/erofs/include/trace/events/erofs.h line 166
Quoted 6 lines
drivers/staging/erofs/include/trace/events/erofs.h +2
-1@@ -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) :"Z" )I personally tend to use
__entry->flags?show_map_flags(__entry->flags): "(default)" or__entry->flags?show_map_flags(__entry->flags): "(null)" here, since no flag doesn't only mean ZIPPED or something else.Quoted 18 lines
drivers/staging/erofs/include/trace/events/erofs.h +0
-0); DEFINE_EVENT(erofs__map_blocks_enter,
erofs_map_blocks_flatmode_enter, @@ -172,6 +173,13 @@drivers/staging/erofs/include/trace/events/erofs.h +7
-0TP_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 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),drivers/staging/erofs/include/trace/events/erofs.h line 216
Quoted 6 lines
drivers/staging/erofs/include/trace/events/erofs.h +2
-1@@ -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) : "Z",ditto.
Thanks,
Gao XiangQuoted 67 lines
drivers/staging/erofs/include/trace/events/erofs.h +0
-0__entry->la, __entry->pa, __entry->llen, __entry->plen, show_mflags(__entry->mflags), __entry->ret) ); @@ -216,6 +225,13@@
drivers/staging/erofs/include/trace/events/erofs.h +7
-0TP_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 flags, int ret), + +TP_ARGS (inode, map, flags, ret) +); + TRACE_EVENT(erofs_destroy_inode, TP_PROTO(struct inode *inode),drivers/staging/erofs/unzip_vle.c +11
-0@@ -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 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);@@ -1347,6 +1351,8 @@ 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 =lru_to_page (pages)->index <<PAGE_SHIFT ;#endif @@ -1569,6 +1575,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);@@ -1687,6 +1695,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;