]> granicus.if.org Git - strace/commitdiff
Add "%" prefix for syscall classes in qualify
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 4 Mar 2017 03:22:06 +0000 (04:22 +0100)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 4 Mar 2017 23:32:18 +0000 (00:32 +0100)
(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) <syscall_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.

NEWS
qualify.c
strace.1
tests/net.test
tests/netlink_protocol.test
tests/qual_fault-exit_group.test
tests/qual_syscall.test
tests/scm_rights-fd.test
tests/sigreturn.test
tests/uio.test

diff --git a/NEWS b/NEWS
index 3ea553f9ce42eef978e65da90fa13a28452b7fbf..53392e88fd677f3502412c5a389bc6bb9cb8e2ac 100644 (file)
--- 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.
 
index bb4aefe3806fe706a6fa05267c9eb111798e8e22..5dc6a73b3c1a8334f55fc094a6fe79a6bd03fbf6 100644 (file)
--- 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;
index 9230766e3e3767e63b0effb9e9b07ea217537536..d817c60ba9b3814ea1ae5a7a023d69d281db017c 100644 (file)
--- 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
index cf943ffaafc84961aa72566c2f3410d31214ffca..d8e6a73905a6ce9e9b9a0adea75cb8d8dbee3b2b 100755 (executable)
@@ -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
index ab2bb1e8b3e87bbb644c1bc53031993a911be2a5..fe2b25376514c4983dea7fbf801bf314208db48f 100755 (executable)
@@ -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
index c98ffc6e02d7961301fbb5bbae70ccafa9803664..e589b754d8137e63451ab5669c08c6fee94428ed 100755 (executable)
@@ -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
index f7eb06d5a8be2d8c62ff06fbc2d676cbe4b670f1..23a9b627238d8dab08efd217300f9a28075f9eb5 100755 (executable)
@@ -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"
 
index 8447375fde3a0712d1cdc975059083b2e0f1d836..ba34f6b0191987912ddaa4c80e4be025b7488e1c 100755 (executable)
@@ -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]*'
index f9a612bffd9afd05ba0f3151f1a4a0bc9cf9dae5..dc9df1811d5c057da56fe3b7b836172a21d23879 100755 (executable)
@@ -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'
index 020b97e95424ef3cc2e9c958699e1489a46537ff..01846852e18b6b88b18c13b411ab5833df372dfd 100755 (executable)
@@ -5,7 +5,7 @@
 . "${srcdir=.}/init.sh"
 
 run_prog
-run_strace -edesc $args
+run_strace -e%desc $args
 match_grep
 
 exit 0