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>
Subject: [PATCH 15/22] perf tools: Remove string.h, unistd.h and sys/stat.h from util.h
Date: Mon, 24 Apr 2017 16:54:32 -0300 [thread overview]
Message-ID: <20170424195439.29875-16-acme@kernel.org> (raw)
In-Reply-To: <20170424195439.29875-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Not needed in this header, added to the places that need FILE,
putchar(), access() and a few other prototypes.
Link: http://lkml.kernel.org/n/tip-xxtdsl6nsna82j7puwbdjqhs@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/subcmd/help.h | 1 +
tools/perf/arch/arm/util/cs-etm.c | 1 +
tools/perf/arch/arm64/util/dwarf-regs.c | 1 +
tools/perf/builtin-help.c | 4 ++++
tools/perf/builtin-mem.c | 3 +++
tools/perf/builtin-report.c | 3 +++
tools/perf/builtin-script.c | 3 +++
tools/perf/builtin-stat.c | 3 +++
tools/perf/builtin-version.c | 3 ++-
tools/perf/perf.c | 3 +++
tools/perf/tests/attr.c | 3 +++
tools/perf/tests/bpf.c | 2 ++
tools/perf/tests/parse-events.c | 3 +++
tools/perf/util/build-id.c | 2 ++
tools/perf/util/color.h | 2 ++
tools/perf/util/config.c | 3 +++
tools/perf/util/dso.c | 3 +++
tools/perf/util/event.c | 3 +++
| 3 +++
tools/perf/util/machine.c | 3 +++
tools/perf/util/pmu.c | 1 +
tools/perf/util/probe-file.c | 3 +++
tools/perf/util/strlist.c | 1 +
tools/perf/util/util.c | 1 +
tools/perf/util/util.h | 3 ---
25 files changed, 57 insertions(+), 4 deletions(-)
diff --git a/tools/lib/subcmd/help.h b/tools/lib/subcmd/help.h
index e145a020780c..9bd4223dc722 100644
--- a/tools/lib/subcmd/help.h
+++ b/tools/lib/subcmd/help.h
@@ -2,6 +2,7 @@
#define __SUBCMD_HELP_H
#include <sys/types.h>
+#include <stdio.h>
struct cmdnames {
size_t alloc;
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index dfea6b635525..29361d9b635a 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -33,6 +33,7 @@
#include "../../util/cs-etm.h"
#include <stdlib.h>
+#include <sys/stat.h>
#define ENABLE_SINK_MAX 128
#define CS_BUS_DEVICE_PATH "/bus/coresight/devices/"
diff --git a/tools/perf/arch/arm64/util/dwarf-regs.c b/tools/perf/arch/arm64/util/dwarf-regs.c
index f268720ff021..cd764a9fd098 100644
--- a/tools/perf/arch/arm64/util/dwarf-regs.c
+++ b/tools/perf/arch/arm64/util/dwarf-regs.c
@@ -10,6 +10,7 @@
#include <errno.h>
#include <stddef.h>
+#include <string.h>
#include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */
#include <linux/stringify.h>
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 7bde2f59dac2..492f8e14ab09 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -14,6 +14,10 @@
#include "util/debug.h"
#include <linux/kernel.h>
#include <errno.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
static struct man_viewer_list {
struct man_viewer_list *next;
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 1ebc67390898..2e5be1d63af6 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -1,4 +1,7 @@
#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3f89e0eaf0d4..22478ff2b706 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -46,6 +46,9 @@
#include <signal.h>
#include <linux/bitmap.h>
#include <linux/stringify.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
struct report {
struct perf_tool tool;
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index b093a3c21e40..d05aec491cff 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -37,6 +37,9 @@
#include <inttypes.h>
#include <signal.h>
#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "sane_ctype.h"
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index e3837febb4ff..eb3cc0b9a9e4 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -76,6 +76,9 @@
#include <inttypes.h>
#include <locale.h>
#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "sane_ctype.h"
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index b9a095b1db99..d25149456a2f 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -1,6 +1,7 @@
-#include "util/util.h"
#include "builtin.h"
#include "perf.h"
+#include <linux/compiler.h>
+#include <stdio.h>
int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused)
{
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 0b2cad0fb3f9..4cc6960f6226 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -24,6 +24,9 @@
#include <signal.h>
#include <stdlib.h>
#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <linux/kernel.h>
const char perf_usage_string[] =
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index c19e0da54337..0dd77494bb58 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -25,6 +25,9 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "../perf.h"
#include "util.h"
#include <subcmd/exec-cmd.h>
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index b78fbd611a7c..5876da126b58 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -1,6 +1,8 @@
#include <errno.h>
#include <stdio.h>
#include <sys/epoll.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <util/util.h>
#include <util/bpf-loader.h>
#include <util/evlist.h>
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 981d2bf9914f..7fad885491c5 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -7,6 +7,9 @@
#include "util.h"
#include <dirent.h>
#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <linux/kernel.h>
#include <linux/hw_breakpoint.h>
#include <api/fs/fs.h>
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 923ea290bb6e..687b5add4bde 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -10,6 +10,8 @@
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "build-id.h"
#include "event.h"
#include "symbol.h"
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h
index a93997f16dec..52122bcc3170 100644
--- a/tools/perf/util/color.h
+++ b/tools/perf/util/color.h
@@ -1,6 +1,8 @@
#ifndef __PERF_COLOR_H
#define __PERF_COLOR_H
+#include <stdio.h>
+
/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
#define COLOR_MAXLEN 24
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 07d87d2dbee7..8d724f0fa5a8 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -16,6 +16,9 @@
#include "util/hist.h" /* perf_hist_config */
#include "util/llvm-utils.h" /* perf_llvm_config */
#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "sane_ctype.h"
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 3339ab7cabc5..a96a99d2369f 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -2,6 +2,9 @@
#include <linux/kernel.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <errno.h>
#include "compress.h"
#include "path.h"
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index cf457ef534da..2e829ac0f615 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -3,6 +3,9 @@
#include <inttypes.h>
#include <linux/kernel.h>
#include <linux/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
#include <api/fs/fs.h>
#include "event.h"
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 915bc4f39482..948b2c5efb65 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -11,7 +11,10 @@
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/bitops.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/utsname.h>
+#include <unistd.h>
#include "evlist.h"
#include "evsel.h"
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 988e84ce6f88..7a47f52ccfcc 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -14,6 +14,9 @@
#include "thread.h"
#include "vdso.h"
#include <stdbool.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "unwind.h"
#include "linux/hash.h"
#include "asm/bug.h"
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index bca1844594d0..ac16a9db1fb5 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -2,6 +2,7 @@
#include <linux/compiler.h>
#include <sys/types.h>
#include <errno.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 685653f2bc32..d679389e627c 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -15,7 +15,10 @@
*
*/
#include <errno.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/uio.h>
+#include <unistd.h>
#include "util.h"
#include "event.h"
#include "strlist.h"
diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
index 0d3dfcb919b4..9de5434bb49e 100644
--- a/tools/perf/util/strlist.c
+++ b/tools/perf/util/strlist.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
static
struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 131d21a659fb..6450c75a6f5b 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -3,6 +3,7 @@
#include "debug.h"
#include <api/fs/fs.h>
#include <sys/mman.h>
+#include <sys/stat.h>
#include <sys/utsname.h>
#include <dirent.h>
#include <inttypes.h>
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index b8dfbe1d9670..bd883f25b76e 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -7,9 +7,6 @@
#define _DEFAULT_SOURCE 1
#define HAS_BOOL
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stddef.h>
--
2.9.3
next prev parent reply other threads:[~2017-04-24 19:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 19:54 [GIT PULL 00/22] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 01/22] perf unwind: Provide only forward declarations for pointer types Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 02/22] perf tools: Add signal.h to places using its definitions Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 03/22] perf tools: Move units conversion/formatting routines to separate object Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 04/22] perf tools: Move timestamp routines from util.h to time-utils.h Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 05/22] perf kvm: Make function only used by 'perf kvm' static Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 06/22] perf debug: Move dump_stack() and sighandler_dump_stack() to debug.h Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 07/22] perf mem: Fix display of data source snoop indication Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 08/22] perf tools: Add compress.h for the *_decompress_to_file() headers Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 09/22] perf callchain: Move callchain specific routines from util.[ch] Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 10/22] perf tools: Include sys/param.h where needed Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 11/22] perf tools: Remove a few more needless includes from util.h Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 12/22] perf tools: Remove sys/ioctl.h " Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 13/22] perf tools: Remove string.h " Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 14/22] perf tools: Remove stale prototypes from builtin.h Arnaldo Carvalho de Melo
2017-04-24 19:54 ` Arnaldo Carvalho de Melo [this message]
2017-04-24 19:54 ` [PATCH 16/22] perf tools: Remove poll.h and wait.h from util.h Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 17/22] perf tools: Add the right header to obtain PERF_ALIGN() Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 18/22] perf tools: Use just forward declarations for struct thread where possible Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 19/22] tools: Update asm-generic/mman-common.h copy from the kernel Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 20/22] tools arch: Sync arch/x86/lib/memcpy_64.S with " Arnaldo Carvalho de Melo
2017-04-24 20:36 ` Luck, Tony
2017-04-25 2:59 ` Joe Perches
2017-04-25 16:18 ` Luck, Tony
2017-04-25 16:28 ` Joe Perches
2017-04-25 14:13 ` Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 21/22] tools arch x86: Sync cpufeatures.h Arnaldo Carvalho de Melo
2017-04-24 19:54 ` [PATCH 22/22] perf tools: Fix the code to strip command name Arnaldo Carvalho de Melo
2017-04-24 20:08 ` David Ahern
2017-04-24 20:40 ` [GIT PULL 00/22] perf/core improvements and fixes Ingo Molnar
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=20170424195439.29875-16-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.