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

Commit 79534f23 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branches 'perf-fixes-for-linus' and 'x86-fixes-for-linus' of...

Merge branches 'perf-fixes-for-linus' and 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf probe: Fix to support libdwfl older than 0.148
  perf tools: Fix lazy wildcard matching
  perf buildid-list: Fix error return for success
  perf buildid-cache: Fix symbolic link handling
  perf symbols: Stop using vmlinux files with no symbols
  perf probe: Fix use of kernel image path given by 'k' option

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, kexec: Limit the crashkernel address appropriately
Loading
Loading
Loading
Loading
+14 −3
Original line number Original line Diff line number Diff line
@@ -501,7 +501,18 @@ static inline unsigned long long get_total_mem(void)
	return total << PAGE_SHIFT;
	return total << PAGE_SHIFT;
}
}


#define DEFAULT_BZIMAGE_ADDR_MAX 0x37FFFFFF
/*
 * Keep the crash kernel below this limit.  On 32 bits earlier kernels
 * would limit the kernel to the low 512 MiB due to mapping restrictions.
 * On 64 bits, kexec-tools currently limits us to 896 MiB; increase this
 * limit once kexec-tools are fixed.
 */
#ifdef CONFIG_X86_32
# define CRASH_KERNEL_ADDR_MAX	(512 << 20)
#else
# define CRASH_KERNEL_ADDR_MAX	(896 << 20)
#endif

static void __init reserve_crashkernel(void)
static void __init reserve_crashkernel(void)
{
{
	unsigned long long total_mem;
	unsigned long long total_mem;
@@ -520,10 +531,10 @@ static void __init reserve_crashkernel(void)
		const unsigned long long alignment = 16<<20;	/* 16M */
		const unsigned long long alignment = 16<<20;	/* 16M */


		/*
		/*
		 *  kexec want bzImage is below DEFAULT_BZIMAGE_ADDR_MAX
		 *  kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
		 */
		 */
		crash_base = memblock_find_in_range(alignment,
		crash_base = memblock_find_in_range(alignment,
			       DEFAULT_BZIMAGE_ADDR_MAX, crash_size, alignment);
			       CRASH_KERNEL_ADDR_MAX, crash_size, alignment);


		if (crash_base == MEMBLOCK_ERROR) {
		if (crash_base == MEMBLOCK_ERROR) {
			pr_info("crashkernel reservation failed - No suitable area found.\n");
			pr_info("crashkernel reservation failed - No suitable area found.\n");
+1 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,6 @@ static const struct option options[] = {


static int __cmd_buildid_list(void)
static int __cmd_buildid_list(void)
{
{
	int err = -1;
	struct perf_session *session;
	struct perf_session *session;


	session = perf_session__new(input_name, O_RDONLY, force, false);
	session = perf_session__new(input_name, O_RDONLY, force, false);
@@ -49,7 +48,7 @@ static int __cmd_buildid_list(void)
	perf_session__fprintf_dsos_buildid(session, stdout, with_hits);
	perf_session__fprintf_dsos_buildid(session, stdout, with_hits);


	perf_session__delete(session);
	perf_session__delete(session);
	return err;
	return 0;
}
}


int cmd_buildid_list(int argc, const char **argv, const char *prefix __used)
int cmd_buildid_list(int argc, const char **argv, const char *prefix __used)
+5 −0
Original line number Original line Diff line number Diff line
@@ -249,6 +249,11 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
	     !params.show_lines))
	     !params.show_lines))
		usage_with_options(probe_usage, options);
		usage_with_options(probe_usage, options);


	/*
	 * Only consider the user's kernel image path if given.
	 */
	symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);

	if (params.list_events) {
	if (params.list_events) {
		if (params.mod_events) {
		if (params.mod_events) {
			pr_err("  Error: Don't use --list with --add/--del.\n");
			pr_err("  Error: Don't use --list with --add/--del.\n");
+6 −4
Original line number Original line Diff line number Diff line
@@ -265,15 +265,16 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
			  const char *name, bool is_kallsyms)
			  const char *name, bool is_kallsyms)
{
{
	const size_t size = PATH_MAX;
	const size_t size = PATH_MAX;
	char *filename = malloc(size),
	char *realname = realpath(name, NULL),
	     *filename = malloc(size),
	     *linkname = malloc(size), *targetname;
	     *linkname = malloc(size), *targetname;
	int len, err = -1;
	int len, err = -1;


	if (filename == NULL || linkname == NULL)
	if (realname == NULL || filename == NULL || linkname == NULL)
		goto out_free;
		goto out_free;


	len = snprintf(filename, size, "%s%s%s",
	len = snprintf(filename, size, "%s%s%s",
		       debugdir, is_kallsyms ? "/" : "", name);
		       debugdir, is_kallsyms ? "/" : "", realname);
	if (mkdir_p(filename, 0755))
	if (mkdir_p(filename, 0755))
		goto out_free;
		goto out_free;


@@ -283,7 +284,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
		if (is_kallsyms) {
		if (is_kallsyms) {
			 if (copyfile("/proc/kallsyms", filename))
			 if (copyfile("/proc/kallsyms", filename))
				goto out_free;
				goto out_free;
		} else if (link(name, filename) && copyfile(name, filename))
		} else if (link(realname, filename) && copyfile(name, filename))
			goto out_free;
			goto out_free;
	}
	}


@@ -300,6 +301,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
	if (symlink(targetname, linkname) == 0)
	if (symlink(targetname, linkname) == 0)
		err = 0;
		err = 0;
out_free:
out_free:
	free(realname);
	free(filename);
	free(filename);
	free(linkname);
	free(linkname);
	return err;
	return err;
+12 −3
Original line number Original line Diff line number Diff line
@@ -114,6 +114,8 @@ static struct symbol *__find_kernel_function_by_name(const char *name,
const char *kernel_get_module_path(const char *module)
const char *kernel_get_module_path(const char *module)
{
{
	struct dso *dso;
	struct dso *dso;
	struct map *map;
	const char *vmlinux_name;


	if (module) {
	if (module) {
		list_for_each_entry(dso, &machine.kernel_dsos, node) {
		list_for_each_entry(dso, &machine.kernel_dsos, node) {
@@ -123,10 +125,17 @@ const char *kernel_get_module_path(const char *module)
		}
		}
		pr_debug("Failed to find module %s.\n", module);
		pr_debug("Failed to find module %s.\n", module);
		return NULL;
		return NULL;
	}

	map = machine.vmlinux_maps[MAP__FUNCTION];
	dso = map->dso;

	vmlinux_name = symbol_conf.vmlinux_name;
	if (vmlinux_name) {
		if (dso__load_vmlinux(dso, map, vmlinux_name, NULL) <= 0)
			return NULL;
	} else {
	} else {
		dso = machine.vmlinux_maps[MAP__FUNCTION]->dso;
		if (dso__load_vmlinux_path(dso, map, NULL) <= 0) {
		if (dso__load_vmlinux_path(dso,
			 machine.vmlinux_maps[MAP__FUNCTION], NULL) < 0) {
			pr_debug("Failed to load kernel map.\n");
			pr_debug("Failed to load kernel map.\n");
			return NULL;
			return NULL;
		}
		}
Loading