newbie q - lightweight dirname of file path?
Daire Byrne
daire@dneg.com
Wed Jul 10 14:41:21 GMT 2024
Hi,
Apologies for such a newbie question, but I have been searching for a
solution to this all day and it's starting to drive me crazy.
I have a really simple probe to tell me filenames:
probe syscall.open, syscall.openat, syscall.stat {
printf("%s\n", filename_unquoted)
}
But actually what I want, is the full directory path that each file is
in. So a lightweight way to do it would be similar to the "dirname"
bash command and just chop off only the last entry seperated by the
"/".
I think there may also be a way to do it by looking up the inode data?
I was really hoping for a fast lightweight way to do it (like text
processing the filename string).
Ultimately, I want to trace millions of file lookups but only store
and print out their directory locations rather than do that in
userspace (if possible).
Cheers,
Daire
More information about the Systemtap
mailing list