1 Star 0 Fork 18

xuchenchen/blktrace

forked from src-openEuler/blktrace 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-skip-check_cpu_map-with-pipe-input.patch 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
xuchenchen 提交于 2024-04-18 17:44 +08:00 . skip check_cpu_map with pipe input
From ac416ab67cd7add0089c3bc668427e6b909eb59e Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Date: 2021-10-21 10:16:19 -0400
Subject: [PATCH] skip check_cpu_map with pipe input
When we're using pipe input, we don't track online CPUs and don't have a
cpu_map. When we start to show entries, check_sequence will be invoked.
If the first entry isn't sequence 1 (perhaps it's been dropped?), we'll
proceed to check_cpu_map. Since we haven't tracked online CPUs,
pdi->cpu_map_max will be 0 and we'll do a malloc(0). Then we'll start
setting bits corresponding to CPU numbers in memory we don't own. Since
there's nothing to check here, let's skip it on pipe input.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
blkparse.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blkparse.c b/blkparse.c
index f88204a..498857c 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -2229,6 +2229,10 @@ static int check_cpu_map(struct per_dev_info *pdi)
unsigned int i;
int ret, cpu;
+ /* Pipe input doesn't do CPU online tracking. */
+ if (!pdi->cpu_map_max)
+ return 0;
+
/*
* create a map of the cpus we have traces for
*/
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuchenc/blktrace.git
git@gitee.com:xuchenc/blktrace.git
xuchenc
blktrace
blktrace
master

搜索帮助