[PATCH v5] Print absolute paths in printpathn when -yy is used

Dmitry V. Levin ldv at altlinux.org
Sat Aug 9 09:53:42 UTC 2014


Hi Zubin,

On Sat, Aug 09, 2014 at 09:46:42AM +0530, Zubin Mithra wrote:
> On Sat, Aug 9, 2014 at 5:05 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> > On Tue, Jul 01, 2014 at 03:13:21PM +0530, zubin.mithra at gmail.com wrote:
> > > * defs.h (show_fd_path): Change type to unsigned int.
> > > * strace.c (show_fd_path): Update usage to count y flag.
> > > (usage): Update to add -yy option.
> > > * util.c (print_tracee_cwd): New function.
> > > (printpathn): Update to use print_tracee_cwd and print
> > >  absolute path.
> > > * strace.1: Add description of -yy option.
> >
> > I had an opportunity to think about this feature a bit longer,
> > and now I see two issues I missed before.
> >
> > The first issue is the choice of option name.  While -y option enables
> > *additional* decoding of descriptors, and -yy was planned for extended
> > decoding of descriptors like socket decoding, this feature *changes*
> > decoding of all paths.  I'd rather not mix these things.
> 
> Sounds good, just to make sure I understand clearly --
> 
> 1. -y should do absolute decoding of file descriptors always.

No, -y should not change, conversion of all relative paths to absolute
should be controlled by another option.

> 2. -yy should do extended decoding like socket decoding etc.

Yes.

> > The second issue is *at syscalls.  This implementation assumes that all
> > non-absolute paths are relative to cwd, but that is not necessarily the
> > case for *at syscalls.
> 
> I see -- could we try and display canonical paths for fds passed into *at
> syscalls?

When descriptors decoding is enabled, descriptors passed to *at syscalls
are decoded anyway, so we could use this information to decode relative
paths passed to *at syscalls.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140809/cb7e7d87/attachment.bin>


More information about the Strace-devel mailing list