Commit 79758cc1 authored by Jürgen Hötzel's avatar Jürgen Hötzel Committed by yonghong-song

Decode C strings into Python strings (#1844)

Leftover from #986.
parent ee9f0e0a
...@@ -265,12 +265,12 @@ def print_event(cpu, data, size): ...@@ -265,12 +265,12 @@ def print_event(cpu, data, size):
if (csv): if (csv):
print("%d,%s,%d,%s,%d,%d,%d,%s" % ( print("%d,%s,%d,%s,%d,%d,%d,%s" % (
event.ts_us, event.task, event.pid, type, event.size, event.ts_us, event.task.decode(), event.pid, type, event.size,
event.offset, event.delta_us, event.file)) event.offset, event.delta_us, event.file.decode()))
return return
print("%-8s %-14.14s %-6s %1s %-7s %-8d %7.2f %s" % (strftime("%H:%M:%S"), print("%-8s %-14.14s %-6s %1s %-7s %-8d %7.2f %s" % (strftime("%H:%M:%S"),
event.task, event.pid, type, event.size, event.offset / 1024, event.task.decode(), event.pid, type, event.size, event.offset / 1024,
float(event.delta_us) / 1000, event.file)) float(event.delta_us) / 1000, event.file.decode()))
# initialize BPF # initialize BPF
b = BPF(text=bpf_text) b = BPF(text=bpf_text)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment