mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	scottwood@freescale.com, acme@kernel.org, mingo@kernel.org,
	sukadev@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com,
	warrier@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com,
	paulus@samba.org
Subject: Re: [PATCH v6 2/3] perf,kvm/powerpc: Port perf kvm stat to powerpc
Date: Mon, 07 Sep 2015 16:30:15 +1000	[thread overview]
Message-ID: <1441607415.1285.1.camel@ellerman.id.au> (raw)
In-Reply-To: <1441004068-11306-2-git-send-email-hemant@linux.vnet.ibm.com>

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



  reply	other threads:[~2015-09-07  6:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31  6:54 [PATCH v6 1/3] perf,kvm/powerpc: Remove const from kvm_events_tp Hemant Kumar
2015-08-31  6:54 ` [PATCH v6 2/3] perf,kvm/powerpc: Port perf kvm stat to powerpc Hemant Kumar
2015-09-07  6:30   ` Michael Ellerman [this message]
2015-08-31  6:54 ` [PATCH v6 3/3] perf,kvm/powerpc: Add support for HCALL reasons Hemant Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441607415.1285.1.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=acme@kernel.org \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=scottwood@freescale.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=warrier@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome