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
5853e72e
Commit
5853e72e
authored
Sep 10, 2015
by
Brendan Gregg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shorten disksnoop.c example further
parent
75f47bed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
examples/disksnoop.c
examples/disksnoop.c
+4
-10
No files found.
examples/disksnoop.c
View file @
5853e72e
...
...
@@ -15,27 +15,21 @@
BPF_HASH
(
start
,
struct
request
*
);
int
kprobe__blk_start_request
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
u64
ts
;
void
kprobe__blk_start_request
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
// stash start timestamp by request ptr
ts
=
bpf_ktime_get_ns
();
start
.
update
(
&
req
,
&
ts
);
u64
ts
=
bpf_ktime_get_ns
();
return
0
;
start
.
update
(
&
req
,
&
ts
)
;
}
int
kprobe__blk_update_request
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
void
kprobe__blk_update_request
(
struct
pt_regs
*
ctx
,
struct
request
*
req
)
{
u64
*
tsp
,
delta
;
tsp
=
start
.
lookup
(
&
req
);
if
(
tsp
!=
0
)
{
delta
=
bpf_ktime_get_ns
()
-
*
tsp
;
bpf_trace_printk
(
"%d %x %d
\n
"
,
req
->
__data_len
,
req
->
cmd_flags
,
delta
/
1000
);
start
.
delete
(
&
req
);
}
return
0
;
}
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