as some might be easier to remember than others.
* count.c (set_sortby): Add aliases for the existing sorting options.
* strace.1.in (.SH OPTIONS) <-S>: Document new aliases.
* tests/strace-S.test: Check new sort keys.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
const char *name;
} sort_fns[] = {
{ time_cmp, "time" },
+ { time_cmp, "time_total" },
+ { time_cmp, "total_time" },
{ count_cmp, "calls" },
+ { count_cmp, "count" },
{ syscall_cmp, "name" },
+ { syscall_cmp, "syscall" },
+ { syscall_cmp, "syscall_name" },
+ { NULL, "none" },
{ NULL, "nothing" },
};
Sort the output of the histogram printed by the
.B \-c
option by the specified criterion. Legal values are
-.BR time ,
-.BR calls ,
-.BR name ,
+.BR time " (or " time_total " or " total_time ),
+.BR calls " (or " count ),
+.BR name " (or " syscall " or " syscall_name ),
and
-.B nothing
-(default is
-.BR time ).
+.BR nothing " (or " none );
+default is
+.BR time .
.TP
.B \-w
Summarise the time difference between the beginning and end of
}
c='[[:space:]]+([^[:space:]]+)'
-for s in '' time; do
+for s in '' time time_total total_time; do
test_c "$s" '-n -r' \
's/^[[:space:]]+([0-9]+)[.,]([0-9]+)[[:space:]].*/\1\t\2/p'
done
-for s in calls; do
+for s in calls count; do
test_c "$s" '-n -r' \
'/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p'
done
-for s in name; do
+for s in name syscall syscall_name; do
test_c "$s" '' \
'/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p'
done