This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to get write/read offset?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]