From 009933a2f15f8f3204165cbf33c64654108836de Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 14 2020 01:07:43 +0000 Subject: import bcc-0.14.0-2.el8 --- diff --git a/SOURCES/bcc-0.14.0-deadlock-print-a-more-explicit-message-when-pthread_.patch b/SOURCES/bcc-0.14.0-deadlock-print-a-more-explicit-message-when-pthread_.patch new file mode 100644 index 0000000..b068ff6 --- /dev/null +++ b/SOURCES/bcc-0.14.0-deadlock-print-a-more-explicit-message-when-pthread_.patch @@ -0,0 +1,28 @@ +From c263daf925a7a74f7ae64b049cf3def8b298beee Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Wed, 10 Jun 2020 10:28:42 +0200 +Subject: [PATCH 1/4] deadlock: print a more explicit message when + pthread_mutex_unlock can't be attached + +Most likely, this happen because of a missing --binary argument. Let's +be friendly to our user and print a more useful messsage. +--- + tools/deadlock.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/deadlock.py b/tools/deadlock.py +index 17848720..81122adb 100755 +--- a/tools/deadlock.py ++++ b/tools/deadlock.py +@@ -483,7 +483,7 @@ import time + pid=args.pid, + ) + except Exception as e: +- print('%s. Failed to attach to symbol: %s' % (str(e), symbol)) ++ print('%s. Failed to attach to symbol: %s\nIs --binary argument missing?' % (str(e), symbol)) + sys.exit(1) + for symbol in args.lock_symbols: + try: +-- +2.25.4 + diff --git a/SOURCES/bcc-0.14.0-loader-suggest-to-install-the-right-kernel-devel-pac.patch b/SOURCES/bcc-0.14.0-loader-suggest-to-install-the-right-kernel-devel-pac.patch new file mode 100644 index 0000000..6dc155c --- /dev/null +++ b/SOURCES/bcc-0.14.0-loader-suggest-to-install-the-right-kernel-devel-pac.patch @@ -0,0 +1,33 @@ +From f7e7347dc1b4873f70a26392c997228999d346a8 Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Wed, 10 Jun 2020 11:41:59 +0200 +Subject: [PATCH 3/4] loader: suggest to install the right kernel devel package + +Unfortunately, some package dependency system do not allow to make +sure that the kernel development package installed is the same version +as the running kernel. When this happen, the loader, unable to find +the kernel header, will suggest to rebuild the kernel with +CONFIG_IKHEADERS. For most users, this is probably not an option, but +installing the kernel development package corresponding to the running +kernel version is. +--- + src/cc/frontends/clang/loader.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/cc/frontends/clang/loader.cc b/src/cc/frontends/clang/loader.cc +index 9d768d30..79558dd3 100644 +--- a/src/cc/frontends/clang/loader.cc ++++ b/src/cc/frontends/clang/loader.cc +@@ -151,7 +151,8 @@ int ClangLoader::parse(unique_ptr *mod, TableStorage &ts, + kpath = tmpdir; + } else { + std::cout << "Unable to find kernel headers. "; +- std::cout << "Try rebuilding kernel with CONFIG_IKHEADERS=m (module)\n"; ++ std::cout << "Try rebuilding kernel with CONFIG_IKHEADERS=m (module) "; ++ std::cout << "or installing the kernel development package for your running kernel version.\n"; + } + } + +-- +2.25.4 + diff --git a/SOURCES/bcc-0.14.0-man-remove-non-existent-x-argument-from-tcpconnect-m.patch b/SOURCES/bcc-0.14.0-man-remove-non-existent-x-argument-from-tcpconnect-m.patch new file mode 100644 index 0000000..fcc49c5 --- /dev/null +++ b/SOURCES/bcc-0.14.0-man-remove-non-existent-x-argument-from-tcpconnect-m.patch @@ -0,0 +1,28 @@ +From 1762f5c28832842ea2c67ab68feaf7fddb94a543 Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Wed, 10 Jun 2020 11:30:35 +0200 +Subject: [PATCH 2/4] man: remove non-existent -x argument from tcpconnect man + page + +There's no -x option in tcpconnect. I don't know how it get into the +man page sysnopsis, but it doesn't belong there. +--- + man/man8/tcpconnect.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/man8/tcpconnect.8 b/man/man8/tcpconnect.8 +index 60aac1e2..8180f0fe 100644 +--- a/man/man8/tcpconnect.8 ++++ b/man/man8/tcpconnect.8 +@@ -2,7 +2,7 @@ + .SH NAME + tcpconnect \- Trace TCP active connections (connect()). Uses Linux eBPF/bcc. + .SH SYNOPSIS +-.B tcpconnect [\-h] [\-c] [\-t] [\-x] [\-p PID] [-P PORT] [\-\-cgroupmap MAPPATH] ++.B tcpconnect [\-h] [\-c] [\-t] [\-p PID] [-P PORT] [\-\-cgroupmap MAPPATH] + .SH DESCRIPTION + This tool traces active TCP connections (eg, via a connect() syscall; + accept() are passive connections). This can be useful for general +-- +2.25.4 + diff --git a/SOURCES/bcc-0.14.0-tools-fix-a-python-3-map-issue-in-dbstat-and-dbslowe.patch b/SOURCES/bcc-0.14.0-tools-fix-a-python-3-map-issue-in-dbstat-and-dbslowe.patch new file mode 100644 index 0000000..603368a --- /dev/null +++ b/SOURCES/bcc-0.14.0-tools-fix-a-python-3-map-issue-in-dbstat-and-dbslowe.patch @@ -0,0 +1,49 @@ +From fc72365ad7a3fb66902b3e2d0b0fb712eb8735d3 Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Wed, 10 Jun 2020 18:29:11 +0200 +Subject: [PATCH 4/4] tools: fix a python 3 map issue in dbstat and dbslower + +In python 3, map returns an iterator and not a list anymore. This +patch cast the map into a list. It fixes the following error: + +$ /usr/share/bcc/tools/dbstat mysql +Traceback (most recent call last): + File "/usr/share/bcc/tools/dbstat", line 95, in + bpf = BPF(text=program, usdt_contexts=usdts) + File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 339, in __init__ + ctx_array = (ct.c_void_p * len(usdt_contexts))() +TypeError: object of type 'map' has no len() +--- + tools/dbslower.py | 2 +- + tools/dbstat.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/dbslower.py b/tools/dbslower.py +index 2f1b6a8b..e2ee7ad0 100755 +--- a/tools/dbslower.py ++++ b/tools/dbslower.py +@@ -188,7 +188,7 @@ int query_end(struct pt_regs *ctx) { + args.pids = map(int, subprocess.check_output( + "pidof postgres".split()).split()) + +- usdts = map(lambda pid: USDT(pid=pid), args.pids) ++ usdts = list(map(lambda pid: USDT(pid=pid), args.pids)) + for usdt in usdts: + usdt.enable_probe("query__start", "query_start") + usdt.enable_probe("query__done", "query_end") +diff --git a/tools/dbstat.py b/tools/dbstat.py +index a89b0971..a7d301b1 100755 +--- a/tools/dbstat.py ++++ b/tools/dbstat.py +@@ -83,7 +83,7 @@ program = program.replace("SCALE", str(1000 if args.microseconds else 1000000)) + program = program.replace("FILTER", "" if args.threshold == 0 else + "if (delta / 1000000 < %d) { return 0; }" % args.threshold) + +-usdts = map(lambda pid: USDT(pid=pid), args.pids) ++usdts = list(map(lambda pid: USDT(pid=pid), args.pids)) + for usdt in usdts: + usdt.enable_probe("query__start", "probe_start") + usdt.enable_probe("query__done", "probe_end") +-- +2.25.4 + diff --git a/SPECS/bcc.spec b/SPECS/bcc.spec index b652cb7..95f2731 100644 --- a/SPECS/bcc.spec +++ b/SPECS/bcc.spec @@ -5,7 +5,7 @@ Name: bcc Version: 0.14.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc @@ -13,6 +13,10 @@ URL: https://github.com/iovisor/bcc Source0: %{url}/releases/download/v%{version}/%{name}-src-with-submodule.tar.gz #Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-Manpages-remove-unstable-statement.patch +Patch1: %{name}-%{version}-deadlock-print-a-more-explicit-message-when-pthread_.patch +Patch2: %{name}-%{version}-man-remove-non-existent-x-argument-from-tcpconnect-m.patch +Patch3: %{name}-%{version}-loader-suggest-to-install-the-right-kernel-devel-pac.patch +Patch4: %{name}-%{version}-tools-fix-a-python-3-map-issue-in-dbstat-and-dbslowe.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -186,7 +190,13 @@ done # criticalstat relies on CONFIG_PREEMPTIRQ_EVENTS which is disabled on RHEL 8 %exclude %{_datadir}/%{name}/tools/criticalstat %exclude %{_datadir}/%{name}/tools/doc/criticalstat_example.txt -%exclude %{_mandir}/man8/criticalstat.8 +%exclude %{_mandir}/man8/bcc-criticalstat.8.gz +# compactsnoop is only supported on x86_64 +%ifnarch x86_64 +%exclude %{_datadir}/%{name}/tools/compactsnoop +%exclude %{_datadir}/%{name}/tools/doc/compactsnoop_example.txt +%exclude %{_mandir}/man8/bcc-compactsnoop.8.gz +%endif %{_mandir}/man8/* %if %{with lua} @@ -196,6 +206,14 @@ done %changelog +* Thu Jun 11 2020 Jerome Marchand - 0.14.0-2 +- Remove criticalstat manpage +- Remove compactsnoop on non x86_64 +- Suggest to use --binary in deadlock +- Remove non-existent argument from tcpconnect man page +- Suggest to install the proper kernel-devel version +- Fix dbstat and dbslower + * Wed Apr 22 2020 Jerome Marchand - 0.14.0-1 - Rebase on bcc-0.14.0