RFR: 7903740: JMH: Perf event validation not working with skid options [v2]

Galder Zamarreño galder at openjdk.org
Fri Aug 16 08:31:00 UTC 2024


On Wed, 14 Aug 2024 08:51:13 GMT, Galder Zamarreño <galder at openjdk.org> wrote:

>> Fixes https://bugs.openjdk.org/browse/CODETOOLS-7903740
>
> Galder Zamarreño has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - --log-fd not valid for perf record
>  - Switch to testing with perf record

Actually my test shows the issue with switching to `perf record`. With `perf stat` we validate whether that event is supported and my test shows that it prints:


2024-08-16T07:50:50.3850275Z  Performance counter stats for 'echo 1':
2024-08-16T07:50:50.3850840Z 
2024-08-16T07:50:50.3851431Z    <not supported>      cycles                                                                
2024-08-16T07:50:50.3852100Z 
2024-08-16T07:50:50.3852392Z        0.002036823 seconds time elapsed
2024-08-16T07:50:50.3852825Z 
2024-08-16T07:50:50.3853024Z        0.000000000 seconds user
2024-08-16T07:50:50.3853730Z        0.002091000 seconds sys


Since `not supported` is in the output, the profiler test does not execute.

The `perf record` output on the other hand does not include that output so it assumes it's fine:


2024-08-16T07:50:51.5384315Z ##[group]Run perf record --event cycles echo 1
2024-08-16T07:50:51.5384952Z perf record --event cycles echo 1
2024-08-16T07:50:51.5451005Z shell: /usr/bin/bash -e {0}
2024-08-16T07:50:51.5451385Z ##[endgroup]
2024-08-16T07:50:51.6709500Z WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,
2024-08-16T07:50:51.6710972Z check /proc/sys/kernel/kptr_restrict and /proc/sys/kernel/perf_event_paranoid.
2024-08-16T07:50:51.6711978Z 
2024-08-16T07:50:51.6712829Z Samples in kernel functions may not be resolved if a suitable vmlinux
2024-08-16T07:50:51.6714013Z file is not found in the buildid cache or in the vmlinux path.
2024-08-16T07:50:51.6714727Z 
2024-08-16T07:50:51.6715312Z Samples in kernel modules won't be resolved at all.
2024-08-16T07:50:51.6715889Z 
2024-08-16T07:50:51.6724799Z PERFILE2�������@�����������������������������G�������������7�a������������������������������������������������������������������������������������������������������������������������P�����T��������@���fv-az1567-205���������������������������������������������������P�����T��������@���6.5.0-1025-azure������������������������������������������������P��
 ���T��������@���6.5.13����������������������������������������������������������P�����T��������@���x86_64����������������������������������������������������������P�������������������P�����T��������@���AMD EPYC 7763 64-Core Processor���������������������������������P�����T�	�������@���AuthenticAMD,25,1,1���������������������������������������������P������
2024-08-16T07:50:51.6727231Z If some relocation was applied (e.g. kexec) symbols may be misresolved
2024-08-16T07:50:51.6727979Z even with a suitable vmlinux or kallsyms file.
2024-08-16T07:50:51.6728384Z 
2024-08-16T07:50:51.6730695Z �������0�������P������
����������@���/usr/lib/linux-azure-6.5-tools-6.5.0-1025/perf������������������@���record����������������������������������������������������������@���--event���������������������������������������������������������@���cycles����������������������������������������������������������@���echo������������������������������������������������������������@���1����������������������������
 �����������������������������������P�����
������������������������������������G�������������7�a�����������������������������������������������������������������������������������������������@���cpu-clock�����������������������������������������������������������������������������������P�����\
2024-08-16T07:50:51.6733242Z ����������@���0-3����������������������������������������������������������������@���0-1�������������������������������������������������������������@���2-3����������������������������������������������������������������������������������������������@���0-3���������������������������������������������������������������������������
 ��P�����l���������������0���������������@���0-3�������������������������������������������������������������P�����
�������������@���cpu����������������������������������������������������������������@���software��������������������������������������������������������	���@���uprobe�������������������������������������������������������������@���breakpoint���������������������������������������������������������@���tracepoint�����������������������������������������������
 ����������@���kprobe����������������������������������������������������������
2024-08-16T07:50:51.6734474Z Couldn't record kernel reference relocation symbol
2024-08-16T07:50:51.6735191Z Symbol resolution may be skewed if relocation was used (e.g. kexec).
2024-08-16T07:50:51.6735777Z Check /proc/kallsyms permission or run as root.
2024-08-16T07:50:51.8070024Z 1
2024-08-16T07:50:51.8071031Z [ perf record: Woken up 1 times to write data ]
2024-08-16T07:50:51.8073958Z ���@���msr�������������������������������������������������������������P����� ������������������������P�����X�����������������������������������������������������������������������������P�����������������P�����������������P�����������������P�����������������P������ �������O�����8��������l�W4����O"`{���������������������������E�����ï¿
 ½ï¿½������������������������������c	���������������������������c	���������������������������c	���������������������������c	������N�����8���������������cpu-clock�����������������������I�����(��������c	����������������������J�����������������P���������������bpf_trampoline_6442559410������������������������������������8�c	��c	��perf-exec�������������������������������R���ï
 ¿½ï¿½����� 0�c	��c	��echo����c	��c	���,��-����������
2024-08-16T07:50:51.8075631Z ����p�c	��c	����IV���@������� ������������,�������le�����������/usr/bin/echo���c	��c	������-����������
2024-08-16T07:50:51.8076240Z [ perf record: Captured and wrote 0.000 MB (null) ]
2024-08-16T07:50:51.8077114Z ������c	��c	���PY�`���������� ������������������oٮ�����������/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2��c	��c	��0	��-����������
2024-08-16T07:50:51.8078299Z ����h�c	��c	���������� ��������������������������������������������[vdso]��c	��c	���F��-����������
2024-08-16T07:50:52.6748187Z ������c	��c	����"�`���P������������������������J��G����������/usr/lib/x86_64-linux-gnu/libc.so.6�����c	��c	������-����������	����0�Y�F�����c	��c	��=��-�����������������	����0�ǖ������c	��c	������-�����������������	����0�ʻC�����c	��c	��ǚ��-����������������������8�c	��`	��c	��`	���t��-���c	��c	���r��-����������D������


Looking at the `perf record` output I don't see any specific signal to see if `perf record` works for that event or not.

-------------

PR Comment: https://git.openjdk.org/jmh/pull/132#issuecomment-2293071216


More information about the jmh-dev mailing list