* perf test case 6 dumps core on s390 without PMU
@ 2023-07-28 14:30 Thomas Richter
2023-07-28 15:32 ` Ian Rogers
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Richter @ 2023-07-28 14:30 UTC (permalink / raw)
To: Ian Rogers, linux-perf-use.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: perf test case 6 dumps core on s390 without PMU
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
0 siblings, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2023-07-28 15:32 UTC (permalink / raw)
To: Thomas Richter; +Cc: linux-perf-use.
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
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: perf test case 6 dumps core on s390 without PMU
2023-07-28 15:32 ` Ian Rogers
@ 2023-07-31 9:42 ` Thomas Richter
2023-08-01 3:32 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Richter @ 2023-07-31 9:42 UTC (permalink / raw)
To: Ian Rogers, Arnaldo Carvalho de Melo; +Cc: linux-perf-use.
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>
>>
>> --
>> 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
--
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: perf test case 6 dumps core on s390 without PMU
2023-07-31 9:42 ` Thomas Richter
@ 2023-08-01 3:32 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-08-01 3:32 UTC (permalink / raw)
To: Thomas Richter; +Cc: Ian Rogers, linux-perf-use.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-01 3:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).