Blame bcc-0.7.0-uflow-str-bytes.patch

c6c1ff2
From 215fc84bac0037ac5b2047940f97ecc97f0860b9 Mon Sep 17 00:00:00 2001
c6c1ff2
From: Marko Myllynen <myllynen@redhat.com>
c6c1ff2
Date: Fri, 5 Oct 2018 16:47:29 +0300
c6c1ff2
Subject: [PATCH 1/2] uflow: convert bytes to str
c6c1ff2
c6c1ff2
Python 3 fix, similar to commit 99d1468 and commit 4e4c9e0 for ucalls.
c6c1ff2
c6c1ff2
Closes #1996.
c6c1ff2
---
c6c1ff2
 tools/lib/uflow.py | 4 +++-
c6c1ff2
 1 file changed, 3 insertions(+), 1 deletion(-)
c6c1ff2
c6c1ff2
diff --git a/tools/lib/uflow.py b/tools/lib/uflow.py
c6c1ff2
index fb306e31d..fdbcfc332 100755
c6c1ff2
--- a/tools/lib/uflow.py
c6c1ff2
+++ b/tools/lib/uflow.py
c6c1ff2
@@ -196,7 +196,9 @@ def print_event(cpu, data, size):
c6c1ff2
     direction = "<- " if event.depth & (1 << 63) else "-> "
c6c1ff2
     print("%-3d %-6d %-6d %-8.3f %-40s" % (cpu, event.pid >> 32,
c6c1ff2
         event.pid & 0xFFFFFFFF, time.time() - start_ts,
c6c1ff2
-        ("  " * (depth - 1)) + direction + event.clazz + "." + event.method))
c6c1ff2
+        ("  " * (depth - 1)) + direction + \
c6c1ff2
+            event.clazz.decode('utf-8', 'replace') + "." + \
c6c1ff2
+            event.method.decode('utf-8', 'replace')))
c6c1ff2
 
c6c1ff2
 bpf["calls"].open_perf_buffer(print_event)
c6c1ff2
 while 1:
c6c1ff2
c6c1ff2
From 1c7e2a8f3fb02d4516fccc410272324fff250be9 Mon Sep 17 00:00:00 2001
c6c1ff2
From: Marko Myllynen <myllynen@redhat.com>
c6c1ff2
Date: Fri, 5 Oct 2018 17:16:13 +0300
c6c1ff2
Subject: [PATCH 2/2] uflow: drop unused timestamp field
c6c1ff2
c6c1ff2
---
c6c1ff2
 tools/lib/uflow.py | 3 ---
c6c1ff2
 1 file changed, 3 deletions(-)
c6c1ff2
c6c1ff2
diff --git a/tools/lib/uflow.py b/tools/lib/uflow.py
c6c1ff2
index fdbcfc332..f2a458d7b 100755
c6c1ff2
--- a/tools/lib/uflow.py
c6c1ff2
+++ b/tools/lib/uflow.py
c6c1ff2
@@ -49,7 +49,6 @@
c6c1ff2
 struct call_t {
c6c1ff2
     u64 depth;                  // first bit is direction (0 entry, 1 return)
c6c1ff2
     u64 pid;                    // (tgid << 32) + pid from bpf_get_current...
c6c1ff2
-    u64 timestamp;              // ns
c6c1ff2
     char clazz[80];
c6c1ff2
     char method[80];
c6c1ff2
 };
c6c1ff2
@@ -89,7 +88,6 @@
c6c1ff2
     FILTER_METHOD
c6c1ff2
 
c6c1ff2
     data.pid = bpf_get_current_pid_tgid();
c6c1ff2
-    data.timestamp = bpf_ktime_get_ns();
c6c1ff2
     depth = entry.lookup_or_init(&data.pid, &zero);
c6c1ff2
     data.depth = DEPTH;
c6c1ff2
     UPDATE
c6c1ff2
@@ -183,7 +181,6 @@ class CallEvent(ct.Structure):
c6c1ff2
     _fields_ = [
c6c1ff2
         ("depth", ct.c_ulonglong),
c6c1ff2
         ("pid", ct.c_ulonglong),
c6c1ff2
-        ("timestamp", ct.c_ulonglong),
c6c1ff2
         ("clazz", ct.c_char * 80),
c6c1ff2
         ("method", ct.c_char * 80)
c6c1ff2
         ]