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
b4f78437
Commit
b4f78437
authored
Jan 10, 2017
by
Brendan Gregg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gethostlatency: remove unused code
parent
5fe89aa4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
20 deletions
+0
-20
tools/gethostlatency.py
tools/gethostlatency.py
+0
-20
No files found.
tools/gethostlatency.py
View file @
b4f78437
...
...
@@ -34,7 +34,6 @@ struct val_t {
struct data_t {
u32 pid;
u64 ts;
u64 delta;
char comm[TASK_COMM_LEN];
char host[80];
...
...
@@ -77,7 +76,6 @@ int do_return(struct pt_regs *ctx) {
bpf_probe_read(&data.host, sizeof(data.host), (void *)valp->host);
data.pid = valp->pid;
data.delta = tsp - valp->ts;
data.ts = tsp / 1000;
events.perf_submit(ctx, &data, sizeof(data));
start.delete(&pid);
return 0;
...
...
@@ -96,37 +94,19 @@ TASK_COMM_LEN = 16 # linux/sched.h
class
Data
(
ct
.
Structure
):
_fields_
=
[
(
"pid"
,
ct
.
c_ulonglong
),
(
"ts"
,
ct
.
c_ulonglong
),
(
"delta"
,
ct
.
c_ulonglong
),
(
"comm"
,
ct
.
c_char
*
TASK_COMM_LEN
),
(
"host"
,
ct
.
c_char
*
80
)
]
start_ts
=
0
prev_ts
=
0
delta
=
0
# header
print
(
"%-9s %-6s %-16s %10s %s"
%
(
"TIME"
,
"PID"
,
"COMM"
,
"LATms"
,
"HOST"
))
def
print_event
(
cpu
,
data
,
size
):
event
=
ct
.
cast
(
data
,
ct
.
POINTER
(
Data
)).
contents
global
start_ts
global
prev_ts
global
delta
if
start_ts
==
0
:
prev_ts
=
start_ts
if
start_ts
==
1
:
delta
=
float
(
delta
)
+
(
event
.
ts
-
prev_ts
)
print
(
"%-9s %-6d %-16s %10.2f %s"
%
(
strftime
(
"%H:%M:%S"
),
event
.
pid
,
event
.
comm
,
(
event
.
delta
/
1000000
),
event
.
host
))
prev_ts
=
event
.
ts
start_ts
=
1
# loop with callback to print_event
b
[
"events"
].
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