5 # Copyright (c) 2016-2019 The strace developers.
8 # SPDX-License-Identifier: GPL-2.0-or-later
10 . "${srcdir=.}/init.sh"
12 run_prog ../readv > /dev/null
16 local sortby sortopts sedexpr
21 run_strace -c -w ${sortby:+-S} $sortby ../readv > /dev/null
22 sed -r -n -e "$sedexpr" < "$LOG" > "$OUT"
25 fail_ "$STRACE $args output mismatch"
26 LC_ALL=C sort -c $sortopts "$OUT" || {
29 fail_ "$STRACE $args output not sorted properly"
33 c='[[:space:]]+([^[:space:]]+)'
34 for s in '' time time_total total_time; do
36 's/^[[:space:]]+([0-9]+)[.,]([0-9]+)[[:space:]].*/\1\t\2/p'
38 for s in calls count; do
40 '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p'
42 for s in name syscall syscall_name; do
44 '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p'
46 for s in error errors; do
48 '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+([0-9]+))?'"$c"'$/\6/p'