linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 26/28] perf tools: Remove include dirent.h from util.h
Date: Wed, 19 Apr 2017 13:17:21 -0300	[thread overview]
Message-ID: <20170419161723.21011-27-acme@kernel.org> (raw)
In-Reply-To: <20170419161723.21011-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The files using the dirent.h routines should instead include it,
reducing the includes hell that lead to longer build times.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-42g2f4z6nfg7mdb2ae97n7tj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c     | 1 +
 tools/perf/tests/dso-data.c     | 1 +
 tools/perf/tests/parse-events.c | 1 +
 tools/perf/ui/browsers/hists.c  | 1 +
 tools/perf/util/build-id.c      | 1 +
 tools/perf/util/cpumap.c        | 1 +
 tools/perf/util/event.c         | 1 +
 tools/perf/util/machine.c       | 1 +
 tools/perf/util/parse-events.c  | 1 +
 tools/perf/util/util.c          | 1 +
 tools/perf/util/util.h          | 2 +-
 11 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 853651a0f720..fe1dcd4f2c6d 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -32,6 +32,7 @@
 #include "asm/bug.h"
 #include "util/mem-events.h"
 #include "util/dump-insn.h"
+#include <dirent.h>
 #include <errno.h>
 #include <inttypes.h>
 
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index 46ea2e061b86..8f08df5861cb 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -1,3 +1,4 @@
+#include <dirent.h>
 #include <stdlib.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index f5b77f5c3192..981d2bf9914f 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -5,6 +5,7 @@
 #include "tests.h"
 #include "debug.h"
 #include "util.h"
+#include <dirent.h>
 #include <errno.h>
 #include <linux/kernel.h>
 #include <linux/hw_breakpoint.h>
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index a271b48ad0d3..f0b5b2b0e521 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1,3 +1,4 @@
+#include <dirent.h>
 #include <errno.h>
 #include <inttypes.h>
 #include <stdio.h>
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 9815a3b6667a..923ea290bb6e 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -7,6 +7,7 @@
  * Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <acme@redhat.com>
  */
 #include "util.h"
+#include <dirent.h>
 #include <errno.h>
 #include <stdio.h>
 #include "build-id.h"
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
index 9d9ecb2430cc..37b3bb79ee08 100644
--- a/tools/perf/util/cpumap.c
+++ b/tools/perf/util/cpumap.c
@@ -3,6 +3,7 @@
 #include "../perf.h"
 #include "cpumap.h"
 #include <assert.h>
+#include <dirent.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <linux/bitmap.h>
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 1fc1217a0c2c..cf457ef534da 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1,3 +1,4 @@
+#include <dirent.h>
 #include <errno.h>
 #include <inttypes.h>
 #include <linux/kernel.h>
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index cdbfe3e32e5a..46411742d03c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1,3 +1,4 @@
+#include <dirent.h>
 #include <errno.h>
 #include <inttypes.h>
 #include "callchain.h"
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index f3dd1aa59a25..7d84338b19ee 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1,5 +1,6 @@
 #include <linux/hw_breakpoint.h>
 #include <linux/err.h>
+#include <dirent.h>
 #include <errno.h>
 #include "term.h"
 #include "../perf.h"
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 64877c6d09b2..b9716bc6e8fd 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -7,6 +7,7 @@
 #ifdef HAVE_BACKTRACE_SUPPORT
 #include <execinfo.h>
 #endif
+#include <dirent.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index d4910e490f20..c0574e2763b7 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -20,7 +20,6 @@
 #include <limits.h>
 #include <sys/param.h>
 #include <sys/types.h>
-#include <dirent.h>
 #include <sys/time.h>
 #include <time.h>
 #include <signal.h>
@@ -82,6 +81,7 @@ static inline void *zalloc(size_t size)
 
 #define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
 
+struct dirent;
 struct strlist;
 
 int mkdir_p(char *path, mode_t mode);
-- 
2.9.3

  parent reply	other threads:[~2017-04-19 16:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 16:16 [GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 01/28] perf unwind arm64: Add missing errno.h header Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 02/28] perf tools: Remove FLEX_ARRAY definition Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 03/28] tools include: Introduce linux/bug.h, from the kernel sources Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 04/28] tools include: Adopt __same_type() and __must_be_array() from the kernel Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 05/28] tools include: Move ARRAY_SIZE() to linux/kernel.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 06/28] perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 07/28] objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 08/28] tools include: Drop ARRAY_SIZE() definition from linux/hashtable.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 09/28] perf tools: Remove unused macros from util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 10/28] perf tools: Including missing inttypes.h header Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 11/28] perf tools: Remove PRI[xu] macros from perf.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 12/28] perf tools: Replace STR() calls with __stringify() Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 13/28] perf tools: Ditch unused PATH_SEP, STRIP_EXTENSION Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 14/28] perf tools: Move sane ctype stuff from util.h to sane_ctype.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 15/28] tools include: Include missing headers for fls() and types in linux/log2.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 16/28] perf tools: Move print_binary definitions to separate files Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 17/28] perf tools: Move srcline definitions to separate header Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 18/28] perf tools: Move extra string util functions to util/string2.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 19/28] perf tools: Include errno.h where needed Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 20/28] perf str{filter,list}: Disentangle headers Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 21/28] perf tools: Don't include terminal handling headers in util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 22/28] perf tools: Move path related functions to util/path.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 23/28] perf tools: No need to include bitops.h in util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 24/28] perf tools: Use api/fs/tracing_path.h where needed Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 25/28] perf tools: Remove misplaced __maybe_unused in some functions Arnaldo Carvalho de Melo
2017-04-19 16:17 ` Arnaldo Carvalho de Melo [this message]
2017-04-19 16:17 ` [PATCH 27/28] perf tools: Remove regex.h and fnmatch.h from util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 28/28] perf tools: Ditch unused strchrnul() reimplementation Arnaldo Carvalho de Melo
2017-04-20  8:10 ` [GIT PULL 00/28] perf/core fixes and cleanups Ingo Molnar
2017-04-20 11:24   ` Arnaldo Carvalho de Melo
2017-04-20 11:29     ` Ingo Molnar
2017-04-20 17:10       ` Arnaldo Carvalho de Melo
2017-04-20 18:29         ` Arnaldo Carvalho de Melo
2017-04-20 18:51           ` Arnaldo Carvalho de Melo

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=20170419161723.21011-27-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).