Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-08 Thread Zhu Lingshan
On 7/2/2021 7:22 PM, Peter Zijlstra wrote: 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 @@

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Joe Perches
On Fri, 2021-07-02 at 17:38 +0100, Mark Rutland wrote: > On Fri, Jul 02, 2021 at 09:00:22AM -0700, Joe Perches wrote: > > On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote: > > > On Tue, Jun 22, 2021 at 05:42:49PM +0800, Zhu Lingshan wrote: [] > > > > + if (perf_guest_cbs &&

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Joe Perches
On Fri, 2021-07-02 at 18:19 +0200, Peter Zijlstra wrote: > On Fri, Jul 02, 2021 at 09:00:22AM -0700, Joe Perches wrote: > > On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote: > > > On Tue, Jun 22, 2021 at 05:42:49PM +0800, Zhu Lingshan wrote: > > > > diff --git a/arch/x86/events/core.c

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Mark Rutland
On Fri, Jul 02, 2021 at 09:00:22AM -0700, Joe Perches wrote: > On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote: > > 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 > [] > > > @@ -90,6 +90,27 @@

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Peter Zijlstra
On Fri, Jul 02, 2021 at 09:00:22AM -0700, Joe Perches wrote: > On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote: > > 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 > [] > > > @@ -90,6 +90,27 @@

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Joe Perches
On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote: > 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 [] > > @@ -90,6 +90,27 @@ DEFINE_STATIC_CALL_NULL(x86_pmu_pebs_aliases, > > *x86_pmu.pebs_aliases); > >   */ >

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Peter Zijlstra
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, >

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-06-23 Thread Zhu, Lingshan
Thanks Boris, I will fix this in V8 On 6/23/2021 1:31 AM, Boris Ostrovsky wrote: On 6/22/21 5:38 AM, Zhu Lingshan wrote: -static int xen_is_user_mode(void) -{ - const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); + state |= PERF_GUEST_ACTIVE; - if (!xenpmu_data) { -

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-06-22 Thread Boris Ostrovsky
On 6/22/21 5:38 AM, Zhu Lingshan wrote: > -static int xen_is_user_mode(void) > -{ > - const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); > + state |= PERF_GUEST_ACTIVE; > > - if (!xenpmu_data) { > - pr_warn_once("%s: pmudata not initialized\n", __func__); > -

[PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-06-22 Thread Zhu Lingshan
From: Like Xu For "struct perf_guest_info_callbacks", the two fields "is_in_guest" and "is_user_mode" are replaced with a new multiplexed member named "state", and the "get_guest_ip" field will be renamed to "get_ip". For arm64, xen and kvm/x86, the application of DEFINE_STATIC_CALL_RET0 could

[PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-06-22 Thread Zhu Lingshan
From: Like Xu For "struct perf_guest_info_callbacks", the two fields "is_in_guest" and "is_user_mode" are replaced with a new multiplexed member named "state", and the "get_guest_ip" field will be renamed to "get_ip". For arm64, xen and kvm/x86, the application of DEFINE_STATIC_CALL_RET0 could