lkml.org 
[lkml]   [2011]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1 5/5] KVM: Expose a version 1 architectural PMU to guests
From
Date
On Wed, 2011-05-11 at 11:55 -0400, Avi Kivity wrote:
> +static u64 read_gp_pmc(struct kvm_pmu *pmu, struct kvm_pmc *pmc)
> +{
> + u64 counter, enabled, running;
> +
> + counter = pmc->counter;
> +
> + if (pmc->perf_event)
> + counter += perf_event_read_value(pmc->perf_event,
> + &enabled, &running);
> +
> + /* FIXME: Scaling needed? */

Yeah, either that or use attr.pinned = 1, doing the latter will result
in an error when the PMU is overloaded though.

> + return counter & pmu->counter_bitmask;
> +}


\
 
 \ /
  Last update: 2011-06-03 16:45    [W:0.205 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site