lkml.org 
[lkml]   [2021]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: arm64: build perf support only when enabled
On Wed, 21 Apr 2021 14:49:01 +0100,
Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The perf_num_counters() function is only defined when CONFIG_PERF_EVENTS
> is enabled:
>
> arch/arm64/kvm/perf.c: In function 'kvm_perf_init':
> arch/arm64/kvm/perf.c:58:43: error: implicit declaration of function 'perf_num_counters'; did you mean 'dec_mm_counter'? [-Werror=implicit-function-declaration]
> 58 | if (IS_ENABLED(CONFIG_ARM_PMU) && perf_num_counters() > 0
> | ^~~~~~~~~~~~~~~~~
>
> Use conditional compilation to disable this feature entirely when
> CONFIG_PERF_EVENTS is disabled in the host.
>
> Fixes: 6b5b368fccd7 ("KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Not sure if this is the correct symbol to check for, but this is
> one way to avoid the build failure.

I think a better way is to get rid of perf_num_counters() entirely,
see [1]. If someone acks the second and last patches, I'll even take
the whole series in (nudge nudge...).

Thanks,

M.

[1] https://lore.kernel.org/r/20210414134409.1266357-1-maz@kernel.org

--
Without deviation from the norm, progress is not possible.

\
 
 \ /
  Last update: 2021-04-21 15:57    [W:0.079 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site