linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Cody P Schafer <devel-lists@codyps.com>
Cc: linux-perf-users@vger.kernel.org, KVM <kvm@vger.kernel.org>,
	Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Subject: Re: BUG: perf kvm top --callgraph not showing callgraph
Date: Fri, 14 Jun 2013 17:23:20 -0600	[thread overview]
Message-ID: <51BBA5E8.5070204@gmail.com> (raw)
In-Reply-To: <CAPoQQ-1sjf6Wj4sU7--X4DpCEeMhbgbap_OfDmD0rCXWT1XyvA@mail.gmail.com>

[added kvm devel list and Xiao who implemented the original perf-kvm as 
I recall]

On 6/14/13 5:11 PM, Cody P Schafer wrote:
>> I am under the impression the limitations are these 2 snippets in
>> >arch/x86/kernel/cpu/perf_event.c:
> Yep, that's disabling the in-kernel callchain generation (the in-perf
> callchain code should still be an option without this). I wonder if
> one could use perf_callchain_user() to find the callchain of the guest
> kernel.
>
> Does anyone know the particular changes that need to be done to
> support kvm backtraces/the reasons it is specifically disabled?

It's going to require some KVM changes I would think. e.g., for the IP:

unsigned long perf_instruction_pointer(struct pt_regs *regs)
{
     if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
         return perf_guest_cbs->get_guest_ip();

     return regs->ip + code_segment_base(regs);
}

get_guest_ip comes from arch/x86/kvm/x86.c.

callchain walking starts in perf_callchain, kernel/events/callchain.c

For more context:
perf_prepare_sample()
   data->callchain = perf_callchain(event, regs);

For guests you'll want regs from the guest which will need to be 
supplied by kvm.

David

      reply	other threads:[~2013-06-14 23:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  1:04 BUG: perf kvm top --callgraph not showing callgraph Cody P Schafer
2013-06-14  1:10 ` David Ahern
2013-06-14 21:53   ` Cody P Schafer
2013-06-14 22:01     ` David Ahern
2013-06-14 23:11       ` Cody P Schafer
2013-06-14 23:23         ` David Ahern [this message]

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=51BBA5E8.5070204@gmail.com \
    --to=dsahern@gmail.com \
    --cc=devel-lists@codyps.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=xiaoguangrong@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;
as well as URLs for NNTP newsgroup(s).