[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXUM-dSBB7DD9dQsRkuoXD6cwXkvHQ5B4ydJqoG44fj9g@mail.gmail.com>
Date: Tue, 17 May 2022 20:37:28 -0700
From: Ian Rogers <irogers@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Riccardo Mancini <rickyman7@...il.com>,
Sohaib Mohamed <sohaib.amhmd@...il.com>,
Carsten Haitzler <carsten.haitzler@....com>,
Marco Elver <elver@...gle.com>,
John Garry <john.garry@...wei.com>,
Michael Petlan <mpetlan@...hat.com>,
linux-perf-users <linux-perf-users@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 2/7] perf test: Use skip in vmlinux kallsyms
On Mon, May 16, 2022 at 8:22 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> Hi Ian,
>
> On Thu, May 12, 2022 at 9:05 PM Ian Rogers <irogers@...gle.com> wrote:
> >
> > Currently failures in reading vmlinux or kallsyms result in a test
> > failure. However, the failure is typically permission related. Prefer to
> > flag these failures as skip.
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> > tools/perf/tests/vmlinux-kallsyms.c | 12 +++++++-----
> > 1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
> > index 93dee542a177..983f32964749 100644
> > --- a/tools/perf/tests/vmlinux-kallsyms.c
> > +++ b/tools/perf/tests/vmlinux-kallsyms.c
> > @@ -114,7 +114,7 @@ static bool is_ignored_symbol(const char *name, char type)
> > static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused,
> > int subtest __maybe_unused)
> > {
> > - int err = -1;
> > + int err = TEST_FAIL;
> > struct rb_node *nd;
> > struct symbol *sym;
> > struct map *kallsyms_map, *vmlinux_map, *map;
> > @@ -142,7 +142,8 @@ static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused
> > * and find the .ko files that match them in /lib/modules/`uname -r`/.
> > */
> > if (machine__create_kernel_maps(&kallsyms) < 0) {
> > - pr_debug("machine__create_kernel_maps ");
> > + pr_info("machine__create_kernel_maps failed");
> > + err = TEST_SKIP;
> > goto out;
> > }
> >
> > @@ -158,7 +159,8 @@ static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused
> > * code and with the one got from /proc/modules from the "kallsyms" code.
> > */
> > if (machine__load_kallsyms(&kallsyms, "/proc/kallsyms") <= 0) {
> > - pr_debug("dso__load_kallsyms ");
> > + pr_debug("machine__load_kallsyms failed");
>
> For consistency, you might want to use pr_info() here.
Point taken, I think pr_debug is more consistent with other tests and
so I changed the above back in v2.
Thanks,
Ian
> Thanks,
> Namhyung
>
>
> > + err = TEST_SKIP;
> > goto out;
> > }
> >
> > @@ -178,7 +180,7 @@ static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused
> > * Now repeat step 2, this time for the vmlinux file we'll auto-locate.
> > */
> > if (machine__create_kernel_maps(&vmlinux) < 0) {
> > - pr_debug("machine__create_kernel_maps ");
> > + pr_info("machine__create_kernel_maps failed");
> > goto out;
> > }
> >
> > @@ -196,7 +198,7 @@ static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused
> > * to fixup the symbols.
> > */
> > if (machine__load_vmlinux_path(&vmlinux) <= 0) {
> > - pr_debug("Couldn't find a vmlinux that matches the kernel running on this machine, skipping test\n");
> > + pr_info("Couldn't find a vmlinux that matches the kernel running on this machine, skipping test\n");
> > err = TEST_SKIP;
> > goto out;
> > }
> > --
> > 2.36.0.550.gb090851708-goog
> >
Powered by blists - more mailing lists