This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Detecting Symlinks
- From: fchirigati <nano dot seabra at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Thu, 13 Sep 2012 13:24:30 -0700 (PDT)
- Subject: Detecting Symlinks
Hi,
I have a program that gets all the files that were read by a running
process, using SystemTap. In order to get this information, I'm using the
probe 'kernel.function("do_filp_open")', since 'syscall.open' may not give
the absolute path.
When one of these files is a symlink, I need to get both symlink and target
file. With kernel.function("do_filp_open"), I get the target file; with
syscall.open, I get the symlink. The problem is that I need the absolute
path of the symlink, and as I said before, syscall.open may not give me the
absolute path.
Does anyone know a better way to detect symbolic links using SystemTap (that
would give me the absolute path)?
By the way, I tried to use syscall.readlink, but nothing happened. I think
this system call is not used by the OS to get the target file, as target
paths are stored in inodes.
I'm on Ubuntu 12.04.
Best,
Fernando.
--
View this message in context: http://old.nabble.com/Detecting-Symlinks-tp34429155p34429155.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.