+ # If the trace has a timestamp (starts with [), check if there are
+ # duplicate timestamps in the output.
+ # If there are, we have to sort the text output to make sure it is
+ # always the same.
+ head -1 "${text_output1}" | @GREP@ "^\[" >/dev/null
+ if test $? = 0; then
+ uniq_ts_cnt="$(@AWK@ '{ print $1 }' < "${text_output1}" | sort | uniq | wc -l)"
+ # Extract only the timestamp columns and compare the number of
+ # unique lines with the total number of lines to see if there
+ # are duplicate timestamps.
+ if test "$cnt" != "$uniq_ts_cnt"; then
+ diag "Trace with non unique timestamps, sorting the output"
+ sort_cmd="sort"
+ tmp="$(mktemp)"
+ sort "${text_output1}" > "$tmp"
+ rm "${text_output1}"
+ text_output1="$tmp"
+ fi
+ fi
+
+ "${BT_BIN}" "${path}" --component sink.ctf.fs --path "${out_path}" >/dev/null 2>&1