There are some perf test failures noticed on Hikey960 and kernel used 4.9.20
- Executed below command in Hikey960 target after perf compilation and placing it in target rootfs
{{{
/ # perf test
…
17: Test breakpoint overflow signal handler : FAILED!
18: Test breakpoint overflow sampling : FAILED!
…
}}} - Executed by --verbose option:
- 1st case:
{{{
/ # perf test -v 17
17: Test breakpoint overflow signal handler :
— start —
test child forked, pid 1493
count1 1, count2 11, count3 0, overflow 1, overflows_2 11
failed: wrong overflow hit
failed: wrong overflow_2 hit
failed: wrong count for bp2
failed: wrong count for bp3
test child finished with -1
---- end ----
Test breakpoint overflow signal handler: FAILED!
/ #
}}}
- In above case, when i analyse the code, the expected values are
{{{
…
return count1 == 1 && overflows == 3 && count2 == 3 && overflows_2 == 3 && count3 == 2 ?
TEST_OK : TEST_FAIL;
}}}
2nd case:
{{{
/ # perf test -v 18
18: Test breakpoint overflow sampling :
— start —
test child forked, pid 1495
count 10101, overflow 101
Wrong number of executions 10101 != 10000
Wrong number of overflows 101 != 100
test child finished with -1
---- end ----
Test breakpoint overflow sampling: FAILED!
/ #
}}}
- In above case, the expected values as per ‘tools/perf/tests/bp_signal_overflow.c’
{{{
…
#define EXECUTIONS 10000
#define THRESHOLD 100
}}}
3rd case:
- Also I cloned http://github.com/deater/perf_event_tests and compiled perf events “branches” test, but test got failed.
- As per ‘perf_event_tests/validation/branches.c’ counter value should be 1500000, but I am getting from the hikey960 is “100340183”.
I analysed the code flow:
{{{
(tools/perf/tests/builtin-test.c) → test__bp_signal (tools/perf/tests/bp_signal.c)
→ bp_event → sys_perf_event_open (kernel/events/core.c)
→ perf_event_alloc → perf_init_event → pmu->event_init →
hw_breakpoint_event_init (kernel/events/hw_breakpoint.c) → register_perf_hw_breakpoint
→ validate_hw_breakpoint → arch_validate_hwbkpt_settings → monitor_mode_enabled
→ arch_build_bp_info (arch/arm64/kernel/hw_breakpoint.c)
}}}
I am not able to find where exactly values are getting increased.
Could you please share why the pmu counter and overflow values are getting mismatched or please suggest me how to move forward to get the correct values as per the code.
Thanks,
Murali