This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Heed help: Calling sys_getcwd to resolve relative pathnames from within systemtap
- From: Sebastian Pipping <sebastian at pipping dot org>
- To: systemtap at sourceware dot org
- Date: Thu, 29 Sep 2011 02:30:51 +0200
- Subject: Heed help: Calling sys_getcwd to resolve relative pathnames from within systemtap
Hello!
Simplified, I have a probe printing filenames as files are opened:
probe syscall.open.return {
filename = user_string($filename)
printf("OPEN %s\n", filename)
}
Now the problem is: filename can be relative.
To make it absolute I would like to call sys_getcwd to get the current
working directory of the process that just opened that file so I can
prepend it to filename to make an absolute path.
However, I fail to call sys_getcwd, even from pure blocks like
%{ /* pure */ /* unprivileged */
[..]
%}
Can you help me with calling sys_getcwd or point me to other ways of
making a pathname absolute from within systemtap? I doubt I'm the first
to wonder about this but I find no documentation on this.
Thanks in advance,
Sebastian Pipping