perf tools: Include errno.h where needed

Removing it from util.h, part of an effort to disentangle the includes
hell, that makes changes to util.h or something included by it to cause
a complete rebuild of the tools.

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-ztrjy52q1rqcchuy3rubfgt2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2017-04-18 10:46:11 -03:00
parent a067558e2f
commit a43783aeec
95 changed files with 96 additions and 2 deletions

View file

@ -8,6 +8,7 @@
* published by the Free Software Foundation.
*/
#include <errno.h>
#include <stddef.h>
#include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include "util/kvm-stat.h"
#include "util/parse-events.h"
#include "util/debug.h"

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <string.h>
#include <regex.h>

View file

@ -9,6 +9,7 @@
* as published by the Free Software Foundation.
*/
#include <errno.h>
#include "../../util/kvm-stat.h"
#include <asm/sie.h>

View file

@ -7,6 +7,7 @@
#include "arch-tests.h"
#include <sys/mman.h>
#include <errno.h>
#include <string.h>
static pid_t spawn(void)

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>

View file

@ -13,6 +13,7 @@
*
*/
#include <errno.h>
#include <stdbool.h>
#include "../../util/header.h"

View file

@ -13,6 +13,7 @@
*
*/
#include <errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/bitops.h>

View file

@ -13,6 +13,7 @@
*
*/
#include <errno.h>
#include <stdbool.h>
#include <linux/kernel.h>
#include <linux/types.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include "../../util/kvm-stat.h"
#include <asm/svm.h>
#include <asm/vmx.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <string.h>
#include <regex.h>

View file

