On May 08 2020, Nikolaus Rath <Nikolaus@xxxxxxxx> wrote: >> >> sudo bpftrace -e 'kretprobe:fuse_file_read_iter { printf ("fuse >> read: %d\n", retval); }' > > > - I believe that (struct kiocb*)arg0)->ki_pos will give me the offset > within the file, but where can I see how much data is being read? Looking at the code in fuse_file_read_iter, it seems the length is in ((struct iov_iter*)arg1)->count, but I do not really understand why. The definiton of this parameter is: struct iov_iter { int type; const struct iovec *iov; unsigned long nr_segs; size_t iov_offset; size_t count; }; ..so I would think that *count* is the number of `iovec` elements hiding behind the `iov` pointer, not some total number of bytes. Furthermore, there is a function iov_length() that is documented to return the "total number of bytes covered by an iovec" and doesn't look at `count` at all. Can someone elucidate why the number of bytes to be read from the file is in iov_iter.count? Best, -Nikolaus -- GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.«