How to get write/read offset?
Olausson, Bjoern
contactme@olausson.de
Thu Mar 10 12:32:00 GMT 2016
Hello Systemtap users,
is there some straight forward way to get the offset for any read,
write, pwrite etc. syscall?
So for example if I trace the the IO to a file and the program issues
a "seek" and writes reads n bytes starting from this position, is
there any way to get that start position (offset) except from probing
for an "seek" before a write/read?
For example:
probe syscall.write.return {
if (pid() == target()) {
time_stamp = timestamp()
p = pid()
fd = $fd
bytes = $return
latency = gettimeofday_us() - @entry(gettimeofday_us())
printf("%d;%d;%s;%s;%d;%d;%d\n", p, fd, filehandles[p, fd], name,
bytes, time_stamp, latency)
}
}
If there is no straight forward way to get this information, what is
the most native way to get the offset alongside with the time, latency
and bytes_written/read?
Thanks a lot for your suggestions.
Greetings,
Bjoern
More information about the Systemtap
mailing list