@ -33,6 +33,7 @@
#include "util/block-range.h"
#include <dlfcn.h>
#include <errno.h>
#include <linux/bitmap.h>
struct perf_annotate {

View file

@ -10,6 +10,7 @@
#include <sys/time.h>
#include <time.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include "builtin.h"
#include "perf.h"

View file

@ -16,6 +16,7 @@
#include "util/session.h"
#include "util/symbol.h"
#include "util/data.h"
#include <errno.h>
static int sysfs__fprintf_build_id(FILE *fp)
{

View file

@ -9,6 +9,7 @@
* Dick Fowles <fowles@inreach.com>
* Joe Mario <jmario@redhat.com>
*/
#include <errno.h>
#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/kernel.h>

View file

@ -19,6 +19,7 @@
#include "util/data.h"
#include "util/config.h"
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <math.h>

View file

@ -9,6 +9,7 @@
#include "builtin.h"
#include "perf.h"
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>

View file

@ -13,6 +13,7 @@
#include <subcmd/help.h>
#include "util/debug.h"
#include <linux/kernel.h>
#include <errno.h>
static struct man_viewer_list {
struct man_viewer_list *next;

View file

@ -22,6 +22,7 @@
#include <subcmd/parse-options.h>
#include <linux/list.h>
#include <errno.h>
struct perf_inject {
struct perf_tool tool;

View file

@ -23,6 +23,7 @@
#include <linux/kernel.h>
#include <linux/rbtree.h>
#include <linux/string.h>
#include <errno.h>
#include <inttypes.h>
#include <locale.h>
#include <regex.h>

View file

@ -26,6 +26,7 @@
#include <linux/kernel.h>
#include <linux/time64.h>
#include <errno.h>
#include <inttypes.h>
#include <termios.h>
#include <semaphore.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include "builtin.h"
#include "perf.h"

View file

@ -40,6 +40,7 @@
#include "util/perf-hooks.h"
#include "asm/bug.h"
#include <errno.h>
#include <inttypes.h>
#include <unistd.h>
#include <sched.h>

View file

@ -40,6 +40,7 @@
#include "util/auxtrace.h"
#include <dlfcn.h>
#include <errno.h>
#include <inttypes.h>
#include <linux/bitmap.h>
#include <linux/stringify.h>

View file

@ -28,6 +28,7 @@
#include <sys/resource.h>
#include <inttypes.h>
#include <errno.h>
#include <semaphore.h>
#include <pthread.h>
#include <math.h>

View file

@ -32,6 +32,7 @@
#include "asm/bug.h"
#include "util/mem-events.h"
#include "util/dump-insn.h"
#include <errno.h>
#include <inttypes.h>
#include "sane_ctype.h"

View file

@ -69,6 +69,7 @@
#include <linux/time64.h>
#include <api/fs/fs.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/prctl.h>
#include <inttypes.h>

View file

@ -12,6 +12,7 @@
* of the License.
*/
#include <errno.h>
#include <inttypes.h>
#include <traceevent/event-parse.h>

View file

@ -41,6 +41,7 @@
#include "syscalltbl.h"
#include "rb_resort.h"
#include <errno.h>
#include <inttypes.h>
#include <libaudit.h> /* FIXME: Still needed for audit_errno_to_name */
#include <stdlib.h>

View file

@ -19,6 +19,7 @@
#include "util/debug.h"
#include <api/fs/fs.h>
#include <api/fs/tracing_path.h>
#include <errno.h>
#include <pthread.h>
#include <stdlib.h>
#include <time.h>

View file

@ -18,6 +18,7 @@
* permissions. All the event text files are stored there.
*/
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>

View file

@ -8,6 +8,7 @@
#include <sys/prctl.h>
#include "tests.h"
#include "debug.h"
#include <errno.h>
#define NR_ITERS 111

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <stdio.h>
#include <sys/epoll.h>
#include <util/util.h>

View file

@ -3,6 +3,7 @@
*
* Builtin regression testing command: ever growing number of sanity tests
*/
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include "builtin.h"

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <inttypes.h>

View file

@ -1,4 +1,5 @@
#include <linux/compiler.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
#include "tests.h"

View file

@ -3,6 +3,7 @@
#include "parse-events.h"
#include "tests.h"
#include "debug.h"
#include <errno.h>
#include <linux/kernel.h>
static int perf_evsel__roundtrip_cache_name_test(void)

View file

@ -9,6 +9,7 @@
#include "thread.h"
#include "parse-events.h"
#include "hists_common.h"
#include <errno.h>
#include <linux/kernel.h>
struct sample {

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
/* For the CLR_() macros */
#include <pthread.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
/* For the CPU_* macros */
#include <pthread.h>

View file

@ -5,6 +5,7 @@
#include "thread_map.h"
#include "tests.h"
#include "debug.h"
#include <errno.h>
#ifndef O_DIRECTORY
#define O_DIRECTORY 00200000

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <api/fs/tracing_path.h>
#include <linux/err.h>

View file

@ -5,6 +5,7 @@
#include "tests.h"
#include "debug.h"
#include "util.h"
#include <errno.h>
#include <linux/kernel.h>
#include <linux/hw_breakpoint.h>
#include <api/fs/fs.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
/* For the CLR_() macros */
#include <pthread.h>

View file

@ -2,6 +2,7 @@
#include "pmu.h"
#include "util.h"
#include "tests.h"
#include <errno.h>
#include <linux/kernel.h>
/* Simulated format definitions. */

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <stdio.h>
#include <sys/epoll.h>
#include <util/util.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <unistd.h>
#include <stdlib.h>

View file

@ -1,5 +1,6 @@
#include <sys/time.h>
#include <sys/prctl.h>
#include <errno.h>
#include <time.h>
#include <stdlib.h>

View file

@ -4,6 +4,7 @@
#include "cpumap.h"
#include "tests.h"
#include <errno.h>
#include <signal.h>
static int exited;

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -7,6 +7,7 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
#include <errno.h>
#include <inttypes.h>
#include "util.h"
#include "ui/ui.h"

View file

@ -17,6 +17,7 @@
#define __PERF_AUXTRACE_H
#include <sys/types.h>
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
#include <linux/list.h>

View file

@ -11,6 +11,7 @@
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <errno.h>
#include "perf.h"
#include "debug.h"
#include "bpf-loader.h"

View file

@ -85,6 +85,8 @@ int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err,
char *buf, size_t size);
#else
#include <errno.h>
static inline struct bpf_object *
bpf__prepare_load(const char *filename __maybe_unused,
bool source __maybe_unused)

View file

@ -12,6 +12,7 @@
#include "bpf-loader.h"
#include "bpf-prologue.h"
#include "probe-finder.h"
#include <errno.h>
#include <dwarf-regs.h>
#include <linux/filter.h>

View file

@ -18,6 +18,8 @@ int bpf__gen_prologue(struct probe_trace_arg *args, int nargs,
struct bpf_insn *new_prog, size_t *new_cnt,
size_t cnt_space);
#else
#include <errno.h>
static inline int
bpf__gen_prologue(struct probe_trace_arg *args __maybe_unused,
int nargs __maybe_unused,

View file

@ -7,6 +7,7 @@
* Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <acme@redhat.com>
*/
#include "util.h"
#include <errno.h>
#include <stdio.h>
#include "build-id.h"
#include "event.h"

View file

@ -20,6 +20,7 @@ extern int perf_clang__compile_bpf(const char *filename,
size_t *p_obj_buf_sz);
#else
#include <errno.h>
static inline void perf_clang__init(void) { }
static inline void perf_clang__cleanup(void) { }

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <sched.h>
#include "util.h"
#include "../perf.h"

View file

@ -1,5 +1,6 @@
#include "comm.h"
#include "util.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <linux/refcount.h>

View file

@ -8,6 +8,7 @@
* Copyright (C) Johannes Schindelin, 2005
*
*/
#include <errno.h>
#include "util.h"
#include "cache.h"
#include <subcmd/exec-cmd.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <stdlib.h>
#include "evsel.h"
#include "counts.h"

View file

@ -7,6 +7,7 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
#include <errno.h>
#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/kernel.h>

View file

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

View file

@ -17,6 +17,7 @@
#include "evlist.h"
#include "evsel.h"
#include "pmu.h"
#include <errno.h>
static int
perf_evsel__apply_drv_configs(struct perf_evsel *evsel,

View file

@ -2,6 +2,7 @@
#include <linux/kernel.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <errno.h>
#include "symbol.h"
#include "dso.h"
#include "machine.h"

View file

@ -17,6 +17,7 @@
*
*/
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include "util.h"

View file

@ -1,6 +1,7 @@
#include "cpumap.h"
#include "env.h"
#include "util.h"
#include <errno.h>
struct perf_env perf_env;

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <linux/kernel.h>
#include <linux/types.h>

View file

@ -8,6 +8,7 @@
*/
#include "util.h"
#include <api/fs/fs.h>
#include <errno.h>
#include <inttypes.h>
#include <poll.h>
#include "cpumap.h"

View file

@ -8,6 +8,7 @@
*/
#include <byteswap.h>
#include <errno.h>
#include <inttypes.h>
#include <linux/bitops.h>
#include <api/fs/tracing_path.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include "util.h"
#include "string2.h"

View file

@ -10,6 +10,7 @@
#include "annotate.h"
#include "srcline.h"
#include "ui/progress.h"
#include <errno.h>
#include <math.h>
static bool hists__filter_entry_by_dso(struct hists *hists,

View file

@ -14,6 +14,7 @@
*/
#include <endian.h>
#include <errno.h>
#include <byteswap.h>
#include <inttypes.h>
#include <linux/kernel.h>

View file

@ -1,5 +1,6 @@
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <lzma.h>
#include <stdio.h>
#include <linux/compiler.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include "callchain.h"
#include "debug.h"

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <linux/list.h>
#include <linux/compiler.h>

View file

@ -1,5 +1,6 @@
#include <linux/hw_breakpoint.h>
#include <linux/err.h>
#include <errno.h>
#include "util.h"
#include "../perf.h"
#include "evlist.h"

View file

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

View file

@ -14,6 +14,7 @@
* GNU General Public License for more details.
*
*/
#include <errno.h>
#include <sys/uio.h>
#include "util.h"
#include "event.h"

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <stdlib.h>
#include "strbuf.h"
#include "quote.h"

View file

@ -2,6 +2,7 @@
#include "evsel.h"
#include "cpumap.h"
#include "parse-events.h"
#include <errno.h>
#include <api/fs/fs.h>
#include "util.h"
#include "cloexec.h"

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <linux/kernel.h>
#include <traceevent/event-parse.h>

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <sys/mman.h>
#include "sort.h"

View file

@ -1,3 +1,4 @@
#include <errno.h>
#include <inttypes.h>
#include <math.h>
#include "stat.h"

View file

@ -1,6 +1,7 @@
#include "debug.h"
#include "util.h"
#include <linux/kernel.h>
#include <errno.h>
int prefixcmp(const char *str, const char *prefix)
{

View file

@ -2,6 +2,7 @@
#include "string2.h"
#include "strfilter.h"
#include <errno.h>
#include "sane_ctype.h"
/* Operators */

View file

@ -1,6 +1,7 @@
#include "symbol.h"
#include "util.h"
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>

View file

@ -15,6 +15,7 @@
#include <linux/rbtree.h>
#include <linux/list.h>
#include <errno.h>
#include "thread.h"
#include "event.h"
#include "machine.h"

View file

@ -1,4 +1,5 @@
#include "../perf.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View file

@ -1,4 +1,5 @@
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>

View file

@ -16,6 +16,7 @@
*/
#include <elf.h>
#include <errno.h>
#include <gelf.h>
#include <fcntl.h>
#include <inttypes.h>

View file

@ -18,7 +18,6 @@
#include <stdarg.h>
#include <string.h>
#include <term.h>
#include <errno.h>
#include <limits.h>
#include <sys/param.h>
#include <sys/types.h>

View file

@ -1,4 +1,4 @@
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>