2

Using Systemtap probing tool I got the way to get total amount of bytes read by a file by probing syscall.read and syscall.read.return function. syscall.read.return has returnval() which gives the total amount of byte read. I need to get the virtual addresses of the bytes for every read and write operation. How can I achieve this using Systemtap probing tool in linux.

Ashikee AbHi
  • 123
  • 3

1 Answers1

1

The following SystemTap script would allow you to get the read bytes as an string:

probe syscall.read.return
{
  printf("writen_bytes_as_a_string=%s\n", user_string_n(@entry($buf),$return))
}
Jaime Hablutzel
  • 136
  • 1
  • 7