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) <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.
This commit is contained in:
Eugene Syromyatnikov 2017-03-04 04:22:06 +01:00
parent 73a21f1a3f
commit 6477079361
10 changed files with 40 additions and 14 deletions

5
NEWS
View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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]*'

View File

@ -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'

View File

@ -5,7 +5,7 @@
. "${srcdir=.}/init.sh"
run_prog
run_strace -edesc $args
run_strace -e%desc $args
match_grep
exit 0