This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
How to get write/read offset?
- From: "Olausson, Bjoern" <contactme at olausson dot de>
- To: systemtap at sourceware dot org
- Date: Thu, 10 Mar 2016 13:32:51 +0100
- Subject: How to get write/read offset?
- Authentication-results: sourceware.org; auth=none
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