xref: /OK3568_Linux_fs/kernel/tools/perf/tests/shell/lib/probe.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun# Arnaldo Carvalho de Melo <acme@kernel.org>, 2017
3*4882a593Smuzhiyun
4*4882a593Smuzhiyunskip_if_no_perf_probe() {
5*4882a593Smuzhiyun	perf probe 2>&1 | grep -q 'is not a perf-command' && return 2
6*4882a593Smuzhiyun	return 0
7*4882a593Smuzhiyun}
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunskip_if_no_perf_trace() {
10*4882a593Smuzhiyun	perf trace -h 2>&1 | grep -q -e 'is not a perf-command' -e 'trace command not available' && return 2
11*4882a593Smuzhiyun	return 0
12*4882a593Smuzhiyun}
13