Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
91be69ad
Commit
91be69ad
authored
Oct 05, 2018
by
Teng Qin
Committed by
GitHub
Oct 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1997 from myllynen/fix-uflow-typeerror
uflow: convert bytes to str
parents
e55c68ac
1c7e2a8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
tools/lib/uflow.py
tools/lib/uflow.py
+3
-4
No files found.
tools/lib/uflow.py
View file @
91be69ad
...
...
@@ -49,7 +49,6 @@ program = """
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 @@ int NAME(struct pt_regs *ctx) {
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
)
]
...
...
@@ -196,7 +193,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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment