From: Eugene Syromyatnikov Date: Sat, 4 Mar 2017 03:22:06 +0000 (+0100) Subject: Add "%" prefix for syscall classes in qualify X-Git-Tag: v4.17~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6477079361bfa951605db2a81549b03c7c33577f;p=strace Add "%" prefix for syscall classes in qualify (as suggested in https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html ) In order to move them to a different namespace than syscall names. This is already a problem in case of ipc class which shadows ipc syscall. Old behaviour is retained in order to preserve backwards compatibility. * qualify.c (lookup_class) : Add %-prefixed class definitions. * strace.1 (.SS Filtering): Add information regarding %-prefixed class syntax, declare legacy class syntax deprecated. * tests/net.test: Update to use %-prefixed syscall class name. * tests/netlink_protocol.test: Likewise. * tests/qual_fault-exit_group.test: Likewise. * tests/qual_syscall.test: Likewise. * tests/scm_rights-fd.test: Likewise. * tests/sigreturn.test: Likewise. * tests/uio.test: Likewise. * NEWS: Mention this change. --- diff --git a/NEWS b/NEWS index 3ea553f9..53392e88 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ Noteworthy changes in release ?.?? (????-??-??) =============================================== +* Changes in command line syntax + * Syscall classes specified in -e trace= option now have % prefix (like + -e trace=%process). Old style class names without leading % are still + supported, but considered deprecated now. + * Improvements * Enhanced decoding of sched_setattr syscall. diff --git a/qualify.c b/qualify.c index bb4aefe3..5dc6a73b 100644 --- a/qualify.c +++ b/qualify.c @@ -212,6 +212,13 @@ lookup_class(const char *s) { "signal", TRACE_SIGNAL }, { "ipc", TRACE_IPC }, { "network", TRACE_NETWORK }, + { "%desc", TRACE_DESC }, + { "%file", TRACE_FILE }, + { "%memory", TRACE_MEMORY }, + { "%process", TRACE_PROCESS }, + { "%signal", TRACE_SIGNAL }, + { "%ipc", TRACE_IPC }, + { "%network", TRACE_NETWORK }, }; unsigned int i; diff --git a/strace.1 b/strace.1 index 9230766e..d817c60b 100644 --- a/strace.1 +++ b/strace.1 @@ -382,8 +382,10 @@ trace those four system calls. Be careful when making inferences about the user/kernel boundary if only a subset of system calls are being monitored. The default is .BR trace = all . +.PP +.BR "\-e\ trace" = %file .TP -.BR "\-e\ trace" = file +.BR "\-e\ trace" = file " (deprecated)" Trace all system calls which take a file name as an argument. You can think of this as an abbreviation for .BR "\-e\ trace" = open , stat , chmod , unlink ,... @@ -392,24 +394,36 @@ Furthermore, using the abbreviation will ensure that you don't accidentally forget to include a call like .B lstat in the list. Betchya woulda forgot that one. +.PP +.BR "\-e\ trace" = %process .TP -.BR "\-e\ trace" = process +.BR "\-e\ trace" = process " (deprecated)" Trace all system calls which involve process management. This is useful for watching the fork, wait, and exec steps of a process. +.PP +.BR "\-e\ trace" = %network .TP -.BR "\-e\ trace" = network +.BR "\-e\ trace" = network " (deprecated)" Trace all the network related system calls. +.PP +.BR "\-e\ trace" = %signal .TP -.BR "\-e\ trace" = signal +.BR "\-e\ trace" = signal " (deprecated)" Trace all signal related system calls. +.PP +.BR "\-e\ trace" = %ipc .TP -.BR "\-e\ trace" = ipc +.BR "\-e\ trace" = ipc " (deprecated)" Trace all IPC related system calls. +.PP +.BR "\-e\ trace" = %desc .TP -.BR "\-e\ trace" = desc +.BR "\-e\ trace" = desc " (deprecated)" Trace all file descriptor related system calls. +.PP +.BR "\-e\ trace" = %memory .TP -.BR "\-e\ trace" = memory +.BR "\-e\ trace" = memory " (deprecated)" Trace all memory mapping related system calls. .TP \fB\-e\ abbrev\fR=\,\fIset\fR diff --git a/tests/net.test b/tests/net.test index cf943ffa..d8e6a739 100755 --- a/tests/net.test +++ b/tests/net.test @@ -5,7 +5,7 @@ . "${srcdir=.}/init.sh" run_prog ./net-accept-connect net-local-stream -run_strace_merge -enetwork $args +run_strace_merge -e%network $args match_grep exit 0 diff --git a/tests/netlink_protocol.test b/tests/netlink_protocol.test index ab2bb1e8..fe2b2537 100755 --- a/tests/netlink_protocol.test +++ b/tests/netlink_protocol.test @@ -8,4 +8,4 @@ [ -d /proc/self/fd/ ] || framework_skip_ '/proc/self/fd/ is not available' -run_strace_match_diff -e trace=network +run_strace_match_diff -e trace=%network diff --git a/tests/qual_fault-exit_group.test b/tests/qual_fault-exit_group.test index c98ffc6e..e589b754 100755 --- a/tests/qual_fault-exit_group.test +++ b/tests/qual_fault-exit_group.test @@ -50,4 +50,4 @@ test_with -eexit,exit_group -efault=all:error=ENOSYS \ -efault=exit:error=1:when=2+ ./answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer + -efault=\!%desc,%file,%memory,%process,%signal,%network,%ipc:error=1 ./answer diff --git a/tests/qual_syscall.test b/tests/qual_syscall.test index f7eb06d5..23a9b627 100755 --- a/tests/qual_syscall.test +++ b/tests/qual_syscall.test @@ -28,7 +28,7 @@ LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +check_output_mismatch "$pattern_abbrev_verbose" -e trace=%process LC_ALL=C grep '^chdir' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test index 8447375f..ba34f6b0 100755 --- a/tests/scm_rights-fd.test +++ b/tests/scm_rights-fd.test @@ -49,7 +49,7 @@ touch -- "$file" || framework_skip_ 'failed to create a file' run_prog ./scm_rights /dev/zero -run_strace -y -x -enetwork $args "$file" +run_strace -y -x -e%network $args "$file" hex='[[:xdigit:]]' n='[1-9][0-9]*' diff --git a/tests/sigreturn.test b/tests/sigreturn.test index f9a612bf..dc9df181 100755 --- a/tests/sigreturn.test +++ b/tests/sigreturn.test @@ -30,7 +30,7 @@ . "${srcdir=.}/init.sh" run_prog -run_strace -esignal $args +run_strace -e%signal $args mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' diff --git a/tests/uio.test b/tests/uio.test index 020b97e9..01846852 100755 --- a/tests/uio.test +++ b/tests/uio.test @@ -5,7 +5,7 @@ . "${srcdir=.}/init.sh" run_prog -run_strace -edesc $args +run_strace -e%desc $args match_grep exit 0