lkml.org 
[lkml]   [2011]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] perf, x86: Use GO/HO bits in perf-ctr
From
Date
On Tue, 2011-05-10 at 16:35 +0200, Joerg Roedel wrote:
> The AMD perf-counters support counting in guest or host-mode
> only. Make use of that feature when user-space specified
> guest/host-mode only counting.

Subject mentions x86, does Intel have anything similar so you can make
it work for them too?

Also, might be nice to ask the power and sparc64 people if their archs
can also differentiate between guest and host thingies.

> diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
> index cf4e369..afc21f3 100644
> --- a/arch/x86/kernel/cpu/perf_event_amd.c
> +++ b/arch/x86/kernel/cpu/perf_event_amd.c
> @@ -116,6 +116,12 @@ static int amd_pmu_hw_config(struct perf_event *event)
> if (ret)
> return ret;
>
> + if (event->attr.exclude_host)
> + event->hw.config |= AMD_PERFMON_EVENTSEL_GUESTONLY;
> +
> + if (event->attr.exclude_guest)
> + event->hw.config |= AMD_PERFMON_EVENTSEL_HOSTONLY;
> +
> if (event->attr.type != PERF_TYPE_RAW)
> return 0;



\
 
 \ /
  Last update: 2011-05-10 16:51    [W:1.033 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site