2 # perf pipe recording and injection test
3 # SPDX-License-Identifier: GPL-2.0
5 shelldir=$(dirname "$0")
6 # shellcheck source=lib/perf_has_symbol.sh
7 . "${shelldir}"/lib/perf_has_symbol.sh
11 skip_test_missing_symbol ${sym}
13 data=$(mktemp /tmp/perf.data.XXXXXX)
14 prog="perf test -w noploop"
17 if ! perf record -e task-clock:u -o - ${prog} | perf report -i - --task | grep ${task}; then
18 echo "cannot find the test file in the perf report"
22 if ! perf record -e task-clock:u -o - ${prog} | perf inject -b | perf report -i - | grep ${sym}; then
23 echo "cannot find noploop function in pipe #1"
27 perf record -e task-clock:u -o - ${prog} | perf inject -b -o ${data}
28 if ! perf report -i ${data} | grep ${sym}; then
29 echo "cannot find noploop function in pipe #2"
33 perf record -e task-clock:u -o ${data} ${prog}
34 if ! perf inject -b -i ${data} | perf report -i - | grep ${sym}; then
35 echo "cannot find noploop function in pipe #3"
40 rm -f ${data} ${data}.old