Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: erofs: add trace points for reading zipped data

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chen Gong and committed by
Greg Kroah-Hartman
284db12c 6bec5204

+29 -2
+18 -2
drivers/staging/erofs/include/trace/events/erofs.h
··· 162 162 163 163 TP_printk("dev = (%d,%d), nid = %llu, la %llu llen %llu flags %s", 164 164 show_dev_nid(__entry), 165 - __entry->la, __entry->llen, show_map_flags(__entry->flags)) 165 + __entry->la, __entry->llen, 166 + __entry->flags ? show_map_flags(__entry->flags) : "NULL") 166 167 ); 167 168 168 169 DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_flatmode_enter, 169 170 TP_PROTO(struct inode *inode, struct erofs_map_blocks *map, 170 171 unsigned flags), 172 + 173 + TP_ARGS(inode, map, flags) 174 + ); 175 + 176 + DEFINE_EVENT(erofs__map_blocks_enter, z_erofs_map_blocks_iter_enter, 177 + TP_PROTO(struct inode *inode, struct erofs_map_blocks *map, 178 + unsigned int flags), 171 179 172 180 TP_ARGS(inode, map, flags) 173 181 ); ··· 212 204 213 205 TP_printk("dev = (%d,%d), nid = %llu, flags %s " 214 206 "la %llu pa %llu llen %llu plen %llu mflags %s ret %d", 215 - show_dev_nid(__entry), show_map_flags(__entry->flags), 207 + show_dev_nid(__entry), 208 + __entry->flags ? show_map_flags(__entry->flags) : "NULL", 216 209 __entry->la, __entry->pa, __entry->llen, __entry->plen, 217 210 show_mflags(__entry->mflags), __entry->ret) 218 211 ); ··· 221 212 DEFINE_EVENT(erofs__map_blocks_exit, erofs_map_blocks_flatmode_exit, 222 213 TP_PROTO(struct inode *inode, struct erofs_map_blocks *map, 223 214 unsigned flags, int ret), 215 + 216 + TP_ARGS(inode, map, flags, ret) 217 + ); 218 + 219 + DEFINE_EVENT(erofs__map_blocks_exit, z_erofs_map_blocks_iter_exit, 220 + TP_PROTO(struct inode *inode, struct erofs_map_blocks *map, 221 + unsigned int flags, int ret), 224 222 225 223 TP_ARGS(inode, map, flags, ret) 226 224 );
+11
drivers/staging/erofs/unzip_vle.c
··· 13 13 #include "unzip_vle.h" 14 14 #include <linux/prefetch.h> 15 15 16 + #include <trace/events/erofs.h> 17 + 16 18 static struct workqueue_struct *z_erofs_workqueue __read_mostly; 17 19 static struct kmem_cache *z_erofs_workgroup_cachep __read_mostly; 18 20 ··· 614 612 enum z_erofs_page_type page_type; 615 613 unsigned int cur, end, spiltted, index; 616 614 int err = 0; 615 + 616 + trace_erofs_readpage(page, false); 617 617 618 618 /* register locked file pages as online pages in pack */ 619 619 z_erofs_onlinepage_init(page); ··· 1352 1348 struct page *head = NULL; 1353 1349 LIST_HEAD(pagepool); 1354 1350 1351 + trace_erofs_readpages(mapping->host, lru_to_page(pages), 1352 + nr_pages, false); 1353 + 1355 1354 #if (EROFS_FS_ZIP_CACHE_LVL >= 2) 1356 1355 f.cachedzone_la = (erofs_off_t)lru_to_page(pages)->index << PAGE_SHIFT; 1357 1356 #endif ··· 1578 1571 unsigned int cluster_type, logical_cluster_ofs; 1579 1572 int err = 0; 1580 1573 1574 + trace_z_erofs_map_blocks_iter_enter(inode, map, flags); 1575 + 1581 1576 /* when trying to read beyond EOF, leave it unmapped */ 1582 1577 if (unlikely(map->m_la >= inode->i_size)) { 1583 1578 DBG_BUGON(!initial); ··· 1697 1688 debugln("%s, m_la %llu m_pa %llu m_llen %llu m_plen %llu m_flags 0%o", 1698 1689 __func__, map->m_la, map->m_pa, 1699 1690 map->m_llen, map->m_plen, map->m_flags); 1691 + 1692 + trace_z_erofs_map_blocks_iter_exit(inode, map, flags, err); 1700 1693 1701 1694 /* aggressively BUG_ON iff CONFIG_EROFS_FS_DEBUG is on */ 1702 1695 DBG_BUGON(err < 0 && err != -ENOMEM);