All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: hpa@zytor.com, paulus@samba.org, eranian@google.com,
	linux-kernel@vger.kernel.org, acme@redhat.com, efault@gmx.de,
	peterz@infradead.org, namhyung@gmail.com, jolsa@redhat.com,
	fweisbec@gmail.com, dsahern@gmail.com, adrian.hunter@intel.com,
	tglx@linutronix.de
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/core] perf symbols: Add support for reading from /proc/ kcore
Date: Thu, 12 Sep 2013 15:13:24 +0200	[thread overview]
Message-ID: <20130912131324.GB23826@gmail.com> (raw)
In-Reply-To: <tip-8e0cf965f95edd41df11cca50b92b4cb6ea8d80a@git.kernel.org>


* tip-bot for Adrian Hunter <tipbot@zytor.com> wrote:

> Commit-ID:  8e0cf965f95edd41df11cca50b92b4cb6ea8d80a
> Gitweb:     http://git.kernel.org/tip/8e0cf965f95edd41df11cca50b92b4cb6ea8d80a
> Author:     Adrian Hunter <adrian.hunter@intel.com>
> AuthorDate: Wed, 7 Aug 2013 14:38:51 +0300
> Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
> CommitDate: Wed, 7 Aug 2013 17:35:33 -0300
> 
> perf symbols: Add support for reading from /proc/kcore
> 
> In the absence of vmlinux, perf tools uses kallsyms for symbols.  If the
> user has access, now also map to /proc/kcore.

> +static int elf_read_maps(Elf *elf, bool exe, mapfn_t mapfn, void *data)
> +{
> +	GElf_Phdr phdr;
> +	size_t i, phdrnum;
> +	int err;
> +	u64 sz;
> +
> +	if (elf_getphdrnum(elf, &phdrnum))
> +		return -1;

This doesn't build on old distros with old libelf.

The wrapper below builds fine, but I've not tested it otherwise. Also, the 
feature detection bits in config/* filling in HAVE_ELF_GETPHDRNUM are 
missing.

Thanks,

	Ingo

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index a7b9ab5..5fb9d61 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -8,6 +8,13 @@
 #include "symbol.h"
 #include "debug.h"
 
+#ifndef HAVE_ELF_GETPHDRNUM
+static int elf_getphdrnum (Elf *__elf __maybe_unused, size_t *__dst __maybe_unused)
+{
+	return 1;
+}
+#endif
+
 #ifndef NT_GNU_BUILD_ID
 #define NT_GNU_BUILD_ID 3
 #endif


  reply	other threads:[~2013-09-12 13:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 11:38 [PATCH V4 00/13] perf tools: add support for reading object code Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 01/13] perf tools: add test " Adrian Hunter
2013-08-12 10:20   ` [tip:perf/core] perf tests: Add " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 02/13] perf tools: load kernel maps before using Adrian Hunter
2013-08-12 10:20   ` [tip:perf/core] perf symbols: Load " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 03/13] perf tools: make it possible to read object code from vmlinux Adrian Hunter
2013-08-12 10:21   ` [tip:perf/core] perf tools: Make " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 04/13] perf tools: adjust the vmlinux symtab matches kallsyms test Adrian Hunter
2013-08-12 10:21   ` [tip:perf/core] perf tests: Adjust " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 05/13] perf tools: avoid SyS kernel syscall aliases Adrian Hunter
2013-08-12 10:20   ` [tip:perf/core] perf symbols: " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 06/13] perf tools: make it possible to read object code from kernel modules Adrian Hunter
2013-08-12 10:21   ` [tip:perf/core] perf tools: Make " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 07/13] perf tools: add support for reading from /proc/kcore Adrian Hunter
2013-08-12 10:21   ` [tip:perf/core] perf symbols: Add support for reading from /proc/ kcore tip-bot for Adrian Hunter
2013-09-12 13:13     ` Ingo Molnar [this message]
2013-09-12 13:16     ` [PATCH] Fix old GCC build error in perf/util/trace-event-parse.c:parse_proc_kallsyms() Ingo Molnar
2013-09-20  9:56       ` [tip:perf/urgent] perf tools: Fix old GCC build error in trace-event-parse.c:parse_proc_kallsyms() tip-bot for Ingo Molnar
2013-08-07 11:38 ` [PATCH V4 08/13] perf tools: adjust the vmlinux symtab matches kallsyms test again Adrian Hunter
2013-08-12 10:21   ` [tip:perf/core] perf tests: Adjust " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 09/13] perf tools: add kcore to the object code reading test Adrian Hunter
2013-08-12 10:21   ` [tip:perf/core] perf tests: Add " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 10/13] perf tools: allow annotation using /proc/kcore Adrian Hunter
2013-08-12 10:22   ` [tip:perf/core] perf annotate: Allow disassembly using /proc/ kcore tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 11/13] perf tools: put dso name in symbol annotation title Adrian Hunter
2013-08-12 10:22   ` [tip:perf/core] perf annotate: Put " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 12/13] perf tools: remove nop at end of annotation Adrian Hunter
2013-08-12 10:22   ` [tip:perf/core] perf annotate: Remove " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 13/13] perf tools: add annotation call target name if it is missing Adrian Hunter
2013-08-12 10:22   ` [tip:perf/core] perf annotate: Add " tip-bot for Adrian Hunter

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=20130912131324.GB23826@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.