Skip to contentSkip to conversation

perf: remove unneeded include of network header files

PATCH In review David Ahern 2 participants 6 messages Aug 29, 2012 – Sep 7, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: remove unneeded include of network header files

perf does not have networking related functionality, and the inclusion of these headers is one of the causes of compile failures for Android:
https://lkml.org/lkml/2012/8/23/316
https://lkml.org/lkml/2012/8/28/293

So, remove them.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/util/util.h |    5 -----
 1 file changed, 5 deletions(-)
tools/perf/util/util.h +0 -5
index 00a93a9..67a3713 100644
@@ -69,11 +69,6 @@
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/select.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
 #include <inttypes.h>
 #include "../../../include/linux/magic.h"
 #include "types.h"
Signature · 1 line
1.7.10.1
#1 lore raw

Em Wed, Aug 29, 2012 at 09:55:32AM -0600, David Ahern escreveu:

Quoted 11 lines

perf does not have networking related functionality, and the inclusion of these headers is one of the causes of compile failures for Android:
https://lkml.org/lkml/2012/8/23/316
https://lkml.org/lkml/2012/8/28/293

So, remove them.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>

CC /home/acme/git/build/perf/util/scripting-engines/trace-event-python.o
In file included from /usr/lib64/perl5/CORE/perl.h:1239,
from util/scripting-engines/trace-event-perl.c:36:
/usr/include/netdb.h:591: error: expected identifier or ‘(’ before ‘[’ token
make: *** [/home/acme/git/build/perf/util/scripting-engines/trace-event-perl.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/git/linux/tools/perf'
[acme@sandy linux]$

- Arnaldo

#2 lore raw
Quoted 13 lines · Arnaldo Carvalho de Melo

Em Wed, Aug 29, 2012 at 09:55:32AM -0600, David Ahern escreveu:

Quoted 11 lines

perf does not have networking related functionality, and the inclusion of these headers is one of the causes of compile failures for Android:

   https://lkml.org/lkml/2012/8/23/316
   https://lkml.org/lkml/2012/8/28/293

So, remove them.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Quoted 7 lines

CC /home/acme/git/build/perf/util/scripting-engines/trace-event-python.o
In file included from /usr/lib64/perl5/CORE/perl.h:1239,
from util/scripting-engines/trace-event-perl.c:36:
/usr/include/netdb.h:591: error: expected identifier or ‘(’ before ‘[’ token
make: *** [/home/acme/git/build/perf/util/scripting-engines/trace-event-perl.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/git/linux/tools/perf'

grr... removed the perl package testing the kconfig integration. forgot to reinstall. Will update.

#3 lore raw

Em Wed, Sep 05, 2012 at 03:18:03PM -0600, David Ahern escreveu:

Quoted 22 lines · Arnaldo Carvalho de Melo
Quoted 13 lines

Em Wed, Aug 29, 2012 at 09:55:32AM -0600, David Ahern escreveu:

Quoted 11 lines

perf does not have networking related functionality, and the inclusion of these headers is one of the causes of compile failures for Android:
https://lkml.org/lkml/2012/8/23/316
https://lkml.org/lkml/2012/8/28/293

So, remove them.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Quoted 7 lines

CC /home/acme/git/build/perf/util/scripting-engines/trace-event-python.o
In file included from /usr/lib64/perl5/CORE/perl.h:1239,
from util/scripting-engines/trace-event-perl.c:36:
/usr/include/netdb.h:591: error: expected identifier or ‘(’ before ‘[’ token
make: *** [/home/acme/git/build/perf/util/scripting-engines/trace-event-perl.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/git/linux/tools/perf'

Quoted 3 lines

grr... removed the perl package testing the kconfig integration. forgot to reinstall. Will update.

I fixed it already, nevermind, it was just a matter of reordering includes, think how fragil that is, but it works now.

- Arnaldo

#4 lore raw
Quoted 3 lines · Arnaldo Carvalho de Melo

I fixed it already, nevermind, it was just a matter of reordering includes, think how fragil that is, but it works now.

tried that route too. I could not figure out the magic ordering, so punted on v2 of the patch leaving netdb.h in. Glad to see you figured out an ordering that works.

David

#5 lore raw

[tip:perf/core] perf tools: remove unneeded include of network header files

In reply to David Ahern
Commit-ID:  12046099160e65cddb639f8b3dda2bd0701c09d6
Gitweb:     http://git.kernel.org/tip/12046099160e65cddb639f8b3dda2bd0701c09d6
Author:     David Ahern <[email protected]>
AuthorDate: Wed, 29 Aug 2012 09:55:32 -0600
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 5 Sep 2012 17:45:12 -0300

perf tools: remove unneeded include of network header files

perf does not have networking related functionality, and the inclusion of these headers is one of the causes of compile failures for Android:

https://lkml.org/lkml/2012/8/23/316
https://lkml.org/lkml/2012/8/28/293

So, remove them.

Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
[ committer note: fix trace-event-perl.c compile failure by reordering includes ]
---
 .../perf/util/scripting-engines/trace-event-perl.c |    8 ++++----
 tools/perf/util/util.h                             |    5 -----
 2 files changed, 4 insertions(+), 9 deletions(-)
tools/perf/util/scripting-engines/trace-event-perl.c +4 -4
index d280010..94e6736 100644
@@ -25,16 +25,16 @@
 #include <ctype.h>
 #include <errno.h>
 
-#include "../../perf.h"
 #include "../util.h"
+#include <EXTERN.h>
+#include <perl.h>
+
+#include "../../perf.h"
 #include "../thread.h"
 #include "../event.h"
 #include "../trace-event.h"
 #include "../evsel.h"
 
-#include <EXTERN.h>
-#include <perl.h>
-
 void boot_Perf__Trace__Context(pTHX_ CV *cv);
 void boot_DynaLoader(pTHX_ CV *cv);
 typedef PerlInterpreter * INTERP;
tools/perf/util/util.h +0 -5
index 00a93a9..67a3713 100644
@@ -69,11 +69,6 @@
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/select.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
 #include <inttypes.h>
 #include "../../../include/linux/magic.h"
 #include "types.h"