[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1441607415.1285.1.camel@ellerman.id.au>
Date: Mon, 07 Sep 2015 16:30:15 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Hemant Kumar <hemant@...ux.vnet.ibm.com>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
scottwood@...escale.com, acme@...nel.org, mingo@...nel.org,
sukadev@...ux.vnet.ibm.com, maddy@...ux.vnet.ibm.com,
warrier@...ux.vnet.ibm.com, srikar@...ux.vnet.ibm.com,
paulus@...ba.org
Subject: Re: [PATCH v6 2/3] perf,kvm/powerpc: Port perf kvm stat to powerpc
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists