Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
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
Joshua
wendelin.core
Commits
e28531da
Commit
e28531da
authored
Feb 08, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8986b732
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
wcfs/fusetrace
wcfs/fusetrace
+20
-19
No files found.
wcfs/fusetrace
View file @
e28531da
...
...
@@ -48,13 +48,13 @@ struct xiov_iter {
BEGIN {
// XXX vvv commented to save space - else BPF for BEGIN might be rejected as too large
//@nread =
0;
//@nwrite =
0;
//@nread =
{}; // {} tid -> nread
//@nwrite =
{}; // {} tid -> nwrite
//@rpending[0] = ustack;
//@wpending[0] = ustack;
//clear(@rpending); // {}
#nr
-> ustack
//clear(@wpending); // {}
#nw
-> ustack
//clear(@rpending); // {}
(tid,#nr)
-> ustack
//clear(@wpending); // {}
(tid,#nw)
-> ustack
// XXX bpftrace does not recognize enum
@opcode[ 1] = "LOOKUP";
...
...
@@ -125,42 +125,43 @@ END {
// reader enqueues
kprobe::fuse_dev_read {
$nr = @nread;
@rpending[$nr] = ustack;
$nr = @nread
[tid]
;
@rpending[
tid,
$nr] = ustack;
// fuse_dev_do_read advances `to` - fetch/remember buffer pointer before.
$to = (xiov_iter *)arg1;
$buf = $to->iov->iov_base;
@rbuf[tid] = $buf;
printf("
/dev/fuse -> qread %s/%d #%d_r:%s\n"
, comm, tid, $nr, ustack)
printf("
P%d /dev/fuse <- qread %s/%d_%d_r:%s\n", cpu
, comm, tid, $nr, ustack)
}
// read ready
kretprobe::fuse_dev_read {
$rr = @nread;
@nread = $rr + 1;
delete(@rpending[$rr]);
$rr = @nread
[tid]
;
@nread
[tid]
= $rr + 1;
delete(@rpending[
tid,
$rr]);
$h = (fuse_in_header *)@rbuf[tid];
delete(@rbuf[tid]);
$op = @opcode[$h->opcode];
// XXX one printf can have only 7 arguments
printf("/dev/fuse -> read %s/%d #%d_r: (ret=%d)\n", comm, tid, $rr, retval);
// wcfs/2412#2r
printf("P%d /dev/fuse -> read %s/%d_%d_r: (ret=%d)\n", cpu, comm, tid, $rr, retval);
printf("\t.%d %s i%d ...\n\n", $h->unique, $op, $h->nodeid);
}
// write request
kprobe::fuse_dev_write {
$nw = @nwrite;
@wpending[$nw] = ustack;
$nw = @nwrite
[tid]
;
@wpending[
tid,
$nw] = ustack;
$from = (xiov_iter *)arg1;
$wbuf = $from->iov->iov_base;
$wh = (fuse_out_header *)$wbuf;
printf("
/dev/fuse <- write: %s/%d #%d_w:\n"
, comm, tid, $nw);
printf("
P%d /dev/fuse <- write %s/%d_%d_w:\n", cpu
, comm, tid, $nw);
$u = $wh->unique;
$e = $wh->error;
...
...
@@ -172,18 +173,18 @@ kprobe::fuse_dev_write {
// printf("\t?notify(%d) ...\n", $e);
//}
} else {
printf("\t.%d (%d)\n", $u, $e);
printf("\t.%d (%d)
...
\n", $u, $e);
}
printf("%s\n", ustack);
}
// write ack
kretprobe::fuse_dev_write {
$ww = @nwrite;
@nwrite = $ww + 1;
delete(@wpending[$ww]);
$ww = @nwrite
[tid]
;
@nwrite
[tid]
= $ww + 1;
delete(@wpending[
tid,
$ww]);
printf("
/dev/fuse <- write_ack: %s/%d #%d_w (ret=%d)\n\n"
, comm, tid, $ww, retval);
printf("
P%d /dev/fuse -> write_ack %s/%d_%d_w (ret=%d)\n\n", cpu
, comm, tid, $ww, retval);
}
...
...
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