Linux Audio

Check our new training course

Loading...
v6.9.4
 1#!/bin/sh
 2# perf pipe recording and injection test
 3# SPDX-License-Identifier: GPL-2.0
 4
 5shelldir=$(dirname "$0")
 6# shellcheck source=lib/perf_has_symbol.sh
 7. "${shelldir}"/lib/perf_has_symbol.sh
 8
 9sym="noploop"
10
11skip_test_missing_symbol ${sym}
12
13data=$(mktemp /tmp/perf.data.XXXXXX)
14prog="perf test -w noploop"
15task="perf"
 
16
17if ! 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"
19	exit 1
20fi
21
22if ! 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"
24	exit 1
25fi
26
27perf record -e task-clock:u -o - ${prog} | perf inject -b -o ${data}
28if ! perf report -i ${data} | grep ${sym}; then
29	echo "cannot find noploop function in pipe #2"
30	exit 1
31fi
32
33perf record -e task-clock:u -o ${data} ${prog}
34if ! perf inject -b -i ${data} | perf report -i - | grep ${sym}; then
35	echo "cannot find noploop function in pipe #3"
36	exit 1
37fi
38
39
40rm -f ${data} ${data}.old
41exit 0
v6.2
 1#!/bin/sh
 2# perf pipe recording and injection test
 3# SPDX-License-Identifier: GPL-2.0
 4
 
 
 
 
 
 
 
 
 5data=$(mktemp /tmp/perf.data.XXXXXX)
 6prog="perf test -w noploop"
 7task="perf"
 8sym="noploop"
 9
10if ! perf record -e task-clock:u -o - ${prog} | perf report -i - --task | grep ${task}; then
11	echo "cannot find the test file in the perf report"
12	exit 1
13fi
14
15if ! perf record -e task-clock:u -o - ${prog} | perf inject -b | perf report -i - | grep ${sym}; then
16	echo "cannot find noploop function in pipe #1"
17	exit 1
18fi
19
20perf record -e task-clock:u -o - ${prog} | perf inject -b -o ${data}
21if ! perf report -i ${data} | grep ${sym}; then
22	echo "cannot find noploop function in pipe #2"
23	exit 1
24fi
25
26perf record -e task-clock:u -o ${data} ${prog}
27if ! perf inject -b -i ${data} | perf report -i - | grep ${sym}; then
28	echo "cannot find noploop function in pipe #3"
29	exit 1
30fi
31
32
33rm -f ${data} ${data}.old
34exit 0