perf tools: Remove string.h, unistd.h and sys/stat.h from util.h

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>
This commit is contained in:
Arnaldo Carvalho de Melo 2017-04-19 20:57:47 -03:00
parent a3b70b3bb3
commit 7a8ef4c4b5
25 changed files with 57 additions and 4 deletions

View File

@ -2,6 +2,7 @@
#define __SUBCMD_HELP_H #define __SUBCMD_HELP_H
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h>
struct cmdnames { struct cmdnames {
size_t alloc; size_t alloc;

View File

@ -33,6 +33,7 @@
#include "../../util/cs-etm.h" #include "../../util/cs-etm.h"
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h>
#define ENABLE_SINK_MAX 128 #define ENABLE_SINK_MAX 128
#define CS_BUS_DEVICE_PATH "/bus/coresight/devices/" #define CS_BUS_DEVICE_PATH "/bus/coresight/devices/"

View File

@ -10,6 +10,7 @@
#include <errno.h> #include <errno.h>
#include <stddef.h> #include <stddef.h>
#include <string.h>
#include <dwarf-regs.h> #include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */ #include <linux/ptrace.h> /* for struct user_pt_regs */
#include <linux/stringify.h> #include <linux/stringify.h>

View File

@ -14,6 +14,10 @@
#include "util/debug.h" #include "util/debug.h"
#include <linux/kernel.h> #include <linux/kernel.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
static struct man_viewer_list { static struct man_viewer_list {
struct man_viewer_list *next; struct man_viewer_list *next;

View File

@ -1,4 +1,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "builtin.h" #include "builtin.h"
#include "perf.h" #include "perf.h"

View File

@ -46,6 +46,9 @@
#include <signal.h> #include <signal.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
struct report { struct report {
struct perf_tool tool; struct perf_tool tool;

View File

@ -37,6 +37,9 @@
#include <inttypes.h> #include <inttypes.h>
#include <signal.h> #include <signal.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sane_ctype.h" #include "sane_ctype.h"

View File

@ -76,6 +76,9 @@
#include <inttypes.h> #include <inttypes.h>
#include <locale.h> #include <locale.h>
#include <math.h> #include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sane_ctype.h" #include "sane_ctype.h"

View File

@ -1,6 +1,7 @@
#include "util/util.h"
#include "builtin.h" #include "builtin.h"
#include "perf.h" #include "perf.h"
#include <linux/compiler.h>
#include <stdio.h>
int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused) int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused)
{ {

View File

@ -24,6 +24,9 @@
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/kernel.h> #include <linux/kernel.h>
const char perf_usage_string[] = const char perf_usage_string[] =

View File

@ -25,6 +25,9 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "../perf.h" #include "../perf.h"
#include "util.h" #include "util.h"
#include <subcmd/exec-cmd.h> #include <subcmd/exec-cmd.h>

View File

@ -1,6 +1,8 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <util/util.h> #include <util/util.h>
#include <util/bpf-loader.h> #include <util/bpf-loader.h>
#include <util/evlist.h> #include <util/evlist.h>

View File

@ -7,6 +7,9 @@
#include "util.h" #include "util.h"
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/hw_breakpoint.h> #include <linux/hw_breakpoint.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>

View File

@ -10,6 +10,8 @@
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "build-id.h" #include "build-id.h"
#include "event.h" #include "event.h"
#include "symbol.h" #include "symbol.h"

View File

@ -1,6 +1,8 @@
#ifndef __PERF_COLOR_H #ifndef __PERF_COLOR_H
#define __PERF_COLOR_H #define __PERF_COLOR_H
#include <stdio.h>
/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */ /* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
#define COLOR_MAXLEN 24 #define COLOR_MAXLEN 24

View File

@ -16,6 +16,9 @@
#include "util/hist.h" /* perf_hist_config */ #include "util/hist.h" /* perf_hist_config */
#include "util/llvm-utils.h" /* perf_llvm_config */ #include "util/llvm-utils.h" /* perf_llvm_config */
#include "config.h" #include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sane_ctype.h" #include "sane_ctype.h"

View File

@ -2,6 +2,9 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
#include "compress.h" #include "compress.h"
#include "path.h" #include "path.h"

View File

@ -3,6 +3,9 @@
#include <inttypes.h> #include <inttypes.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.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 <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include "event.h" #include "event.h"

View File

@ -11,7 +11,10 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <unistd.h>
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"

View File

@ -14,6 +14,9 @@
#include "thread.h" #include "thread.h"
#include "vdso.h" #include "vdso.h"
#include <stdbool.h> #include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "unwind.h" #include "unwind.h"
#include "linux/hash.h" #include "linux/hash.h"
#include "asm/bug.h" #include "asm/bug.h"

View File

@ -2,6 +2,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>

View File

@ -15,7 +15,10 @@
* *
*/ */
#include <errno.h> #include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <unistd.h>
#include "util.h" #include "util.h"
#include "event.h" #include "event.h"
#include "strlist.h" #include "strlist.h"

View File

@ -10,6 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h>
static static
struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry) struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry)

View File

@ -3,6 +3,7 @@
#include "debug.h" #include "debug.h"
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <dirent.h> #include <dirent.h>
#include <inttypes.h> #include <inttypes.h>

View File

@ -7,9 +7,6 @@
#define _DEFAULT_SOURCE 1 #define _DEFAULT_SOURCE 1
#define HAS_BOOL #define HAS_BOOL
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>