Skip to contentSkip to conversation

perf machine: Remove condition in machine__get_kernel_start_addr.

PATCH New Dongsheng Yang 1 participant 1 message Nov 28, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf machine: Remove condition in machine__get_kernel_start_addr.

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.

---
 tools/perf/util/machine.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
tools/perf/util/machine.c +5 -9
index 84cdb07..bac817a 100644
@@ -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"))
Signature · 1 line
1.8.2.1