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__); > - return 0; > + if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_PV) { > + if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_USER) > + state |= PERF_GUEST_USER; > + } else { > + if (!!(xenpmu_data->pmu.r.regs.cpl & 3)) > + state |= PERF_GUEST_USER; Please drop "!!", it's not needed here. And use "else if". With that, for Xen bits: Reviewed-by: Boris Ostrovsky <boris.ostrv...@oracle.com> -boris
- [PATCH V7 01/18] perf/core: Use static_call to optimize pe... Zhu Lingshan
- Re: [PATCH V7 01/18] perf/core: Use static_call to op... Boris Ostrovsky
- Re: [PATCH V7 01/18] perf/core: Use static_call t... Zhu, Lingshan
- [PATCH V7 01/18] perf/core: Use static_call to optimi... Zhu Lingshan
- Re: [PATCH V7 01/18] perf/core: Use static_call t... Peter Zijlstra
- Re: [PATCH V7 01/18] perf/core: Use static_ca... Joe Perches
- Re: [PATCH V7 01/18] perf/core: Use stati... Peter Zijlstra
- Re: [PATCH V7 01/18] perf/core: Use ... Joe Perches
- Re: [PATCH V7 01/18] perf/core: Use stati... Mark Rutland
- Re: [PATCH V7 01/18] perf/core: Use ... Joe Perches
- Re: [PATCH V7 01/18] perf/core: Use static_ca... Zhu Lingshan