diff --git a/bcc-0.7.0-uflow-str-bytes.patch b/bcc-0.7.0-uflow-str-bytes.patch new file mode 100644 index 0000000..e28b98e --- /dev/null +++ b/bcc-0.7.0-uflow-str-bytes.patch @@ -0,0 +1,65 @@ +From 215fc84bac0037ac5b2047940f97ecc97f0860b9 Mon Sep 17 00:00:00 2001 +From: Marko Myllynen +Date: Fri, 5 Oct 2018 16:47:29 +0300 +Subject: [PATCH 1/2] uflow: convert bytes to str + +Python 3 fix, similar to commit 99d1468 and commit 4e4c9e0 for ucalls. + +Closes #1996. +--- + tools/lib/uflow.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tools/lib/uflow.py b/tools/lib/uflow.py +index fb306e31d..fdbcfc332 100755 +--- a/tools/lib/uflow.py ++++ b/tools/lib/uflow.py +@@ -196,7 +196,9 @@ def print_event(cpu, data, size): + direction = "<- " if event.depth & (1 << 63) else "-> " + print("%-3d %-6d %-6d %-8.3f %-40s" % (cpu, event.pid >> 32, + event.pid & 0xFFFFFFFF, time.time() - start_ts, +- (" " * (depth - 1)) + direction + event.clazz + "." + event.method)) ++ (" " * (depth - 1)) + direction + \ ++ event.clazz.decode('utf-8', 'replace') + "." + \ ++ event.method.decode('utf-8', 'replace'))) + + bpf["calls"].open_perf_buffer(print_event) + while 1: + +From 1c7e2a8f3fb02d4516fccc410272324fff250be9 Mon Sep 17 00:00:00 2001 +From: Marko Myllynen +Date: Fri, 5 Oct 2018 17:16:13 +0300 +Subject: [PATCH 2/2] uflow: drop unused timestamp field + +--- + tools/lib/uflow.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/tools/lib/uflow.py b/tools/lib/uflow.py +index fdbcfc332..f2a458d7b 100755 +--- a/tools/lib/uflow.py ++++ b/tools/lib/uflow.py +@@ -49,7 +49,6 @@ + struct call_t { + u64 depth; // first bit is direction (0 entry, 1 return) + u64 pid; // (tgid << 32) + pid from bpf_get_current... +- u64 timestamp; // ns + char clazz[80]; + char method[80]; + }; +@@ -89,7 +88,6 @@ + FILTER_METHOD + + data.pid = bpf_get_current_pid_tgid(); +- data.timestamp = bpf_ktime_get_ns(); + depth = entry.lookup_or_init(&data.pid, &zero); + data.depth = DEPTH; + UPDATE +@@ -183,7 +181,6 @@ class CallEvent(ct.Structure): + _fields_ = [ + ("depth", ct.c_ulonglong), + ("pid", ct.c_ulonglong), +- ("timestamp", ct.c_ulonglong), + ("clazz", ct.c_char * 80), + ("method", ct.c_char * 80) + ] diff --git a/bcc.spec b/bcc.spec index 4ab8928..883622d 100644 --- a/bcc.spec +++ b/bcc.spec @@ -9,12 +9,15 @@ Name: bcc Version: 0.7.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +# https://bugzilla.redhat.com/show_bug.cgi?id=1636293 +Patch0: %{name}-%{version}-uflow-str-bytes.patch + # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches ExclusiveArch: x86_64 %{power64} @@ -165,6 +168,9 @@ mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/ %changelog +* Sat Oct 06 2018 Rafael dos Santos - 0.7.0-2 +- Fix str/bytes conversion in uflow (#1636293) + * Tue Sep 25 2018 Rafael Fonseca - 0.7.0-1 - Rebase to new released version