diff --git a/0004-skip-check_cpu_map-with-pipe-input.patch b/0004-skip-check_cpu_map-with-pipe-input.patch new file mode 100644 index 0000000000000000000000000000000000000000..92a9fd8a7e01cffc59ff964f088403a2b8e4e4c4 --- /dev/null +++ b/0004-skip-check_cpu_map-with-pipe-input.patch @@ -0,0 +1,37 @@ +From ac416ab67cd7add0089c3bc668427e6b909eb59e Mon Sep 17 00:00:00 2001 +From: Jeff Mahoney +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 +Signed-off-by: Jens Axboe +--- + 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 + diff --git a/blktrace.spec b/blktrace.spec index ab9569dc575ccbf815ae189469e15d01449e043e..42b94cdf7b82a5e45614b03335ffd6045bf404f2 100644 --- a/blktrace.spec +++ b/blktrace.spec @@ -1,6 +1,6 @@ Name: blktrace Version: 1.3.0 -Release: 2 +Release: 3 Summary: Block IO tracer in the Linux kernel License: GPLv2+ Source: http://brick.kernel.dk/snaps/blktrace-%{version}.tar.bz2 @@ -14,6 +14,7 @@ Requires: python3 Patch1: 0001-blktrace-remove-python2-dedpendency.patch Patch2: 0002-blktrace-Makefile-add-fstack-protector-strong-flag.patch Patch3: 0003-blktrace-fix-exit-directly-when-nthreads-running.patch +Patch4: 0004-skip-check_cpu_map-with-pipe-input.patch %description blktrace is a block layer IO tracing mechanism which provides detailed @@ -50,6 +51,9 @@ make dest=%{buildroot} prefix=%{buildroot}/%{_prefix} mandir=%{buildroot}/%{_man %changelog +* Thu Apr 18 2024 xuchenchen - 1.3.0-3 +- blkparse: skip check_cpu_map with pipe input + * Mon May 16 2022 Li Jinlin - 1.3.0-2 - provide iowatcher via Provides