From: Thomas Richter <tmricht@linux.ibm.com>
To: Ian Rogers <irogers@google.com>,
"linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: perf test case 6 dumps core on s390 without PMU
Date: Fri, 28 Jul 2023 16:30:26 +0200 [thread overview]
Message-ID: <f0508123-780b-3370-e64a-c78a350d76fa@linux.ibm.com> (raw)
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)
#
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?
Thanks a lot.
--
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
next reply other threads:[~2023-07-28 14:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 14:30 Thomas Richter [this message]
2023-07-28 15:32 ` perf test case 6 dumps core on s390 without PMU Ian Rogers
2023-07-31 9:42 ` Thomas Richter
2023-08-01 3:32 ` Arnaldo Carvalho de Melo
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=f0508123-780b-3370-e64a-c78a350d76fa@linux.ibm.com \
--to=tmricht@linux.ibm.com \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
/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).