summaryrefslogtreecommitdiff
path: root/src/defs.h
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/defs.h
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/defs.h')
-rw-r--r--src/defs.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/defs.h b/src/defs.h
index 45e2b4a71..2c00f4e1f 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -508,7 +508,10 @@ extern int Tflag_scale;
extern int Tflag_width;
extern bool iflag;
extern bool count_wallclock;
-extern unsigned int pidns_translation;
+extern unsigned int pid_decoding;
+enum pid_decoding_flags {
+ PID_DECODING_NS_TRANSLATION = 1 << 0,
+};
/* are we filtering traces based on paths? */
extern struct path_set {
const char **paths_selected;
@@ -1328,6 +1331,7 @@ extern void qualify_signals(const char *);
extern void qualify_status(const char *);
extern void qualify_quiet(const char *);
extern void qualify_decode_fd(const char *);
+extern void qualify_decode_pid(const char *);
extern void qualify_read(const char *);
extern void qualify_write(const char *);
extern void qualify_fault(const char *);