diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-12-08 05:50:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-12-08 05:50:24 -0500 |
commit | 2a2662bf88e693d477ef08351d03934f7bc0b51c (patch) | |
tree | cef243df159cc12ada7e97998a253df7c0abb2a2 /tools/perf/util/include/linux | |
parent | b2776bf7149bddd1f4161f14f79520f17fc1d71d (diff) | |
parent | 36748b9518a2437beffe861b47dff6d12b736b3f (diff) |
Merge branch 'perf/core-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into perf/hw_breakpoints
Pull AMD range breakpoints support from Frederic Weisbecker:
" - Extend breakpoint tools and core to support address range through perf
event with initial backend support for AMD extended breakpoints.
Syntax is:
perf record -e mem:addr/len:type
For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512)
perf record -e mem:0x1000/512:w
- Clean up a bit breakpoint code validation
It has been acked by Jiri and Oleg. "
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/include/linux')
-rw-r--r-- | tools/perf/util/include/linux/bitmap.h | 17 | ||||
-rw-r--r-- | tools/perf/util/include/linux/bitops.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h index 01ffd12dc791..40bd21488032 100644 --- a/tools/perf/util/include/linux/bitmap.h +++ b/tools/perf/util/include/linux/bitmap.h | |||
@@ -46,4 +46,21 @@ static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, | |||
46 | __bitmap_or(dst, src1, src2, nbits); | 46 | __bitmap_or(dst, src1, src2, nbits); |
47 | } | 47 | } |
48 | 48 | ||
49 | /** | ||
50 | * test_and_set_bit - Set a bit and return its old value | ||
51 | * @nr: Bit to set | ||
52 | * @addr: Address to count from | ||
53 | */ | ||
54 | static inline int test_and_set_bit(int nr, unsigned long *addr) | ||
55 | { | ||
56 | unsigned long mask = BIT_MASK(nr); | ||
57 | unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); | ||
58 | unsigned long old; | ||
59 | |||
60 | old = *p; | ||
61 | *p = old | mask; | ||
62 | |||
63 | return (old & mask) != 0; | ||
64 | } | ||
65 | |||
49 | #endif /* _PERF_BITOPS_H */ | 66 | #endif /* _PERF_BITOPS_H */ |
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h index dadfa7e54287..c3294163de17 100644 --- a/tools/perf/util/include/linux/bitops.h +++ b/tools/perf/util/include/linux/bitops.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) | 15 | #define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) |
16 | #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) | 16 | #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) |
17 | #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) | 17 | #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) |
18 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) | ||
19 | #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) | ||
18 | 20 | ||
19 | #define for_each_set_bit(bit, addr, size) \ | 21 | #define for_each_set_bit(bit, addr, size) \ |
20 | for ((bit) = find_first_bit((addr), (size)); \ | 22 | for ((bit) = find_first_bit((addr), (size)); \ |