diff options
author | Borislav Petkov <bp@suse.de> | 2014-04-25 15:31:02 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-05-01 15:22:39 -0400 |
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 56ad4f5287de..112d6e268150 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include <stdint.h> | 5 | #include <stdint.h> |
6 | #include "types.h" | 6 | #include <linux/types.h> |
7 | #include "symbol.h" | 7 | #include "symbol.h" |
8 | #include "hist.h" | 8 | #include "hist.h" |
9 | #include "sort.h" | 9 | #include "sort.h" |
diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index 845ef865eced..ae392561470b 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #define BUILD_ID_SIZE 20 | 4 | #define BUILD_ID_SIZE 20 |
5 | 5 | ||
6 | #include "tool.h" | 6 | #include "tool.h" |
7 | #include "types.h" | 7 | #include <linux/types.h> |
8 | 8 | ||
9 | extern struct perf_tool build_id__mark_dso_hit_ops; | 9 | extern struct perf_tool build_id__mark_dso_hit_ops; |
10 | struct dso; | 10 | struct dso; |
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index ab06f1c03655..38efe95a7fdd 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/rbtree.h> | 5 | #include <linux/rbtree.h> |
6 | #include <stdbool.h> | 6 | #include <stdbool.h> |
7 | #include "types.h" | 7 | #include <linux/types.h> |
8 | #include "map.h" | 8 | #include "map.h" |
9 | #include "build-id.h" | 9 | #include "build-id.h" |
10 | 10 | ||
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 0c581d0d5eb6..a52e9a5bb2d0 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -5,12 +5,12 @@ | |||
5 | #include <stdbool.h> | 5 | #include <stdbool.h> |
6 | #include <stddef.h> | 6 | #include <stddef.h> |
7 | #include <linux/perf_event.h> | 7 | #include <linux/perf_event.h> |
8 | #include "types.h" | 8 | #include <linux/types.h> |
9 | #include "xyarray.h" | 9 | #include "xyarray.h" |
10 | #include "cgroup.h" | 10 | #include "cgroup.h" |
11 | #include "hist.h" | 11 | #include "hist.h" |
12 | #include "symbol.h" | 12 | #include "symbol.h" |
13 | 13 | ||
14 | struct perf_counts_values { | 14 | struct perf_counts_values { |
15 | union { | 15 | union { |
16 | struct { | 16 | struct { |
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index a2d047bdf4ef..d08cfe499404 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -4,10 +4,10 @@ | |||
4 | #include <linux/perf_event.h> | 4 | #include <linux/perf_event.h> |
5 | #include <sys/types.h> | 5 | #include <sys/types.h> |
6 | #include <stdbool.h> | 6 | #include <stdbool.h> |
7 | #include "types.h" | 7 | #include <linux/bitmap.h> |
8 | #include <linux/types.h> | ||
8 | #include "event.h" | 9 | #include "event.h" |
9 | 10 | ||
10 | #include <linux/bitmap.h> | ||
11 | 11 | ||
12 | enum { | 12 | enum { |
13 | HEADER_RESERVED = 0, /* always cleared */ | 13 | HEADER_RESERVED = 0, /* always cleared */ |
diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h index bb162e40c76c..01ffd12dc791 100644 --- a/tools/perf/util/include/linux/bitmap.h +++ b/tools/perf/util/include/linux/bitmap.h | |||
@@ -4,6 +4,9 @@ | |||
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <linux/bitops.h> | 5 | #include <linux/bitops.h> |
6 | 6 | ||
7 | #define DECLARE_BITMAP(name,bits) \ | ||
8 | unsigned long name[BITS_TO_LONGS(bits)] | ||
9 | |||
7 | int __bitmap_weight(const unsigned long *bitmap, int bits); | 10 | int __bitmap_weight(const unsigned long *bitmap, int bits); |
8 | void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, | 11 | void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, |
9 | const unsigned long *bitmap2, int bits); | 12 | 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 bfe0a2afd0d2..76ddbc726343 100644 --- a/tools/perf/util/include/linux/list.h +++ b/tools/perf/util/include/linux/list.h | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
2 | #include <linux/types.h> | ||
2 | 3 | ||
3 | #include "../../../../include/linux/list.h" | 4 | #include "../../../../include/linux/list.h" |
4 | 5 | ||
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h deleted file mode 100644 index eb464786c084..000000000000 --- a/tools/perf/util/include/linux/types.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #ifndef _PERF_LINUX_TYPES_H_ | ||
2 | #define _PERF_LINUX_TYPES_H_ | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | #ifndef __bitwise | ||
7 | #define __bitwise | ||
8 | #endif | ||
9 | |||
10 | #ifndef __le32 | ||
11 | typedef __u32 __bitwise __le32; | ||
12 | #endif | ||
13 | |||
14 | #define DECLARE_BITMAP(name,bits) \ | ||
15 | unsigned long name[BITS_TO_LONGS(bits)] | ||
16 | |||
17 | struct list_head { | ||
18 | struct list_head *next, *prev; | ||
19 | }; | ||
20 | |||
21 | struct hlist_head { | ||
22 | struct hlist_node *first; | ||
23 | }; | ||
24 | |||
25 | struct hlist_node { | ||
26 | struct hlist_node *next, **pprev; | ||
27 | }; | ||
28 | |||
29 | #endif | ||
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index d6445b27d672..ae2d45110588 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/rbtree.h> | 6 | #include <linux/rbtree.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <stdbool.h> | 8 | #include <stdbool.h> |
9 | #include "types.h" | 9 | #include <linux/types.h> |
10 | 10 | ||
11 | enum map_type { | 11 | enum map_type { |
12 | MAP__FUNCTION = 0, | 12 | MAP__FUNCTION = 0, |
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index f1cb4c4b3c70..df094b4ed5ed 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h | |||
@@ -6,9 +6,8 @@ | |||
6 | 6 | ||
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <stdbool.h> | 8 | #include <stdbool.h> |
9 | #include "types.h" | 9 | #include <linux/types.h> |
10 | #include <linux/perf_event.h> | 10 | #include <linux/perf_event.h> |
11 | #include "types.h" | ||
12 | 11 | ||
13 | struct list_head; | 12 | struct list_head; |
14 | struct perf_evsel; | 13 | struct perf_evsel; |
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index ac9db9f699f3..0bc87ba46bf3 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include "types.h" | 12 | #include <linux/types.h> |
13 | #include "util.h" | 13 | #include "util.h" |
14 | #include "parse-events.h" | 14 | #include "parse-events.h" |
15 | #include "parse-events-bison.h" | 15 | #include "parse-events-bison.h" |
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h index d6e8b6a8d7f3..79c78f74e0cf 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PERF_REGS_H | 1 | #ifndef __PERF_REGS_H |
2 | #define __PERF_REGS_H | 2 | #define __PERF_REGS_H |
3 | 3 | ||
4 | #include "types.h" | 4 | #include <linux/types.h> |
5 | #include "event.h" | 5 | #include "event.h" |
6 | 6 | ||
7 | #ifdef HAVE_PERF_REGS_SUPPORT | 7 | #ifdef HAVE_PERF_REGS_SUPPORT |
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 8b64125a9281..c14a543ce1f3 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PMU_H | 1 | #ifndef __PMU_H |
2 | #define __PMU_H | 2 | #define __PMU_H |
3 | 3 | ||
4 | #include <linux/bitops.h> | 4 | #include <linux/bitmap.h> |
5 | #include <linux/perf_event.h> | 5 | #include <linux/perf_event.h> |
6 | #include <stdbool.h> | 6 | #include <stdbool.h> |
7 | 7 | ||
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index ae8ccd7227cf..5667fc3e39cf 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PERF_STATS_H | 1 | #ifndef __PERF_STATS_H |
2 | #define __PERF_STATS_H | 2 | #define __PERF_STATS_H |
3 | 3 | ||
4 | #include "types.h" | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct stats | 6 | struct stats |
7 | { | 7 | { |
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index 43262b83c541..6a0a13d07a28 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <stdlib.h> | 17 | #include <stdlib.h> |
18 | #include <unistd.h> | 18 | #include <unistd.h> |
19 | #include <string.h> | 19 | #include <string.h> |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitmap.h> |
21 | 21 | ||
22 | #include "perf.h" | 22 | #include "perf.h" |
23 | #include "svghelper.h" | 23 | #include "svghelper.h" |
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h index f7b4d6e699ea..e3aff5332e30 100644 --- a/tools/perf/util/svghelper.h +++ b/tools/perf/util/svghelper.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PERF_SVGHELPER_H | 1 | #ifndef __PERF_SVGHELPER_H |
2 | #define __PERF_SVGHELPER_H | 2 | #define __PERF_SVGHELPER_H |
3 | 3 | ||
4 | #include "types.h" | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | extern void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end); | 6 | extern void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end); |
7 | extern void svg_box(int Yslot, u64 start, u64 end, const char *type); | 7 | 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 dab14d0ad3d0..f92c37abb0a8 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __PERF_TOP_H 1 | 2 | #define __PERF_TOP_H 1 |
3 | 3 | ||
4 | #include "tool.h" | 4 | #include "tool.h" |
5 | #include "types.h" | 5 | #include <linux/types.h> |
6 | #include <stddef.h> | 6 | #include <stddef.h> |
7 | #include <stdbool.h> | 7 | #include <stdbool.h> |
8 | #include <termios.h> | 8 | #include <termios.h> |
diff --git a/tools/perf/util/types.h b/tools/perf/util/types.h deleted file mode 100644 index 5f3689a3d085..000000000000 --- a/tools/perf/util/types.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef __PERF_TYPES_H | ||
2 | #define __PERF_TYPES_H | ||
3 | |||
4 | #include <stdint.h> | ||
5 | |||
6 | /* | ||
7 | * We define u64 as uint64_t for every architecture | ||
8 | * so that we can print it with "%"PRIx64 without getting warnings. | ||
9 | */ | ||
10 | typedef uint64_t u64; | ||
11 | typedef int64_t s64; | ||
12 | typedef unsigned int u32; | ||
13 | typedef signed int s32; | ||
14 | typedef unsigned short u16; | ||
15 | typedef signed short s16; | ||
16 | typedef unsigned char u8; | ||
17 | typedef signed char s8; | ||
18 | |||
19 | #endif /* __PERF_TYPES_H */ | ||
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index 67db73ec3dab..5ec80a575b50 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c | |||
@@ -7,7 +7,7 @@ | |||
7 | #include "unwind-libdw.h" | 7 | #include "unwind-libdw.h" |
8 | #include "machine.h" | 8 | #include "machine.h" |
9 | #include "thread.h" | 9 | #include "thread.h" |
10 | #include "types.h" | 10 | #include <linux/types.h> |
11 | #include "event.h" | 11 | #include "event.h" |
12 | #include "perf_regs.h" | 12 | #include "perf_regs.h" |
13 | 13 | ||
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h index b031316f221a..f03061260b4e 100644 --- a/tools/perf/util/unwind.h +++ b/tools/perf/util/unwind.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __UNWIND_H | 1 | #ifndef __UNWIND_H |
2 | #define __UNWIND_H | 2 | #define __UNWIND_H |
3 | 3 | ||
4 | #include "types.h" | 4 | #include <linux/types.h> |
5 | #include "event.h" | 5 | #include "event.h" |
6 | #include "symbol.h" | 6 | #include "symbol.h" |
7 | 7 | ||
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 6995d66f225c..b03da44e94e4 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -69,7 +69,7 @@ | |||
69 | #include <sys/ioctl.h> | 69 | #include <sys/ioctl.h> |
70 | #include <inttypes.h> | 70 | #include <inttypes.h> |
71 | #include <linux/magic.h> | 71 | #include <linux/magic.h> |
72 | #include "types.h" | 72 | #include <linux/types.h> |
73 | #include <sys/ttydefaults.h> | 73 | #include <sys/ttydefaults.h> |
74 | #include <api/fs/debugfs.h> | 74 | #include <api/fs/debugfs.h> |
75 | #include <termios.h> | 75 | #include <termios.h> |
diff --git a/tools/perf/util/values.h b/tools/perf/util/values.h index 2fa967e1a88a..b21a80c6cf8d 100644 --- a/tools/perf/util/values.h +++ b/tools/perf/util/values.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PERF_VALUES_H | 1 | #ifndef __PERF_VALUES_H |
2 | #define __PERF_VALUES_H | 2 | #define __PERF_VALUES_H |
3 | 3 | ||
4 | #include "types.h" | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct perf_read_values { | 6 | struct perf_read_values { |
7 | int threads; | 7 | int threads; |