Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f769320612
!75 backport upstream patches
From: @wangxiao65 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-09-24 06:42:10 +00:00
wangxiao65
59710ebf5f backport upstream patches 2024-09-24 06:13:25 +00:00
openeuler-ci-bot
653e819d39
!56 [sync] PR-55: update changelog time
From: @openeuler-sync-bot 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
2022-10-09 09:28:38 +00:00
linfeilong835
505787f5a1 update changlog time
Signed-off-by: linfeilong835 <linfeilong@huawei.com>
(cherry picked from commit 48bfd19527bba71852ecc66e81b0e6ed1fc50803)
2022-10-09 17:19:50 +08:00
openeuler-ci-bot
6f99002eeb !46 [sync] PR-43: Fixed the issue of modifying parallel compilation
From: @openeuler-sync-bot
Reviewed-by: @liuzhiqiang26
Signed-off-by: @liuzhiqiang26
2021-10-11 02:41:29 +00:00
zhanchengbin
51b5581707 Fixed the issue of modifying parallel compilation
(cherry picked from commit 5c12e469261836e26e6b3e0a2992f3cf18b86caf)
2021-10-11 10:24:33 +08:00
openeuler-ci-bot
0462aa5161 !37 Sync changes from master
From: @wenchao-hao
Reviewed-by: @wubo009
Signed-off-by: @wubo009
2021-09-29 06:54:32 +00:00
Wenchao Hao
166d5034f1 NOP:nothing but to make it able to sync between differnt branches
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-09-29 09:34:39 +08:00
zhanchengbin
42df552f1d Makefile add fstack-protector-strong flag patch
(cherry picked from commit a2218b6084cb9d18e93ea600dd98873ebf0c7a28)
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-09-28 22:12:54 +08:00
chenyanpanHW
89a405cb1b delete -Sgit from %autosetup, and delete BuildRequires git
Conflicts:
	blktrace.spec

Conflicts:
	blktrace.spec
2021-09-28 22:11:14 +08:00
7 changed files with 295 additions and 5 deletions

View File

@ -0,0 +1,26 @@
From 1e60db1dfd320d8b22dcb3e7d4636fcda12ec6dd Mon Sep 17 00:00:00 2001
From: zhanchengbin <zhanchengbin1@huawei.com>
Date: Mon, 13 Sep 2021 19:42:31 +0800
Subject: [PATCH] blktrace: Makefile add fstack-protector-strong flag
Makefile add fstack-protector-strong flag
Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index fdbded0..dbdbb37 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -Wall -O2 -g -W
+CFLAGS = -Wall -O2 -g -W -fstack-protector-strong
ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PROGS = blkparse blktrace verify_blkparse blkrawverify blkiomon
LIBS = -lpthread
--
1.8.3.1

View File

