Thread (40 messages) 40 messages, 7 authors, 2023-07-13

Re: [PATCH 17/17] perf tests task_analyzer: skip tests if no libtraceevent support

From: Aditya Gupta <hidden>
Date: 2023-07-13 08:37:08
Also in: linux-perf-users

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
[off-list ref] wrote:
quoted
From: Aditya Gupta <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help