diff options
| author | Ingo Molnar <mingo@kernel.org> | 2012-09-13 11:11:19 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2012-09-13 11:11:19 -0400 |
| commit | be267be8b191d5fac9f65a29e047470f364315eb (patch) | |
| tree | 80cdb3f7c1d53fc6209fac2d57ff9a4052e2750e /tools/perf/util/include/linux | |
| parent | d5cb2aef4fda355fbafe8db4f425b73ea94d2019 (diff) | |
| parent | 9ec3f4e437ede2f3b5087d412abe16a0219b3b99 (diff) | |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
* Remove die()/exit() calls from several tools.
* Add missing perf_regs.h file to MANIFEST
* Clean up and improve 'perf sched' performance by elliminating lots of
needless calls to libtraceevent.
* More patches to make perf build on Android, from Irina Tirdea
* Resolve vdso callchains, from Jiri Olsa
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/include/linux')
| -rw-r--r-- | tools/perf/util/include/linux/bitops.h | 4 | ||||
| -rw-r--r-- | tools/perf/util/include/linux/compiler.h | 8 | ||||
| -rw-r--r-- | tools/perf/util/include/linux/kernel.h | 13 | ||||
| -rw-r--r-- | tools/perf/util/include/linux/magic.h | 12 | ||||
| -rw-r--r-- | tools/perf/util/include/linux/string.h | 2 | ||||
| -rw-r--r-- | tools/perf/util/include/linux/types.h | 8 |
6 files changed, 44 insertions, 3 deletions
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h index 587a230d2075..a55d8cf083c9 100644 --- a/tools/perf/util/include/linux/bitops.h +++ b/tools/perf/util/include/linux/bitops.h | |||
| @@ -5,6 +5,10 @@ | |||
| 5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
| 6 | #include <asm/hweight.h> | 6 | #include <asm/hweight.h> |
| 7 | 7 | ||
| 8 | #ifndef __WORDSIZE | ||
| 9 | #define __WORDSIZE (__SIZEOF_LONG__ * 8) | ||
| 10 | #endif | ||
| 11 | |||
| 8 | #define BITS_PER_LONG __WORDSIZE | 12 | #define BITS_PER_LONG __WORDSIZE |
| 9 | #define BITS_PER_BYTE 8 | 13 | #define BITS_PER_BYTE 8 |
| 10 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) | 14 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h index 2dc867128e46..96b919dae11c 100644 --- a/tools/perf/util/include/linux/compiler.h +++ b/tools/perf/util/include/linux/compiler.h | |||
| @@ -9,7 +9,13 @@ | |||
| 9 | #define __attribute_const__ | 9 | #define __attribute_const__ |
| 10 | #endif | 10 | #endif |
| 11 | 11 | ||
| 12 | #define __used __attribute__((__unused__)) | 12 | #ifndef __maybe_unused |
| 13 | #define __maybe_unused __attribute__((unused)) | ||
| 14 | #endif | ||
| 13 | #define __packed __attribute__((__packed__)) | 15 | #define __packed __attribute__((__packed__)) |
| 14 | 16 | ||
| 17 | #ifndef __force | ||
| 18 | #define __force | ||
| 19 | #endif | ||
| 20 | |||
| 15 | #endif | 21 | #endif |
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h index 4af9a10cc2d2..d8c927c868ee 100644 --- a/tools/perf/util/include/linux/kernel.h +++ b/tools/perf/util/include/linux/kernel.h | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 9 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
| 10 | 10 | ||
| 11 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 11 | #define PERF_ALIGN(x, a) __PERF_ALIGN_MASK(x, (typeof(x))(a)-1) |
| 12 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 12 | #define __PERF_ALIGN_MASK(x, mask) (((x)+(mask))&~(mask)) |
| 13 | 13 | ||
| 14 | #ifndef offsetof | 14 | #ifndef offsetof |
| 15 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | 15 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| @@ -46,6 +46,15 @@ | |||
| 46 | _min1 < _min2 ? _min1 : _min2; }) | 46 | _min1 < _min2 ? _min1 : _min2; }) |
| 47 | #endif | 47 | #endif |
| 48 | 48 | ||
| 49 | #ifndef roundup | ||
| 50 | #define roundup(x, y) ( \ | ||
| 51 | { \ | ||
| 52 | const typeof(y) __y = y; \ | ||
| 53 | (((x) + (__y - 1)) / __y) * __y; \ | ||
| 54 | } \ | ||
| 55 | ) | ||
| 56 | #endif | ||
| 57 | |||
| 49 | #ifndef BUG_ON | 58 | #ifndef BUG_ON |
| 50 | #ifdef NDEBUG | 59 | #ifdef NDEBUG |
| 51 | #define BUG_ON(cond) do { if (cond) {} } while (0) | 60 | #define BUG_ON(cond) do { if (cond) {} } while (0) |
diff --git a/tools/perf/util/include/linux/magic.h b/tools/perf/util/include/linux/magic.h new file mode 100644 index 000000000000..58b64ed4da12 --- /dev/null +++ b/tools/perf/util/include/linux/magic.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef _PERF_LINUX_MAGIC_H_ | ||
| 2 | #define _PERF_LINUX_MAGIC_H_ | ||
| 3 | |||
| 4 | #ifndef DEBUGFS_MAGIC | ||
| 5 | #define DEBUGFS_MAGIC 0x64626720 | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #ifndef SYSFS_MAGIC | ||
| 9 | #define SYSFS_MAGIC 0x62656572 | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #endif | ||
diff --git a/tools/perf/util/include/linux/string.h b/tools/perf/util/include/linux/string.h index 3b2f5900276f..6f19c548ecc0 100644 --- a/tools/perf/util/include/linux/string.h +++ b/tools/perf/util/include/linux/string.h | |||
| @@ -1 +1,3 @@ | |||
| 1 | #include <string.h> | 1 | #include <string.h> |
| 2 | |||
| 3 | void *memdup(const void *src, size_t len); | ||
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h index 12de3b8112f9..eb464786c084 100644 --- a/tools/perf/util/include/linux/types.h +++ b/tools/perf/util/include/linux/types.h | |||
| @@ -3,6 +3,14 @@ | |||
| 3 | 3 | ||
| 4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
| 5 | 5 | ||
| 6 | #ifndef __bitwise | ||
| 7 | #define __bitwise | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #ifndef __le32 | ||
| 11 | typedef __u32 __bitwise __le32; | ||
| 12 | #endif | ||
| 13 | |||
| 6 | #define DECLARE_BITMAP(name,bits) \ | 14 | #define DECLARE_BITMAP(name,bits) \ |
| 7 | unsigned long name[BITS_TO_LONGS(bits)] | 15 | unsigned long name[BITS_TO_LONGS(bits)] |
| 8 | 16 | ||
