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
6ed4a496
Commit
6ed4a496
authored
Sep 16, 2015
by
Brendan Gregg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accomodate mq block device I/O
parent
5be5194f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
examples/bitehist.c
examples/bitehist.c
+1
-1
examples/disksnoop.c
examples/disksnoop.c
+2
-2
examples/disksnoop.py
examples/disksnoop.py
+3
-0
No files found.
examples/bitehist.c
View file @
6ed4a496
...
...
@@ -38,7 +38,7 @@ static unsigned int log2l(unsigned long v)
return
log2
(
v
)
+
1
;
}
int
kprobe__blk_
start_request
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
int
kprobe__blk_
account_io_completion
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
int
index
=
log2l
(
req
->
__data_len
/
1024
);
u64
*
leaf
=
dist
.
lookup
(
&
index
);
...
...
examples/disksnoop.c
View file @
6ed4a496
...
...
@@ -15,14 +15,14 @@
BPF_HASH
(
start
,
struct
request
*
);
void
kprobe__blk_start_reques
t
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
void
trace_star
t
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
// stash start timestamp by request ptr
u64
ts
=
bpf_ktime_get_ns
();
start
.
update
(
&
req
,
&
ts
);
}
void
kprobe__blk_update_request
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
void
trace_completion
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
u64
*
tsp
,
delta
;
tsp
=
start
.
lookup
(
&
req
);
...
...
examples/disksnoop.py
View file @
6ed4a496
...
...
@@ -17,6 +17,9 @@ REQ_WRITE = 1 # from include/linux/blk_types.h
# load BPF program
b
=
BPF
(
src_file
=
"disksnoop.c"
)
b
.
attach_kprobe
(
event
=
"blk_start_request"
,
fn_name
=
"trace_start"
)
b
.
attach_kprobe
(
event
=
"blk_mq_start_request"
,
fn_name
=
"trace_start"
)
b
.
attach_kprobe
(
event
=
"blk_account_io_completion"
,
fn_name
=
"trace_completion"
)
# header
print
(
"%-18s %-2s %-7s %8s"
%
(
"TIME(s)"
,
"T"
,
"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