perf tools: Remove condition in machine__get_kernel_start_addr.
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Wed, 4 Dec 2013 22:56:39 +0000 (17:56 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 4 Dec 2013 16:46:36 +0000 (13:46 -0300)
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, as root_dir is set to "" for the host
machine in the machine__init() function.

So this patch remove the branch for machine__is_host.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/0a81645dd0b384a12cb4f962cf193ef8c3ce2010.1386197481.git.yangds.fnst@cn.fujitsu.com
[ Clarified changeset mentioning root_dir setup in machine__init() ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/machine.c

index 84cdb072ac83975670c477fa180980ae61425bda..bac817ab2068accc0c40a430cf95aed60ed672b6 100644 (file)
@@ -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"))