[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YN722HIrzc6Z2+oD@hirez.programming.kicks-ass.net>
Date: Fri, 2 Jul 2021 13:22:00 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Zhu Lingshan <lingshan.zhu@...el.com>
Cc: pbonzini@...hat.com, bp@...en8.de, seanjc@...gle.com,
vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com,
joro@...tes.org, weijiang.yang@...el.com,
kan.liang@...ux.intel.com, ak@...ux.intel.com,
wei.w.wang@...el.com, eranian@...gle.com, liuxiangdong5@...wei.com,
linux-kernel@...r.kernel.org, x86@...nel.org, kvm@...r.kernel.org,
like.xu.linux@...il.com, Like Xu <like.xu@...ux.intel.com>,
Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>,
Guo Ren <guoren@...nel.org>, Nick Hu <nickhu@...estech.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
linux-csky@...r.kernel.org, linux-riscv@...ts.infradead.org,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH V7 01/18] perf/core: Use static_call to optimize
perf_guest_info_callbacks
On Tue, Jun 22, 2021 at 05:42:49PM +0800, Zhu Lingshan wrote:
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index 8f71dd72ef95..c71af4cfba9b 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -90,6 +90,27 @@ DEFINE_STATIC_CALL_NULL(x86_pmu_pebs_aliases, *x86_pmu.pebs_aliases);
> */
> DEFINE_STATIC_CALL_RET0(x86_pmu_guest_get_msrs, *x86_pmu.guest_get_msrs);
>
> +DEFINE_STATIC_CALL_RET0(x86_guest_state, *(perf_guest_cbs->state));
> +DEFINE_STATIC_CALL_RET0(x86_guest_get_ip, *(perf_guest_cbs->get_ip));
> +DEFINE_STATIC_CALL_RET0(x86_guest_handle_intel_pt_intr, *(perf_guest_cbs->handle_intel_pt_intr));
> +
> +void arch_perf_update_guest_cbs(void)
> +{
> + static_call_update(x86_guest_state, (void *)&__static_call_return0);
> + static_call_update(x86_guest_get_ip, (void *)&__static_call_return0);
> + static_call_update(x86_guest_handle_intel_pt_intr, (void *)&__static_call_return0);
> +
> + if (perf_guest_cbs && perf_guest_cbs->state)
> + static_call_update(x86_guest_state, perf_guest_cbs->state);
> +
> + if (perf_guest_cbs && perf_guest_cbs->get_ip)
> + static_call_update(x86_guest_get_ip, perf_guest_cbs->get_ip);
> +
> + if (perf_guest_cbs && perf_guest_cbs->handle_intel_pt_intr)
> + static_call_update(x86_guest_handle_intel_pt_intr,
> + perf_guest_cbs->handle_intel_pt_intr);
> +}
Coding style wants { } on that last if().
Powered by blists - more mailing lists