[PATCH v2 4/5] Extend -Y option to decode PIDS in arguments and retvals

Eugene Syromyatnikov evgsyr at gmail.com
Thu Aug 26 18:09:03 UTC 2021

On Tue, Aug 24, 2021 at 9:27 PM Masatake YAMATO <yamato at redhat.com> wrote:
> From: <yamato at redhat.com>
> From: Masatake YAMATO <yamato at redhat.com>
> This change introduces -YY,--decode-pids=all option.  In addition to
> what printed -Y option, the new options print command names for PIDS
> appeared in arguments and retvals.
> An example:
>   getppid()                  = 3781395<strace>
>   getpid()                   = 3781398<a.out>
>   pidfd_open(1<systemd>, 0)  = 3<pid:1<systemd>>

I feel like this behaviour should be triggered by the mere -Y option.
I also think that --pidns-translation has to go under --decode-pids
options.  What about the following user interface?

-Y ~ --decode-pids=comm
--pidns-translation ~ --decode-pids=pidns
(optionally) -YY ~ --decode-pids=all

There's a provision about trivial PID NS decoding in translate_pid();
not sure, however, if we want to dance around with an option to have
comm decoding only for PIDs in the same PID NS
("--decode-pids=translate-pids"?). When I start thinking about it, the
division "leader only" —- "everything else" makes more sense from
implementation perspective, but still somewhat muddy from the user's

Eugene Syromyatnikov
mailto:evgsyr at gmail.com
xmpp:esyr at jabber.{ru|org}

More information about the Strace-devel mailing list