From: Namhyung Kim <namhyung@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Riccardo Mancini <rickyman7@gmail.com>,
Sohaib Mohamed <sohaib.amhmd@gmail.com>,
Carsten Haitzler <carsten.haitzler@arm.com>,
Marco Elver <elver@google.com>,
John Garry <john.garry@huawei.com>,
Michael Petlan <mpetlan@redhat.com>,
linux-perf-users <linux-perf-users@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 4/7] perf test: Basic mmap use skip
Date: Mon, 16 May 2022 20:42:49 -0700 [thread overview]
Message-ID: <CAM9d7ciD=uH7rNSmK5oJEksPYsagwpQA1J-MC3N0RpzLaakscg@mail.gmail.com> (raw)
In-Reply-To: <20220513040519.1499333-5-irogers@google.com>
On Thu, May 12, 2022 at 9:05 PM Ian Rogers <irogers@google.com> wrote:
>
> If opening the first event fails for basic mmap it is more likely
> permission related that a true error. Mark the test as skip in this
> case and add a skip reason.
>
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/tests/mmap-basic.c | 22 ++++++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
> index c3c17600f29c..32f0a63fa157 100644
> --- a/tools/perf/tests/mmap-basic.c
> +++ b/tools/perf/tests/mmap-basic.c
> @@ -31,7 +31,7 @@
> */
> static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
> {
> - int err = -1;
> + int err = TEST_FAIL;
> union perf_event *event;
> struct perf_thread_map *threads;
> struct perf_cpu_map *cpus;
> @@ -83,6 +83,14 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
> evsels[i] = evsel__newtp("syscalls", name);
> if (IS_ERR(evsels[i])) {
> pr_debug("evsel__new(%s)\n", name);
> + if (i == 0) {
> + /*
> + * Failure to open first event is more likely
> + * related to permissions so flag the failure as
> + * a skip.
> + */
> + err = TEST_SKIP;
This is not about perf_event_open() but it accesses
tracefs to get the type number of the trace event.
The evsel__newtp() seems to return the errno in a
negative number. It'd be better to check if it's
-EACCES actually.
Thanks,
Namhyung
> + }
> goto out_delete_evlist;
> }
>
> @@ -166,4 +174,14 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
> return err;
> }
>
> -DEFINE_SUITE("Read samples using the mmap interface", basic_mmap);
> +static struct test_case tests__basic_mmap[] = {
> + TEST_CASE_REASON("Read samples using the mmap interface",
> + basic_mmap,
> + "permissions"),
> + { .name = NULL, }
> +};
> +
> +struct test_suite suite__basic_mmap = {
> + .desc = "Read samples using the mmap interface",
> + .test_cases = tests__basic_mmap,
> +};
> --
> 2.36.0.550.gb090851708-goog
>
next prev parent reply other threads:[~2022-05-17 3:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 4:05 [PATCH 0/7] Make more tests skip rather than fail Ian Rogers
2022-05-13 4:05 ` [PATCH 1/7] perf test: Skip reason for suites with 1 test Ian Rogers
2022-05-13 15:29 ` John Garry
2022-05-13 15:42 ` Ian Rogers
2022-05-13 16:26 ` John Garry
2022-05-13 16:34 ` Ian Rogers
2022-05-13 16:46 ` John Garry
2022-05-17 3:53 ` Namhyung Kim
2022-05-13 4:05 ` [PATCH 2/7] perf test: Use skip in vmlinux kallsyms Ian Rogers
2022-05-13 17:01 ` John Garry
2022-05-13 17:05 ` Ian Rogers
2022-05-17 3:21 ` Namhyung Kim
2022-05-18 3:37 ` Ian Rogers
2022-05-13 4:05 ` [PATCH 3/7] perf test: Use skip in openat syscall Ian Rogers
2022-05-13 4:05 ` [PATCH 4/7] perf test: Basic mmap use skip Ian Rogers
2022-05-17 3:42 ` Namhyung Kim [this message]
2022-05-18 3:48 ` Ian Rogers
2022-05-13 4:05 ` [PATCH 5/7] perf test: Parse events tidy terms_test Ian Rogers
2022-05-13 4:05 ` [PATCH 6/7] perf test: Parse events tidy evlist_test Ian Rogers
2022-05-13 4:05 ` [PATCH 7/7] perf test: Parse events break apart tests Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM9d7ciD=uH7rNSmK5oJEksPYsagwpQA1J-MC3N0RpzLaakscg@mail.gmail.com' \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=carsten.haitzler@arm.com \
--cc=elver@google.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=mpetlan@redhat.com \
--cc=peterz@infradead.org \
--cc=rickyman7@gmail.com \
--cc=sohaib.amhmd@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).