xref: /linux/tools/perf/tests/shell/trace_record_replay.sh (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1#!/bin/sh
2# perf trace record and replay
3# SPDX-License-Identifier: GPL-2.0
4
5# Check that perf trace works with record and replay
6
7# shellcheck source=lib/probe.sh
8. "$(dirname $0)"/lib/probe.sh
9
10skip_if_no_perf_trace || exit 2
11[ "$(id -u)" = 0 ] || exit 2
12
13file=$(mktemp /tmp/temporary_file.XXXXX)
14
15perf trace record -o ${file} sleep 1 || exit 1
16if ! perf trace -i ${file} 2>&1 | grep nanosleep; then
17	echo "Failed: cannot find *nanosleep syscall"
18	exit 1
19fi
20
21rm -f ${file}
22