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
af3302d1
Commit
af3302d1
authored
Aug 03, 2016
by
Brendan Gregg
Committed by
4ast
Aug 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style nits (#646)
parent
56c24a6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
tools/biosnoop.py
tools/biosnoop.py
+7
-6
No files found.
tools/biosnoop.py
View file @
af3302d1
...
...
@@ -72,7 +72,7 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req)
u64 *tsp, delta;
u32 *pidp = 0;
struct val_t *valp;
struct data_t data ={};
struct data_t data =
{};
u64 ts;
// fetch timestamp and calculate delta
...
...
@@ -81,14 +81,14 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req)
// missed tracing issue
return 0;
}
ts =
bpf_ktime_get_ns();
ts = bpf_ktime_get_ns();
data.delta = ts - *tsp;
data.ts = ts / 1000;
valp = infobyreq.lookup(&req);
if (valp == 0) {
data.len = req->__data_len;
strcpy(data.name,"?");
strcpy(data.name,
"?");
} else {
data.pid = valp->pid;
data.len = req->__data_len;
...
...
@@ -99,11 +99,11 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req)
}
if (req->cmd_flags & REQ_WRITE) {
data.rwflag
=
1;
data.rwflag
=
1;
} else {
data.rwflag
=
0;
data.rwflag
=
0;
}
events.perf_submit(ctx,
&data,
sizeof(data));
events.perf_submit(ctx,
&data,
sizeof(data));
start.delete(&req);
infobyreq.delete(&req);
...
...
@@ -130,6 +130,7 @@ class Data(ct.Structure):
(
"disk_name"
,
ct
.
c_char
*
DISK_NAME_LEN
),
(
"name"
,
ct
.
c_char
*
TASK_COMM_LEN
)
]
# header
print
(
"%-14s %-14s %-6s %-7s %-2s %-9s %-7s %7s"
%
(
"TIME(s)"
,
"COMM"
,
"PID"
,
"DISK"
,
"T"
,
"SECTOR"
,
"BYTES"
,
"LAT(ms)"
))
...
...
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