lkml.org 
[lkml]   [2015]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 2/3] perf,kvm/powerpc: Port perf kvm stat to powerpc
From
Date
On Mon, 2015-08-31 at 12:24 +0530, Hemant Kumar wrote:
> perf kvm can be used to analyze guest exit reasons. This support already
> exists in x86. Hence, porting it to powerpc.
>
> - To trace KVM events :
> perf kvm stat record
> If many guests are running, we can track for a specific guest by using
> --pid as in : perf kvm stat record --pid <pid>
>
> - To see the results :
> perf kvm stat report
>
> The result shows the number of exits (from the guest context to
> host/hypervisor context) grouped by their respective exit reasons with
> their frequency.
>
> Since, different powerpc machines have different KVM tracepoints, this
> patch discovers the machine type dynamically from /proc/cpuinfo's
> "machine" tag and accordingly sets kvm tracepoints. Right now, it only
> supports Book3S_HV tracepoints.

I'm not a big fan of parsing /proc/cpuinfo. I know you're not the first person
to do it, but can't we do something better?

Perf already knows how to find out what tracepoint events exist. You should be
able to just probe for the required events. eg. if 'kvm_hv:kvm_guest_enter'
exists then you use it. Otherwise there's no support.

When book3e wants to support 'perf kvm', you'd just add another event to probe
for, ie. something like 'kvm_book3e:kvm_guest_enter'.

And, if we ever want to change the name of any of the tracepoints you could
just add the new and the old names to the list of events to look for, and
depending on which you find, that is what you use.

cheers




\
 
 \ /
  Last update: 2015-09-07 08:41    [W:0.063 / U:1.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site