lkml.org 
[lkml]   [2013]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [tip:perf/core] perf symbols: Add support for reading from /proc/ kcore

* 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


\
 
 \ /
  Last update: 2013-09-12 15:41    [W:0.066 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site