linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>,
	"linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: Re: perf test case 6 dumps core on s390 without PMU
Date: Tue, 1 Aug 2023 00:32:51 -0300	[thread overview]
Message-ID: <ZMh84/oSgmzsiNz0@kernel.org> (raw)
In-Reply-To: <128916c0-23f1-9e34-3488-906d6df6116f@linux.ibm.com>

Em Mon, Jul 31, 2023 at 11:42:31AM +0200, Thomas Richter escreveu:
> On 7/28/23 17:32, Ian Rogers wrote:
> > On Fri, Jul 28, 2023 at 7:30 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
> >>
> >> Using Linux 6.5.0rc3 perf test case 6 dumps core on an s390 without
> >> configured PMU (this can happen depending on customer machine configuration).
> >>
> >> In this configuration several perf test cases fail:
> >>  # ./perf test 2>&1 | grep FAIL
> >>   6.1: Test event parsing                                : FAILED!
> >>  10.3: Parsing of PMU event table metrics                : FAILED!
> >>  10.4: Parsing of PMU event table metrics with fake PMUs : FAILED!
> >>  28: Use a dummy software event to keep tracking         : FAILED!
> >>  35: Track with sched_switch                             : FAILED!
> >>  66: Parse and process metrics                           : FAILED!
> >>  #
> >>
> >> Even worse the test case 6 dumps core:
> >>
> >>  # ./perf test -F 6
> >>   6: Parse event definition strings                      :
> >>   6.1: Test event parsing                                :
> >>  Segmentation fault (core dumped)
> >>  #
> > 
> > Thanks for reporting this!
> > 
> >> The root cause for these failures and core dump is a missing
> >> PMU, as can be seen by the debug output:
> >>    ...
> >>    Event test failure: test 57 'instructions:uep'
> >>    running test 58 '{cycles,cache-misses,branch-misses}:e'
> >>    No PMU found for 'cycles' <-- Here no PMU is found, because there is none!
> >>    FAILED tests/parse-events.c:1516 wrong number of entries
> >>    Event test failure: test 58 '{cycles,cache-misses,branch-misses}:e'
> >> Here no PMU is found, because there is none!
> >>
> >>    ....
> >>    running test 59 'cycles/name=name/'
> >>    No PMU found for 'name'
> >>    Segmentation fault (core dumped)
> >>
> >> Here the root cause in in function test__term_equal_term() variable
> >> evsel->name is NULL:
> >>
> >>  # gdb ./perf
> >> ....
> >> Breakpoint 1, test__term_equal_term (evlist=0x1542c00) at\
> >>                        tests/parse-events.c:1688
> >> (gdb) p evsel->name
> >> $3 = 0x3fff7fe3dc0 ""
> >> (gdb) n
> >>  691 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE);
> >> (gdb) n
> >> 1692 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
> >> (gdb) n
> >> 1693 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "name") == 0);
> >> (gdb) n
> >>
> >> Program received signal SIGSEGV, Segmentation fault.
> >>
> >> I could fix this by checking for NULL pointer, but I have the
> >> feeling that there is more to it. However I do not fully understand
> >> the latest rework on the event handling.
> >>
> >> The other test cases listed above fail due to the same root cause,
> >> no PMU found.
> >>
> >> Please advise. What should all these test return when a system does
> >> not have any PMU defined at all?
> > 
> > So I was writing a response then figured out I've already fixed this
> > but it looks like the patch hasn't been taken yet:
> > https://lore.kernel.org/lkml/20230706183705.601412-1-irogers@google.com/
> > 
> > Arnaldo, could you take a look?
> > 
> > Thanks,
> > Ian
> > 
> 
> Ian, 
> 
> thanks a lot. I applied both patches you mentioned above and the
> test cases work fine.
> You have my 
> Tested-by: Thomas Richter <tmricht@linux.ibm.com>

Thanks, applied.

- Arnaldo


      reply	other threads:[~2023-08-01  3:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 14:30 perf test case 6 dumps core on s390 without PMU Thomas Richter
2023-07-28 15:32 ` Ian Rogers
2023-07-31  9:42   ` Thomas Richter
2023-08-01  3:32     ` Arnaldo Carvalho de Melo [this message]

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=ZMh84/oSgmzsiNz0@kernel.org \
    --to=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=tmricht@linux.ibm.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).