From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: linux-kernel@vger.kernel.org
Cc: eranian@google.com, dsahern@gmail.com, adrian.hunter@intel.com,
acme@ghostprotocols.net, mingo@redhat.com, paulus@samba.org,
a.p.zijlstra@chello.nl,
Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Subject: [PATCH] perf machine: Remove condition in machine__get_kernel_start_addr.
Date: Thu, 28 Nov 2013 16:47:25 -0500 [thread overview]
Message-ID: <1385675245-2224-1-git-send-email-yangds.fnst@cn.fujitsu.com> (raw)
In machine__get_kernel_start_addr, the code, which is
using machine->root_dir to build filename, works for both
host and guests initialized from guestmount. So this patch
remove the branch for machine__is_host.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
tools/perf/util/machine.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 84cdb07..52d9161 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -502,15 +502,11 @@ static u64 machine__get_kernel_start_addr(struct machine *machine)
char path[PATH_MAX];
struct process_args args;
- if (machine__is_host(machine)) {
- filename = "/proc/kallsyms";
- } else {
- if (machine__is_default_guest(machine))
- filename = (char *)symbol_conf.default_guest_kallsyms;
- else {
- sprintf(path, "%s/proc/kallsyms", machine->root_dir);
- filename = path;
- }
+ if (machine__is_default_guest(machine))
+ filename = (char *)symbol_conf.default_guest_kallsyms;
+ else {
+ sprintf(path, "%s/proc/kallsyms", machine->root_dir);
+ filename = path;
}
if (symbol__restricted_filename(filename, "/proc/kallsyms"))
@@ -589,7 +585,7 @@ int machines__create_guest_kernel_maps(struct machines *machines)
if (symbol_conf.default_guest_vmlinux_name ||
symbol_conf.default_guest_modules ||
symbol_conf.default_guest_kallsyms) {
- machines__create_kernel_maps(machines, DEFAULT_GUEST_KERNEL_ID);
+ machines__create_kernel_maps(machines, 20315);
}
if (symbol_conf.guestmount) {
--
1.8.2.1
next reply other threads:[~2013-11-28 8:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-28 21:47 Dongsheng Yang [this message]
2013-11-28 21:51 ` [PATCH] perf machine: Remove condition in machine__get_kernel_start_addr Dongsheng Yang
2013-11-28 21:55 Dongsheng Yang
2013-11-28 22:08 Dongsheng Yang
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=1385675245-2224-1-git-send-email-yangds.fnst@cn.fujitsu.com \
--to=yangds.fnst@cn.fujitsu.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).