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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
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
Show 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 {
...
@@ -48,13 +48,13 @@ struct xiov_iter {
BEGIN {
BEGIN {
// XXX vvv commented to save space - else BPF for BEGIN might be rejected as too large
// XXX vvv commented to save space - else BPF for BEGIN might be rejected as too large
//@nread =
0;
//@nread =
{}; // {} tid -> nread
//@nwrite =
0;
//@nwrite =
{}; // {} tid -> nwrite
//@rpending[0] = ustack;
//@rpending[0] = ustack;
//@wpending[0] = ustack;
//@wpending[0] = ustack;
//clear(@rpending); // {}
#nr
-> ustack
//clear(@rpending); // {}
(tid,#nr)
-> ustack
//clear(@wpending); // {}
#nw
-> ustack
//clear(@wpending); // {}
(tid,#nw)
-> ustack
// XXX bpftrace does not recognize enum
// XXX bpftrace does not recognize enum
@opcode[ 1] = "LOOKUP";
@opcode[ 1] = "LOOKUP";
...
@@ -125,42 +125,43 @@ END {
...
@@ -125,42 +125,43 @@ END {
// reader enqueues
// reader enqueues
kprobe::fuse_dev_read {
kprobe::fuse_dev_read {
$nr = @nread;
$nr = @nread
[tid]
;
@rpending[$nr] = ustack;
@rpending[
tid,
$nr] = ustack;
// fuse_dev_do_read advances `to` - fetch/remember buffer pointer before.
// fuse_dev_do_read advances `to` - fetch/remember buffer pointer before.
$to = (xiov_iter *)arg1;
$to = (xiov_iter *)arg1;
$buf = $to->iov->iov_base;
$buf = $to->iov->iov_base;
@rbuf[tid] = $buf;
@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
// read ready
kretprobe::fuse_dev_read {
kretprobe::fuse_dev_read {
$rr = @nread;
$rr = @nread
[tid]
;
@nread = $rr + 1;
@nread
[tid]
= $rr + 1;
delete(@rpending[$rr]);
delete(@rpending[
tid,
$rr]);
$h = (fuse_in_header *)@rbuf[tid];
$h = (fuse_in_header *)@rbuf[tid];
delete(@rbuf[tid]);
delete(@rbuf[tid]);
$op = @opcode[$h->opcode];
$op = @opcode[$h->opcode];
// XXX one printf can have only 7 arguments
// 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);
printf("\t.%d %s i%d ...\n\n", $h->unique, $op, $h->nodeid);
}
}
// write request
// write request
kprobe::fuse_dev_write {
kprobe::fuse_dev_write {
$nw = @nwrite;
$nw = @nwrite
[tid]
;
@wpending[$nw] = ustack;
@wpending[
tid,
$nw] = ustack;
$from = (xiov_iter *)arg1;
$from = (xiov_iter *)arg1;
$wbuf = $from->iov->iov_base;
$wbuf = $from->iov->iov_base;
$wh = (fuse_out_header *)$wbuf;
$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;
$u = $wh->unique;
$e = $wh->error;
$e = $wh->error;
...
@@ -172,18 +173,18 @@ kprobe::fuse_dev_write {
...
@@ -172,18 +173,18 @@ kprobe::fuse_dev_write {
// printf("\t?notify(%d) ...\n", $e);
// printf("\t?notify(%d) ...\n", $e);
//}
//}
} else {
} else {
printf("\t.%d (%d)\n", $u, $e);
printf("\t.%d (%d)
...
\n", $u, $e);
}
}
printf("%s\n", ustack);
printf("%s\n", ustack);
}
}
// write ack
// write ack
kretprobe::fuse_dev_write {
kretprobe::fuse_dev_write {
$ww = @nwrite;
$ww = @nwrite
[tid]
;
@nwrite = $ww + 1;
@nwrite
[tid]
= $ww + 1;
delete(@wpending[$ww]);
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