3 # Check how strace -e abbrev=set, -e raw=set, -e trace=set,
4 # and -e verbose=set work.
6 . "${srcdir=.}/init.sh"
9 pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0'
10 pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0'
11 pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0'
12 pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0'
14 check_output_mismatch()
18 run_strace "$@" ./umovestr
19 LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || {
21 'Failed patterns of expected output:' "$pattern"
22 dump_log_and_fail_with "$STRACE $args output mismatch"
26 check_output_mismatch "$pattern_abbrev_verbose" -e execve
27 LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" |
28 LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null &&
29 dump_log_and_fail_with "$STRACE $args unexpected output"
31 check_output_mismatch "$pattern_abbrev_verbose" -e trace=process
32 LC_ALL=C grep '^chdir' "$LOG" > /dev/null &&
33 dump_log_and_fail_with "$STRACE $args unexpected output"
35 run_strace -e 42 ./umovestr
36 LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null &&
37 dump_log_and_fail_with "$STRACE $args unexpected output"
39 for a in execve \!chdir all \!none \
40 file process \!desc \!ipc \!memory \!network \!signal; do
41 check_output_mismatch \
42 "$pattern_abbrev_verbose" -e abbrev="$a" -e execve
43 check_output_mismatch \
44 "$pattern_raw" -a22 -e raw="$a" -e execve
45 check_output_mismatch \
46 "$pattern_abbrev_verbose" -e verbose="$a" -e execve
49 for a in \!execve chdir 42 \!all none \
50 \!file \!process desc ipc memory network signal; do
51 check_output_mismatch \
52 "$pattern_nonabbrev_verbose" -e abbrev="$a" -e execve
53 check_output_mismatch \
54 "$pattern_abbrev_verbose" -e raw="$a" -e execve
55 check_output_mismatch \
56 "$pattern_nonverbose" -a31 -e verbose="$a" -e execve