Skip to content

Instantly share code, notes, and snippets.

@limingzju
Created May 27, 2021 11:48
Show Gist options
  • Save limingzju/d10c0719c777c3e1dab9106dd7ddbf6f to your computer and use it in GitHub Desktop.
Save limingzju/d10c0719c777c3e1dab9106dd7ddbf6f to your computer and use it in GitHub Desktop.
getdents trace
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