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.

  • You probably have to dive into ftrace. – jippie Mar 20 '19 at 20:00

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))
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.