Hello Ian,

On Wed, Jul 12, 2023 at 06:16:28PM -0700, Ian Rogers wrote:
> On Tue, Jun 13, 2023 at 10:04 AM Athira Rajeev
> <atraj...@linux.vnet.ibm.com> wrote:
> >
> > From: Aditya Gupta <adit...@linux.ibm.com>
> >
> > Test "perf script task-analyzer tests" fails in environment with missing
> > libtraceevent support, as perf record fails to create the perf.data
> > file, which further tests depend on.
> >
> > Instead, when perf is not compiled with libtraceevent support, skip those
> > tests instead of failing them, by checking the output of `perf
> > record --dry-run` to see if it prints the error "libtraceevent is
> > necessary for tracepoint support"
> >
> > ...
> >
> > +# check if perf is compiled with libtraceevent support
> > +skip_no_probe_record_support() {
> > +       perf record -e "sched:sched_switch" -a -- sleep 1 2>&1 | grep 
> > "libtraceevent is necessary for tracepoint support" && return 2
> 
> Fwiw, another way to detect build options used in other shell tests is:
> perf version --build-options | grep HAVE_LIBTRACEEVENT | grep -q OFF && 
> return 2
> 
> Thanks,
> Ian
> 

Thanks for the review. That seems more straightforward way to check for
libtraceevent support. I will work on a patch for this, and test it.

Thanks,
Aditya G

Reply via email to