xref: /linux/tools/perf/tests/shell/lib/probe.sh (revision 03c11eb3b16dc0058589751dfd91f254be2be613)
1*05ef238cSKajol Jain#!/bin/bash
25875cf4cSArnaldo Carvalho de Melo# SPDX-License-Identifier: GPL-2.0
31ad5a182SArnaldo Carvalho de Melo# Arnaldo Carvalho de Melo <acme@kernel.org>, 2017
41ad5a182SArnaldo Carvalho de Melo
51ad5a182SArnaldo Carvalho de Meloskip_if_no_perf_probe() {
635435cd0SKim Phillips	perf probe 2>&1 | grep -q 'is not a perf-command' && return 2
71ad5a182SArnaldo Carvalho de Melo	return 0
81ad5a182SArnaldo Carvalho de Melo}
983244772STommi Rantala
1083244772STommi Rantalaskip_if_no_perf_trace() {
1183244772STommi Rantala	perf trace -h 2>&1 | grep -q -e 'is not a perf-command' -e 'trace command not available' && return 2
1283244772STommi Rantala	return 0
1383244772STommi Rantala}
14