Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc612d81 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar
Browse files

perf symbols: Look for vmlinux in more places



Now that we can check the buildid to see if it really matches,
this can be done safely:

  vmlinux
  /boot/vmlinux
  /boot/vmlinux-<uts.release>
  /lib/modules/<uts.release>/build/vmlinux
  /usr/lib/debug/lib/modules/%s/vmlinux

More can be added - if you know about distros that put the
vmlinux somewhere else please let us know.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1259001550-8194-1-git-send-email-acme@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 1b290d67
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ static bool use_modules;

static unsigned long	page_size;
static unsigned long	mmap_window = 32;
const char		*vmlinux_name;

struct sym_hist {
	u64		sum;
@@ -637,7 +638,7 @@ static int __cmd_annotate(void)
		exit(0);
	}

	if (kernel_maps__init(use_modules) < 0) {
	if (kernel_maps__init(vmlinux_name, true, use_modules) < 0) {
		pr_err("failed to create kernel maps for symbol resolution\b");
		return -1;
	}
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ static int read_events(void)
	register_idle_thread();
	register_perf_file_handler(&file_handler);

	return mmap_dispatch_perf_file(&header, input_name, 0, 0,
	return mmap_dispatch_perf_file(&header, input_name, NULL, false, 0, 0,
				       &cwdlen, &cwd);
}

+4 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ static char *pretty_printing_style = default_pretty_printing_style;
static int		exclude_other = 1;

static char		callchain_default_opt[] = "fractal,0.5";
const char		*vmlinux_name;

static char		*cwd;
static int		cwdlen;
@@ -925,8 +926,9 @@ static int __cmd_report(void)

	register_perf_file_handler(&file_handler);

	ret = mmap_dispatch_perf_file(&header, input_name, force, full_paths,
				      &cwdlen, &cwd);
	ret = mmap_dispatch_perf_file(&header, input_name, vmlinux_name,
				      !vmlinux_name, force,
				      full_paths, &cwdlen, &cwd);
	if (ret)
		return ret;

+2 −1
Original line number Diff line number Diff line
@@ -1718,7 +1718,8 @@ static int read_events(void)
	register_idle_thread();
	register_perf_file_handler(&file_handler);

	return mmap_dispatch_perf_file(&header, input_name, 0, 0, &cwdlen, &cwd);
	return mmap_dispatch_perf_file(&header, input_name, NULL, false, 0, 0,
				       &cwdlen, &cwd);
}

static void print_bad_events(void)
+2 −1
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ static int dump_symtab = 0;
static bool			hide_kernel_symbols		=  false;
static bool			hide_user_symbols		=  false;
static struct winsize		winsize;
const char 			*vmlinux_name;
static const char		*graph_line			=
	"_____________________________________________________________________"
	"_____________________________________________________________________";
@@ -1341,7 +1342,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
	if (delay_secs < 1)
		delay_secs = 1;

	err = kernel_maps__init(true);
	err = kernel_maps__init(vmlinux_name, !vmlinux_name, true);
	if (err < 0)
		return err;
	parse_source(sym_filter_entry);
Loading