Commit e28531da authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8986b732
...@@ -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);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment