Blame SOURCES/uflow-str-bytes.patch

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