summaryrefslogtreecommitdiff
path: root/src/pidns.c
diff options
context:
space:
mode:
authorMasatake YAMATO <yamato@redhat.com>2021-09-09 22:43:32 +0900
committerDmitry V. Levin <ldv@strace.io>2021-11-14 08:00:00 +0000
commitbd5a5ee359395b2f1d2ce0efb6c084b29b47b8f2 (patch)
treeb442b36377a077ebea2f1b708d8a2fe5a328665b /src/pidns.c
parent4af3e77a296b549e55cdea1ea679be9f4e66c465 (diff)
downloadstrace-bd5a5ee359395b2f1d2ce0efb6c084b29b47b8f2.tar.gz
Introduce --decode-pids=pidns as an alias for --pidns-translation
In preparation for the forthcoming -Y/--decode-pids=comm option. * doc/strace.1.in (.SS Output format): Document --decode-pids=pidns option. * src/defs.h (pidns_translation): Remove. (pid_decoding): New variable declaration. (enum pid_decoding_flags): New enum. (qualify_decode_pid): New function prototype. * src/strace.c (pidns_translation): Remove. (pid_decoding): New variable. (usage): Describe --decode-pids=pidns option. (init) <enum>: Add GETOPT_QUAL_DECODE_PID. <longopts>: Add --decode-pids as a long option. <case GETOPT_PIDNS_TRANSLATION>: Call qualify_decode_pid to update pid_decoding indirectly. <case GETOPT_QUAL_DECODE_PID>: New condition. * src/filter_qualify.c (qualify_decode_pid): New function. * src/pidns.c (printpid_translation): Refer to pid_decoding as the replacement for pidns_translation. * tests/init.sh (test_pidns_run_strace): Replace --pidns-translation with --decode-pids=pidns. * tests/options-syntax.test: Check invalid --decode-pids argument. * NEWS: Mention this change. Making --decode-pids option a super set of --pidns-translation option is Suggested-by: by Eugene Syromyatnikov <evgsyr@gmail.com>. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Co-authored-by: Dmitry V. Levin <ldv@strace.io>
Diffstat (limited to 'src/pidns.c')
-rw-r--r--src/pidns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pidns.c b/src/pidns.c
index 9c7b7ce1a..eda87aad9 100644
--- a/src/pidns.c
+++ b/src/pidns.c
@@ -527,7 +527,7 @@ get_proc_pid(int pid)
static void
printpid_translation(struct tcb *tcp, int pid, enum pid_type type)
{
- if (!pidns_translation)
+ if (!(pid_decoding & PID_DECODING_NS_TRANSLATION))
return;
int strace_pid = translate_pid(tcp, pid, type, NULL);