@ -0,0 +1,70 @@
From 519fd9a5d08d85f3d9cb4192d624fe8351e40232 Mon Sep 17 00:00:00 2001
From: "Robin H. Johnson" <robbat2@gentoo.org>
Date: Tue, 23 Jan 2018 17:57:55 -0500
Subject: [PATCH] fix parallel build failures
When building in parallel, the btreplay/btrecord and btreplay/btreplay
targets cause make to kick off two jobs for `make -C btreplay` and they
sometimes end up clobbering each other. We could fix this by making one
a dependency of the other, but it's a bit cleaner to refactor things to
be based on subdirs. This way changes in subdirs also get noticed:
$ touch btreplay/*.[ch]
$ make
<btreplay is now correctly updated>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
Makefile | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index 68de591..5917814 100644
--- a/Makefile
+++ b/Makefile
@@ -4,23 +4,19 @@ ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PROGS = blkparse blktrace verify_blkparse blkrawverify blkiomon
LIBS = -lpthread
SCRIPTS = btrace
+SUBDIRS = btreplay btt iowatcher
-ALL = $(PROGS) $(SCRIPTS) btt/btt btreplay/btrecord btreplay/btreplay \
+ALL = $(PROGS) $(SCRIPTS)
+INSTALL_ALL = $(ALL) btt/btt btreplay/btrecord btreplay/btreplay \
btt/bno_plot.py iowatcher/iowatcher
-all: $(ALL)
+all: $(ALL) $(SUBDIRS)
-btt/btt:
- $(MAKE) -C btt
-
-iowatcher/iowatcher:
- $(MAKE) -C iowatcher
-
-btreplay/btrecord:
- $(MAKE) -C btreplay
-
-btreplay/btreplay:
- $(MAKE) -C btreplay
+# We always descend into subdirs because they contain their own dependency
+# information which we don't track in this top level Makefile.
+$(SUBDIRS):
+ $(MAKE) -C $@
+.PHONY: $(SUBDIRS)
%.o: %.c
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
@@ -85,7 +81,7 @@ install: all
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man8
- $(INSTALL) -m 755 $(ALL) $(DESTDIR)$(bindir)
+ $(INSTALL) -m 755 $(INSTALL_ALL) $(DESTDIR)$(bindir)
$(INSTALL) -m 644 doc/*.1 $(DESTDIR)$(mandir)/man1
$(INSTALL) -m 644 doc/*.8 $(DESTDIR)$(mandir)/man8
--
1.8.3.1

View File

@ -0,0 +1,38 @@
From f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc Mon Sep 17 00:00:00 2001
From: Gwendal Grignou <gwendal@chromium.org>
Date: Thu, 16 Jan 2020 12:33:26 -0800
Subject: [PATCH] fix parallel build of btt and blkiomon
rbtree.c is used by both binaries. It is possible that when make -C btt
is invoked rbtree.o does not exist yet, but is already schedule by the
compilation of blkiomon. That could result in recompiling rbtree.o again
for btt/btt.
In that case, at install time, make will recompile blkiomon which can
fail in gentoo, because CC variable is not overriden by ebuild script at
install time. (see https://bugs.gentoo.org/705594)
Add a dependency on SUBDIRS to wait for all binary in . to be compiled.
It will guarante rbtree.o exists.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5917814..eb3c6a1 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ all: $(ALL) $(SUBDIRS)
# We always descend into subdirs because they contain their own dependency
# information which we don't track in this top level Makefile.
-$(SUBDIRS):
+$(SUBDIRS): $(PROGS)
$(MAKE) -C $@
.PHONY: $(SUBDIRS)
--
1.8.3.1

View File

@ -0,0 +1,40 @@
From ac416ab67cd7add0089c3bc668427e6b909eb59e Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Date: Thu, 21 Oct 2021 10:16:19 -0400
Subject: [PATCH] blkparse: 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>
Conflict: no
Reference: https://git.kernel.dk/cgit/blktrace/commit/?id=ac416ab67cd7add0089c3bc668427e6b909eb59e
---
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

View File

@ -0,0 +1,35 @@
From 7f5d2c5173d72018aa29c583c9291ef10abaf8df Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Date: Thu, 21 Oct 2021 10:16:20 -0400
Subject: [PATCH] blkparse: fix incorrectly sized memset in check_cpu_map
The memset call in check_cpu_map always clears sizeof(unsigned long *)
regardless of what size was allocated. Use calloc instead to allocate
the map so it's zeroed properly regardless of the size requested.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Conflict: no
Reference: https://git.kernel.dk/cgit/blktrace/commit/?id=7f5d2c5173d72018aa29c583c9291ef10abaf8df
---
blkparse.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/blkparse.c b/blkparse.c
index 498857c..9d2029a 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -2236,8 +2236,7 @@ static int check_cpu_map(struct per_dev_info *pdi)
/*
* create a map of the cpus we have traces for
*/
- cpu_map = malloc(pdi->cpu_map_max / sizeof(long));
- memset(cpu_map, 0, sizeof(*cpu_map));
+ cpu_map = calloc(1, pdi->cpu_map_max / sizeof(long));
n = rb_first(&rb_sort_root);
while (n) {
__t = rb_entry(n, struct trace, rb_node);
--
2.33.0

View File

@ -0,0 +1,57 @@
From 1836be5d99c9362f1e2b39206c95270f19cb7faa Mon Sep 17 00:00:00 2001
From: Eric Sandeen <sandeen@redhat.com>
Date: Wed, 5 Jun 2024 23:07:27 -0500
Subject: [PATCH] fix hang when BLKTRACESETUP fails and "-o -" is used
# blktrace -o - /dev/sda /dev/sdb /dev/sdc
has to be SIGKILLed if BLKTRACESETUP fails for any or all of the devices
listed. (I simulated this by just catching one of the devices in
setup_buts(), skipping the ioctl, and doing ret++).
This seems to be because with "-o -" on the command line, use_tracer_devpaths()
sees piped_output set, so we call process_trace_bufs which ends up waiting on
(!done) and "done" is never set. i.e.
atexit(exit_tracing)
wait_tracers
if (use_tracer_devpaths()) // true because "-o -"
process_trace_bufs
while (wait_empty_entries())
wait_empty_entries
while (!done ... )
<loop forever>
I think this can be avoided by just setting "done = 1" before returning
when setup_buts() fails in run_tracers().
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/f3204c9d-1384-40b5-a5fb-3bb967ca2bec@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Conflict: no
Reference: https://git.kernel.dk/cgit/blktrace/commit/?id=1836be5d99c9362f1e2b39206c95270f19cb7faa
---
blktrace.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blktrace.c b/blktrace.c
index 3444fbb..038b2cb 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -2684,8 +2684,10 @@ static int run_tracers(void)
if (net_mode == Net_client)
printf("blktrace: connecting to %s\n", hostname);
- if (setup_buts())
+ if (setup_buts()) {
+ done = 1;
return 1;
+ }
if (use_tracer_devpaths()) {
if (setup_tracer_devpaths())
--
2.33.0

View File

@ -1,12 +1,12 @@
Name: blktrace
Version: 1.2.0
Release: 22
Release: 27
Summary: Block IO tracer in the Linux kernel
License: GPLv2+
Source: http://brick.kernel.dk/snaps/blktrace-%{version}.tar.bz2
URL: https://git.kernel.dk/cgit/blktrace
BuildRequires: gcc, git, xz, libaio-devel, python3, librsvg2-devel blktrace sysstat theora-tools
BuildRequires: gcc, xz, libaio-devel, python3, librsvg2-devel blktrace sysstat theora-tools
Provides: iowatcher = %{version}-%{release}
Obsoletes: iowatcher < %{version}-%{release}
Requires: python3
@ -27,6 +27,12 @@ Patch13: 0013-blkparse-Fix-device-in-event-tracking-error-messages.patch
Patch14: 0014-blkparse-Allow-request-tracking-on-non-md-dm-devices.patch
Patch15: 0015-blkparse-Initialize-and-test-for-undefined-request-t.patch
Patch16: blktrace-fix-exit-directly-when-nthreads-running.patch
Patch17: 0017-blktrace-Makefile-add-fstack-protector-strong-flag.patch
Patch18: 0018-fix-parallel-build-failures.patch
Patch19: 0019-fix-parallel-build-of-btt-and-blkiomon.patch
Patch20: 0020-blkparse-skip-check_cpu_map-with-pipe-input.patch
Patch21: 0021-blkparse-fix-incorrectly-sized-memset-in-check_cpu_m.patch
Patch22: 0022-fix-hang-when-BLKTRACESETUP-fails-and-o-is-used.patch
%description
blktrace is a block layer IO tracing mechanism which provides detailed
@ -42,7 +48,7 @@ Requires: man
This contains man files for the using of blktrace.
%prep
%autosetup -Sgit -n %{name}-%{version}
%autosetup -n %{name}-%{version} -p1
%build
%make_build
@ -61,16 +67,34 @@ make dest=%{buildroot} prefix=%{buildroot}/%{_prefix} mandir=%{buildroot}/%{_man
%{_mandir}/man8/*
%changelog
* Tue Sep 24 2024 wangxiao <wangxiao184@h-partners.com> - 1.2.0-27
- DESC: backport upstream patches
blkparse skip check_cpu_map with pipe input
blkparse fix incorrectly sized memset in check_cpu_map
fix hang when BLKTRACESETUP fails and "-o -" is used
* Sat Oct 09 2021 zhanchengbin <zhanchengbin1@huawei.com> - 1.2.0-26
- Fixed the issue of modifying parallel compilation
* Wed Sep 29 2021 Wenchao Hao <haowenchao@huawei.com> - 1.2.0-25
- NOP:nothing but to make it able to sync between differnt branches
* Mon Sep 13 2021 zhanchengbin <zhanchengbin1@huawei.com> - 1.2.0-24
- DESC: Makefile add fstack-protector-srtong flag patch
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.2.0-23
- DESC: delete -Sgit from %autosetup, and delete BuildRequires git
* Fri Jul 23 2021 yanglongkang <yanglongkang@huawei.com> - 1.2.0-22
- delete -j1 compilation options
* Fri Jul 23 2021 zhouwenpei <zhouwenpei1@huawei.com> - 1.2.0-21
- remove useless buildrequires
* Sun Jul 12 2020 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 1.2.0-20
* Mon Jul 12 2021 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 1.2.0-20
- backport upstream patches
* Wed Jul 1 2020 Wu Bo <wubo009@163.com> - 1.2.0-19
* Wed Jul 07 2021 Wu Bo <wubo009@163.com> - 1.2.0-19
- rebuild package
* Mon Jul 05 2021 linxiaoran<linxiaoran@huawei.com> - 1.2.0-18