From: David Ahern <dsahern@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: acme@redhat.com, a.p.zijlstra@chello.nl, mingo@elte.hu,
paulus@samba.org, cjashfor@linux.vnet.ibm.com,
fweisbec@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] perf, tool: Force guest machine definition option
Date: Sun, 15 Apr 2012 15:32:40 -0600 [thread overview]
Message-ID: <4F8B3E78.7080809@gmail.com> (raw)
In-Reply-To: <20120415140513.GA2588@m.redhat.com>
On 4/15/12 8:05 AM, Jiri Olsa wrote:
> how about the patch below? it ensures there's machine record for
> the guest. The segfault issue still stays..
>
> jirka
>
> ---
> Running 'perf kvm record' without any of following options:
> --guestmount
> --guestvmlinux
> --guestkallsyms
> --guestmodules
>
> is causing the guest machine to be ommited from the data file,
> and all guest samples are counted in nr_unprocessable_samples.
>
> This patch makes sure the 'perf kvm record' command is not
> let through if guest machine isn't defined.
Doesn't work: it requires a 'default' vmlinux/modules/kallsyms even when
a proper guestmount has been specified.
Today guestmount works for the report path because of the hook in
machines__findnew() which creates a machine on first lookup. Really, the
guestmount argument should not be required for the report which could be
using a local symbol tree (symfs argument) -- e.g., capture on a host OS
which could have kallsyms/module information for each VM / VM being
profiled and then report file taken to another system for analysis where
that system has access to symbols.
Perhaps what is needed is for the machine to be created for the pid ==
DEFAULT_GUEST_KERNEL_ID on first need. This is not the right place --
but shows the sentiment:
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 1efd3be..20420fc 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -824,6 +824,7 @@ static struct machine *
perf_session__find_machine_for_cpumode(struct perf_session *session,
union perf_event *event)
{
+ struct machine *mach;
const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
@@ -834,7 +835,10 @@ static struct machine *
else
pid = event->ip.pid;
- return perf_session__find_machine(session, pid);
+ mach = perf_session__find_machine(session, pid);
+ if (!mach && pid == 0)
+ mach = machines__add(&session->machines, pid, "/dev/null");
+ return mach;
}
return perf_session__find_host_machine(session);
So basically it allows kernel maps to be attached to a pid 0 machine but
that machine has no tree for further symbols. If nothing else perf-kvm
does not segfault.
I am seeing other problems with perf-kvm too. e.g.,
perf kvm --guest --host --guestmount /tmp/guestmount record -p 21234 --
sleep 10
Dumping the samples:
perf script -i perf.data.guest
--> shows no samples (2 'openssl speed' commands are running in the
2-vcpu guest so something should be generated)
perf script -i perf.data.kvm
Failed to open [guest.kernel.kallsyms.21234]_text, continuing without
symbols
qemu-kvm 21234 cycles: ffffffff8103edaa [unknown]
([guest.kernel.kallsyms.21234]_text)
Anyways, perf-kvm needs some love. Gotta run.
David
next prev parent reply other threads:[~2012-04-15 21:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 12:20 [PATCH 0/3] perf, tool: kvm record & event processing fixies Jiri Olsa
2012-04-12 12:21 ` [PATCH 1/3] perf, tool: Force guest machine definition option Jiri Olsa
2012-04-12 14:40 ` David Ahern
2012-04-13 11:32 ` Jiri Olsa
2012-04-13 12:21 ` David Ahern
2012-04-13 12:41 ` Jiri Olsa
2012-04-13 14:15 ` David Ahern
2012-04-15 14:05 ` Jiri Olsa
2012-04-15 21:32 ` David Ahern [this message]
2012-04-12 12:21 ` [PATCH 2/3] perf, tool: Skip event correctly for unknown id/machine Jiri Olsa
2012-04-15 8:34 ` [tip:perf/urgent] perf session: " tip-bot for Jiri Olsa
2012-04-12 12:21 ` [PATCH 3/3] perf, tool: Fail on processing event with unknown size Jiri Olsa
2012-04-16 18:42 ` [PATCHv2 " Jiri Olsa
2012-05-11 6:37 ` [tip:perf/core] perf session: " tip-bot for Jiri Olsa
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=4F8B3E78.7080809@gmail.com \
--to=dsahern@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
/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