Re: [PATCH v2 1/8] perf/x86: add a function to get the lbr stack

2018-09-07 Thread Wei Wang
On 09/07/2018 11:28 AM, Andi Kleen wrote: +int perf_get_lbr_stack(struct perf_lbr_stack *stack) +{ + stack->lbr_nr = x86_pmu.lbr_nr; + stack->lbr_tos = x86_pmu.lbr_tos; + stack->lbr_from = x86_pmu.lbr_from; + stack->lbr_to = x86_pmu.lbr_to; + + if

Re: [PATCH v2 1/8] perf/x86: add a function to get the lbr stack

2018-09-07 Thread Wei Wang
On 09/07/2018 11:28 AM, Andi Kleen wrote: +int perf_get_lbr_stack(struct perf_lbr_stack *stack) +{ + stack->lbr_nr = x86_pmu.lbr_nr; + stack->lbr_tos = x86_pmu.lbr_tos; + stack->lbr_from = x86_pmu.lbr_from; + stack->lbr_to = x86_pmu.lbr_to; + + if

Re: [PATCH v2 1/8] perf/x86: add a function to get the lbr stack

2018-09-06 Thread Andi Kleen
> +int perf_get_lbr_stack(struct perf_lbr_stack *stack) > +{ > + stack->lbr_nr = x86_pmu.lbr_nr; > + stack->lbr_tos = x86_pmu.lbr_tos; > + stack->lbr_from = x86_pmu.lbr_from; > + stack->lbr_to = x86_pmu.lbr_to; > + > + if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO) > +

Re: [PATCH v2 1/8] perf/x86: add a function to get the lbr stack

2018-09-06 Thread Andi Kleen
> +int perf_get_lbr_stack(struct perf_lbr_stack *stack) > +{ > + stack->lbr_nr = x86_pmu.lbr_nr; > + stack->lbr_tos = x86_pmu.lbr_tos; > + stack->lbr_from = x86_pmu.lbr_from; > + stack->lbr_to = x86_pmu.lbr_to; > + > + if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO) > +

[PATCH v2 1/8] perf/x86: add a function to get the lbr stack

2018-09-06 Thread Wei Wang
The LBR stack MSRs are architecturally specific. The perf subsystem has already assigned the abstracted MSR values based on the CPU architecture. This patch enables a caller outside the perf subsystem to get the LBR stack info. This is useful for hyperviosrs to prepare the lbr feature for the

[PATCH v2 1/8] perf/x86: add a function to get the lbr stack

2018-09-06 Thread Wei Wang
The LBR stack MSRs are architecturally specific. The perf subsystem has already assigned the abstracted MSR values based on the CPU architecture. This patch enables a caller outside the perf subsystem to get the LBR stack info. This is useful for hyperviosrs to prepare the lbr feature for the