lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V6 07/14] perf/x86/intel: Generic support for hardware TopDown metrics
On Tue, Jul 21, 2020 at 10:05:55AM -0400, Liang, Kan wrote:
> On 7/21/2020 5:43 AM, Peter Zijlstra wrote:
> > @@ -1098,37 +1105,20 @@ static int collect_events(struct cpu_hw_
> > cpuc->pebs_output = is_pebs_pt(leader) + 1;
> > }
> > - if (x86_pmu.intel_cap.perf_metrics &&
> > - add_nr_metric_event(cpuc, leader, &max_count, false))
> > + if (is_x86_event(leader) && collect_event(cpuc, leader, max_count, n))
> > return -EINVAL;
> > + n++;
>
> If a leader is not an x86 event, n will be mistakenly increased.
> But is it possible that a leader is not an x86 event here?

You're right, and yes that can happen, see the move_group=1 case in
sys_perf_event_open().

if (is_x86_event(leader)) {
if (collect_event(cpuc, leader, max_count, n))
return -EINVAL;
n++;
}

it is then..

\
 
 \ /
  Last update: 2020-07-21 16:25    [W:0.074 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site