Created
May 27, 2021 11:48
-
-
Save limingzju/d10c0719c777c3e1dab9106dd7ddbf6f to your computer and use it in GitHub Desktop.
getdents trace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
probe begin | |
{ | |
log("begin to probe") | |
} | |
probe syscall.getdents { | |
/* process id 123 */ | |
if (pid() == 123) { | |
file = @cast(task_current(), "task_struct")->files->fdt->fd[$fd] | |
if (!file) | |
next; | |
filename= fullpath_struct_file(task_current(), file) | |
printf ("%-25s %s(%d) %s dirname=%s (%s)\n", ctime(gettimeofday_s()), execname(), pid(), name, filename, argstr); | |
} | |
} | |
probe syscall.openat { | |
/* process id 123 */ | |
if (pid() == 123) { | |
printf ("%-25s %s(%d) %s (%s)\n", ctime(gettimeofday_s()), execname(), pid(), name, argstr); | |
} | |
} | |
probe timer.ms(30000) # after 30 seconds | |
{ | |
exit () | |
} | |
probe end | |
{ | |
log("end to probe") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment