Skip to contentSkip to conversation

perf symbol: Include elf.h header regardless LIBELF_SUPPORT

PATCH In review Namhyung Kim 3 participants 3 messages Dec 28, 2012 – Jan 25, 2013 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf symbol: Include elf.h header regardless LIBELF_SUPPORT

From: Namhyung Kim <[email protected]>

The elf.h header file is used for NO_LIBELF build too so it should be included anyway. Also remove duplicated include of the header file in symbol-*.c. This patch fixes following build error on NO_LIBELF build:

CC tests/hists_link.o
tests/hists_link.c: In function ‘setup_fake_machine’:
tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function) tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears in

Cc Jiri Olsa <[email protected]>
Cc David Ahern <[email protected]>
---
 tools/perf/util/symbol-elf.c     | 3 ---
 tools/perf/util/symbol-minimal.c | 1 -
 tools/perf/util/symbol.h         | 2 +-
 3 files changed, 1 insertion(+), 5 deletions(-)
tools/perf/util/symbol-elf.c +0 -3
index f63557b59c06..54efcb5659ac 100644
@@ -1,6 +1,3 @@
-#include <libelf.h>
-#include <gelf.h>
-#include <elf.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <errno.h>
tools/perf/util/symbol-minimal.c +0 -1
index 259f8f2ea9c9..a7390cde63bc 100644
@@ -1,6 +1,5 @@
 #include "symbol.h"
 
-#include <elf.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <string.h>
tools/perf/util/symbol.h +1 -1
index ec7b2405c377..d97377ac2f16 100644
@@ -16,8 +16,8 @@
 #ifdef LIBELF_SUPPORT
 #include <libelf.h>
 #include <gelf.h>
-#include <elf.h>
 #endif
+#include <elf.h>
 
 #include "dso.h"
 
Signature · 1 line
1.7.11.7
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Namhyung Kim

From: Namhyung Kim <[email protected]>

The elf.h header file is used for NO_LIBELF build too so it should be included anyway. Also remove duplicated include of the header file in symbol-*.c. This patch fixes following build error on NO_LIBELF build:

Quoted 8 lines

CC tests/hists_link.o
tests/hists_link.c: In function ‘setup_fake_machine’:
tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function) tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears in

Cc Jiri Olsa <[email protected]>
Cc David Ahern <[email protected]>
#2 lore raw

[tip:perf/core] perf symbols: Include elf.h header regardless LIBELF_SUPPORT

In reply to Namhyung Kim
Commit-ID:  eec185ab603fab3b7b5021e840cf4b282c4c7e6b
Gitweb:     http://git.kernel.org/tip/eec185ab603fab3b7b5021e840cf4b282c4c7e6b
Author:     Namhyung Kim <[email protected]>
AuthorDate: Fri, 28 Dec 2012 16:16:49 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 24 Jan 2013 16:40:18 -0300

perf symbols: Include elf.h header regardless LIBELF_SUPPORT

The elf.h header file is used for NO_LIBELF build too so it should be included anyway. Also remove duplicated include of the header file in symbol-*.c. This patch fixes following build error on NO_LIBELF build:

CC tests/hists_link.o
tests/hists_link.c: In function ‘setup_fake_machine’:
tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function) tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears in

---
 tools/perf/util/symbol-elf.c     | 3 ---
 tools/perf/util/symbol-minimal.c | 1 -
 tools/perf/util/symbol.h         | 2 +-
 3 files changed, 1 insertion(+), 5 deletions(-)
tools/perf/util/symbol-elf.c +0 -3
index f63557b..54efcb5 100644
@@ -1,6 +1,3 @@
-#include <libelf.h>
-#include <gelf.h>
-#include <elf.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <errno.h>
tools/perf/util/symbol-minimal.c +0 -1
index 259f8f2..a7390cd 100644
@@ -1,6 +1,5 @@
 #include "symbol.h"
 
-#include <elf.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <string.h>
tools/perf/util/symbol.h +1 -1
index ec7b240..d97377a 100644
@@ -16,8 +16,8 @@
 #ifdef LIBELF_SUPPORT
 #include <libelf.h>
 #include <gelf.h>
-#include <elf.h>
 #endif
+#include <elf.h>
 
 #include "dso.h"