aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/symbol-elf.c21
-rw-r--r--tools/perf/util/symbol.h21
2 files changed, 21 insertions, 21 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index efc7eb6b8f0f..06fcd1bf98b6 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -11,6 +11,27 @@
11#include <symbol/kallsyms.h> 11#include <symbol/kallsyms.h>
12#include "debug.h" 12#include "debug.h"
13 13
14#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
15extern char *cplus_demangle(const char *, int);
16
17static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
18{
19 return cplus_demangle(c, i);
20}
21#else
22#ifdef NO_DEMANGLE
23static inline char *bfd_demangle(void __maybe_unused *v,
24 const char __maybe_unused *c,
25 int __maybe_unused i)
26{
27 return NULL;
28}
29#else
30#define PACKAGE 'perf'
31#include <bfd.h>
32#endif
33#endif
34
14#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT 35#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
15static int elf_getphdrnum(Elf *elf, size_t *dst) 36static int elf_getphdrnum(Elf *elf, size_t *dst)
16{ 37{
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ded3ca7266de..e0b297c50f9d 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -23,27 +23,6 @@
23 23
24#include "dso.h" 24#include "dso.h"
25 25
26#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
27extern char *cplus_demangle(const char *, int);
28
29static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
30{
31 return cplus_demangle(c, i);
32}
33#else
34#ifdef NO_DEMANGLE
35static inline char *bfd_demangle(void __maybe_unused *v,
36 const char __maybe_unused *c,
37 int __maybe_unused i)
38{
39 return NULL;
40}
41#else
42#define PACKAGE 'perf'
43#include <bfd.h>
44#endif
45#endif
46
47/* 26/*
48 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP; 27 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
49 * for newer versions we can use mmap to reduce memory usage: 28 * for newer versions we can use mmap to reduce memory usage: