diff options
author | Borislav Petkov <bp@suse.de> | 2014-04-25 21:31:02 +0200 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-05-01 21:22:39 +0200 |
commit | d944c4eebcf4c0d5e5d9728fec110cbf0047ad7f (patch) | |
tree | 94240760600b3b1de6b6c95fe76b68a6990b2669 /tools/perf/util | |
parent | 5ac3e4b6d1d8fb911bb9c497126c51b02033a412 (diff) |
tools: Consolidate types.h
Combine all definitions into a common tools/include/linux/types.h and
kill the wild growth elsewhere. Move DECLARE_BITMAP to its proper
bitmap.h header.
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Link: http://lkml.kernel.org/n/tip-azczs7qcv6h9xek9od10hiv2@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/annotate.h | 2 | ||||
-rw-r--r-- | tools/perf/util/build-id.h | 2 | ||||
-rw-r--r-- | tools/perf/util/dso.h | 2 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 4 | ||||
-rw-r--r-- | tools/perf/util/header.h | 4 | ||||
-rw-r--r-- | tools/perf/util/include/linux/bitmap.h | 3 | ||||
-rw-r--r-- | tools/perf/util/include/linux/list.h | 1 | ||||
-rw-r--r-- | tools/perf/util/include/linux/types.h | 29 | ||||
-rw-r--r-- | tools/perf/util/map.h | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.h | 3 | ||||
-rw-r--r-- | tools/perf/util/parse-events.y | 2 | ||||
-rw-r--r-- | tools/perf/util/perf_regs.h | 2 | ||||
-rw-r--r-- | tools/perf/util/pmu.h | 2 | ||||
-rw-r--r-- | tools/perf/util/stat.h | 2 | ||||
-rw-r--r-- | tools/perf/util/svghelper.c | 2 | ||||
-rw-r--r-- | tools/perf/util/svghelper.h | 2 | ||||
-rw-r--r-- | tools/perf/util/top.h | 2 | ||||
-rw-r--r-- | tools/perf/util/types.h | 19 | ||||
-rw-r--r-- | tools/perf/util/unwind-libdw.c | 2 | ||||
-rw-r--r-- | tools/perf/util/unwind.h | 2 | ||||
-rw-r--r-- | tools/perf/util/util.h | 2 | ||||
-rw-r--r-- | tools/perf/util/values.h | 2 |
22 files changed, 24 insertions, 69 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 56ad4f5287d..112d6e26815 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -3,7 +3,7 @@ #include <stdbool.h> #include <stdint.h> -#include "types.h" +#include <linux/types.h> #include "symbol.h" #include "hist.h" #include "sort.h" diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index 845ef865ece..ae392561470 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h @@ -4,7 +4,7 @@ #define BUILD_ID_SIZE 20 #include "tool.h" -#include "types.h" +#include <linux/types.h> extern struct perf_tool build_id__mark_dso_hit_ops; struct dso; diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index ab06f1c0365..38efe95a7fd 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -4,7 +4,7 @@ #include <linux/types.h> #include <linux/rbtree.h> #include <stdbool.h> -#include "types.h" +#include <linux/types.h> #include "map.h" #include "build-id.h" diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 0c581d0d5eb..a52e9a5bb2d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -5,12 +5,12 @@ #include <stdbool.h> #include <stddef.h> #include <linux/perf_event.h> -#include "types.h" +#include <linux/types.h> #include "xyarray.h" #include "cgroup.h" #include "hist.h" #include "symbol.h" - + struct perf_counts_values { union { struct { diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index a2d047bdf4e..d08cfe49940 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -4,10 +4,10 @@ #include <linux/perf_event.h> #include <sys/types.h> #include <stdbool.h> -#include "types.h" +#include <linux/bitmap.h> +#include <linux/types.h> #include "event.h" -#include <linux/bitmap.h> enum { HEADER_RESERVED = 0, /* always cleared */ diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h index bb162e40c76..01ffd12dc79 100644 --- a/tools/perf/util/include/linux/bitmap.h +++ b/tools/perf/util/include/linux/bitmap.h @@ -4,6 +4,9 @@ #include <string.h> #include <linux/bitops.h> +#define DECLARE_BITMAP(name,bits) \ + unsigned long name[BITS_TO_LONGS(bits)] + int __bitmap_weight(const unsigned long *bitmap, int bits); void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, const unsigned long *bitmap2, int bits); diff --git a/tools/perf/util/include/linux/list.h b/tools/perf/util/include/linux/list.h index bfe0a2afd0d..76ddbc72634 100644 --- a/tools/perf/util/include/linux/list.h +++ b/tools/perf/util/include/linux/list.h @@ -1,4 +1,5 @@ #include <linux/kernel.h> +#include <linux/types.h> #include "../../../../include/linux/list.h" diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h deleted file mode 100644 index eb464786c08..00000000000 --- a/tools/perf/util/include/linux/types.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _PERF_LINUX_TYPES_H_ -#define _PERF_LINUX_TYPES_H_ - -#include <asm/types.h> - -#ifndef __bitwise -#define __bitwise -#endif - -#ifndef __le32 -typedef __u32 __bitwise __le32; -#endif - -#define DECLARE_BITMAP(name,bits) \ - unsigned long name[BITS_TO_LONGS(bits)] - -struct list_head { - struct list_head *next, *prev; -}; - -struct hlist_head { - struct hlist_node *first; -}; - -struct hlist_node { - struct hlist_node *next, **pprev; -}; - -#endif diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index d6445b27d67..ae2d4511058 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h @@ -6,7 +6,7 @@ #include <linux/rbtree.h> #include <stdio.h> #include <stdbool.h> -#include "types.h" +#include <linux/types.h> enum map_type { MAP__FUNCTION = 0, diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index f1cb4c4b3c7..df094b4ed5e 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -6,9 +6,8 @@ #include <linux/list.h> #include <stdbool.h> -#include "types.h" +#include <linux/types.h> #include <linux/perf_event.h> -#include "types.h" struct list_head; struct perf_evsel; diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index ac9db9f699f..0bc87ba46bf 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -9,7 +9,7 @@ #include <linux/compiler.h> #include <linux/list.h> -#include "types.h" +#include <linux/types.h> #include "util.h" #include "parse-events.h" #include "parse-events-bison.h" diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h index d6e8b6a8d7f..79c78f74e0c 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h @@ -1,7 +1,7 @@ #ifndef __PERF_REGS_H #define __PERF_REGS_H -#include "types.h" +#include <linux/types.h> #include "event.h" #ifdef HAVE_PERF_REGS_SUPPORT diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 8b64125a928..c14a543ce1f 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -1,7 +1,7 @@ #ifndef __PMU_H #define __PMU_H -#include <linux/bitops.h> +#include <linux/bitmap.h> #include <linux/perf_event.h> #include <stdbool.h> diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index ae8ccd7227c..5667fc3e39c 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -1,7 +1,7 @@ #ifndef __PERF_STATS_H #define __PERF_STATS_H -#include "types.h" +#include <linux/types.h> struct stats { diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index 43262b83c54..6a0a13d07a2 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c @@ -17,7 +17,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> -#include <linux/bitops.h> +#include <linux/bitmap.h> #include "perf.h" #include "svghelper.h" diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h index f7b4d6e699e..e3aff5332e3 100644 --- a/tools/perf/util/svghelper.h +++ b/tools/perf/util/svghelper.h @@ -1,7 +1,7 @@ #ifndef __PERF_SVGHELPER_H #define __PERF_SVGHELPER_H -#include "types.h" +#include <linux/types.h> extern void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end); extern void svg_box(int Yslot, u64 start, u64 end, const char *type); diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index dab14d0ad3d..f92c37abb0a 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h @@ -2,7 +2,7 @@ #define __PERF_TOP_H 1 #include "tool.h" -#include "types.h" +#include <linux/types.h> #include <stddef.h> #include <stdbool.h> #include <termios.h> diff --git a/tools/perf/util/types.h b/tools/perf/util/types.h deleted file mode 100644 index 5f3689a3d08..00000000000 --- a/tools/perf/util/types.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __PERF_TYPES_H -#define __PERF_TYPES_H - -#include <stdint.h> - -/* - * We define u64 as uint64_t for every architecture - * so that we can print it with "%"PRIx64 without getting warnings. - */ -typedef uint64_t u64; -typedef int64_t s64; -typedef unsigned int u32; -typedef signed int s32; -typedef unsigned short u16; -typedef signed short s16; -typedef unsigned char u8; -typedef signed char s8; - -#endif /* __PERF_TYPES_H */ diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index 67db73ec3da..5ec80a575b5 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -7,7 +7,7 @@ #include "unwind-libdw.h" #include "machine.h" #include "thread.h" -#include "types.h" +#include <linux/types.h> #include "event.h" #include "perf_regs.h" diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h index b031316f221..f03061260b4 100644 --- a/tools/perf/util/unwind.h +++ b/tools/perf/util/unwind.h @@ -1,7 +1,7 @@ #ifndef __UNWIND_H #define __UNWIND_H -#include "types.h" +#include <linux/types.h> #include "event.h" #include "symbol.h" diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 6995d66f225..b03da44e94e 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -69,7 +69,7 @@ #include <sys/ioctl.h> #include <inttypes.h> #include <linux/magic.h> -#include "types.h" +#include <linux/types.h> #include <sys/ttydefaults.h> #include <api/fs/debugfs.h> #include <termios.h> diff --git a/tools/perf/util/values.h b/tools/perf/util/values.h index 2fa967e1a88..b21a80c6cf8 100644 --- a/tools/perf/util/values.h +++ b/tools/perf/util/values.h @@ -1,7 +1,7 @@ #ifndef __PERF_VALUES_H #define __PERF_VALUES_H -#include "types.h" +#include <linux/types.h> struct perf_read_values { int threads; |