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.
Asked
Active
Viewed 94 times
2
-
You probably have to dive into ftrace. – jippie Mar 20 '19 at 20:00
1 Answers
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