lkml.org 
[lkml]   [2019]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/7] perf/x86/intel: Support PEBS output to PT
On Wed, Jul 31, 2019 at 05:30:36PM +0300, Alexander Shishkin wrote:
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index cfe256ca76df..6cf2a7ba822a 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -1006,6 +1006,28 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,
> /* current number of events already accepted */
> n = cpuc->n_events;
>
> + if (!cpuc->is_fake && leader->attr.precise_ip) {
> + if (!n)
> + cpuc->pebs_output = 0;

I think this can go wobbly if we add a !pebs event first.

That is, in that case '!n && !precise_ip' and we'll not reset the output
state.

> +
> + /*
> + * For PEBS->PT, if !aux_event, the group leader (PT) went
> + * away, the group was broken down and this singleton event
> + * can't schedule any more.
> + */
> + if (WARN_ON_ONCE(is_pebs_pt(leader) && !leader->aux_event))
> + return -EINVAL;
> +
> + /*
> + * pebs_output: 0: no PEBS so far, 1: PT, 2: DS
> + */
> + if (cpuc->pebs_output &&
> + cpuc->pebs_output != is_pebs_pt(leader) + 1)
> + return -EINVAL;
> +
> + cpuc->pebs_output = is_pebs_pt(leader) + 1;
> + }
> +
> if (is_x86_event(leader)) {
> if (n >= max_count)
> return -EINVAL;

\
 
 \ /
  Last update: 2019-07-31 18:51    [W:0.096 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site