Re: [PATCH bpf] selftests/bpf: fix test_send_signal_nmi on s390

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 12, 2019 at 10:46 AM Ilya Leoshkevich <iii@xxxxxxxxxxxxx> wrote:
>
> Many s390 setups (most notably, KVM guests) do not have access to
> hardware performance events.
>
> Therefore, use the software event instead.
>
> Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
> Acked-by: Vasily Gorbik <gor@xxxxxxxxxxxxx>
> ---
>  tools/testing/selftests/bpf/prog_tests/send_signal.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/send_signal.c b/tools/testing/selftests/bpf/prog_tests/send_signal.c
> index 67cea1686305..4a45ea0b8448 100644
> --- a/tools/testing/selftests/bpf/prog_tests/send_signal.c
> +++ b/tools/testing/selftests/bpf/prog_tests/send_signal.c
> @@ -176,10 +176,19 @@ static int test_send_signal_tracepoint(void)
>  static int test_send_signal_nmi(void)
>  {
>         struct perf_event_attr attr = {
> +#if defined(__s390__)
> +               /* Many s390 setups (most notably, KVM guests) do not have
> +                * access to hardware performance events.
> +                */
> +               .sample_period = 1,
> +               .type = PERF_TYPE_SOFTWARE,
> +               .config = PERF_COUNT_SW_CPU_CLOCK,
> +#else

Is there any harm in switching all archs to software event? I'd rather
avoid all those special arch cases, which will be really hard to test
for people without direct access to them.

>                 .sample_freq = 50,
>                 .freq = 1,
>                 .type = PERF_TYPE_HARDWARE,
>                 .config = PERF_COUNT_HW_CPU_CYCLES,
> +#endif
>         };
>
>         return test_send_signal_common(&attr, BPF_PROG_TYPE_PERF_EVENT, "perf_event");
> --
> 2.21.0
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux