public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Heed help: Calling sys_getcwd to resolve relative pathnames from within systemtap
@ 2011-09-29  0:31 Sebastian Pipping
  2011-09-30  0:54 ` Josh Stone
       [not found] ` <CAHiC6b17y2c1BdMPdzbg3zpJXUTA5T98opE78Sa4EL9j1-+hhw@mail.gmail.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastian Pipping @ 2011-09-29  0:31 UTC (permalink / raw)
  To: 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-10-05 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-29  0:31 Heed help: Calling sys_getcwd to resolve relative pathnames from within systemtap Sebastian Pipping
2011-09-30  0:54 ` Josh Stone
2011-10-03 15:50   ` Sebastian Pipping
2011-10-03 16:13   ` Sebastian Pipping
2011-10-04 23:50     ` Josh Stone
2011-10-05 16:40       ` Sebastian Pipping
     [not found] ` <CAHiC6b17y2c1BdMPdzbg3zpJXUTA5T98opE78Sa4EL9j1-+hhw@mail.gmail.com>
2011-10-03 15:53   ` Sebastian Pipping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).