diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-06 11:02:58 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-06 11:02:58 -0500 |
| commit | 35b740e4662ef386f0c60e1b60aaf5b44db9914c (patch) | |
| tree | 502a8f9499bc1b4cb3300d666dab2d01a1921224 /include/linux | |
| parent | 423d091dfe58d3109d84c408810a7cfa82f6f184 (diff) | |
| parent | 9e183426bfb52bb44bf3c443d6587e4d02478603 (diff) | |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (106 commits)
perf kvm: Fix copy & paste error in description
perf script: Kill script_spec__delete
perf top: Fix a memory leak
perf stat: Introduce get_ratio_color() helper
perf session: Remove impossible condition check
perf tools: Fix feature-bits rework fallout, remove unused variable
perf script: Add generic perl handler to process events
perf tools: Use for_each_set_bit() to iterate over feature flags
perf tools: Unify handling of features when writing feature section
perf report: Accept fifos as input file
perf tools: Moving code in some files
perf tools: Fix out-of-bound access to struct perf_session
perf tools: Continue processing header on unknown features
perf tools: Improve macros for struct feature_ops
perf: builtin-record: Document and check that mmap_pages must be a power of two.
perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
perf tools: Fix truncated annotation
perf script: look up thread using tid instead of pid
perf tools: Look up thread names for system wide profiling
perf tools: Fix comm for processes with named threads
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bitops.h | 10 | ||||
| -rw-r--r-- | include/linux/jump_label.h | 27 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 8 |
3 files changed, 40 insertions, 5 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a3ef66a2a083..3c1063acb2ab 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -22,8 +22,14 @@ extern unsigned long __sw_hweight64(__u64 w); | |||
| 22 | #include <asm/bitops.h> | 22 | #include <asm/bitops.h> |
| 23 | 23 | ||
| 24 | #define for_each_set_bit(bit, addr, size) \ | 24 | #define for_each_set_bit(bit, addr, size) \ |
| 25 | for ((bit) = find_first_bit((addr), (size)); \ | 25 | for ((bit) = find_first_bit((addr), (size)); \ |
| 26 | (bit) < (size); \ | 26 | (bit) < (size); \ |
| 27 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | ||
| 28 | |||
| 29 | /* same as for_each_set_bit() but use bit as value to start with */ | ||
| 30 | #define for_each_set_bit_cont(bit, addr, size) \ | ||
| 31 | for ((bit) = find_next_bit((addr), (size), (bit)); \ | ||
| 32 | (bit) < (size); \ | ||
| 27 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | 33 | (bit) = find_next_bit((addr), (size), (bit) + 1)) |
| 28 | 34 | ||
| 29 | static __inline__ int get_bitmask_order(unsigned int count) | 35 | static __inline__ int get_bitmask_order(unsigned int count) |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 388b0d425b50..5ce8b140428f 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
| 6 | #include <linux/workqueue.h> | ||
| 6 | 7 | ||
| 7 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) | 8 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) |
| 8 | 9 | ||
| @@ -14,6 +15,12 @@ struct jump_label_key { | |||
| 14 | #endif | 15 | #endif |
| 15 | }; | 16 | }; |
| 16 | 17 | ||
| 18 | struct jump_label_key_deferred { | ||
| 19 | struct jump_label_key key; | ||
| 20 | unsigned long timeout; | ||
| 21 | struct delayed_work work; | ||
| 22 | }; | ||
| 23 | |||
| 17 | # include <asm/jump_label.h> | 24 | # include <asm/jump_label.h> |
| 18 | # define HAVE_JUMP_LABEL | 25 | # define HAVE_JUMP_LABEL |
| 19 | #endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */ | 26 | #endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */ |
| @@ -51,8 +58,11 @@ extern void arch_jump_label_transform_static(struct jump_entry *entry, | |||
| 51 | extern int jump_label_text_reserved(void *start, void *end); | 58 | extern int jump_label_text_reserved(void *start, void *end); |
| 52 | extern void jump_label_inc(struct jump_label_key *key); | 59 | extern void jump_label_inc(struct jump_label_key *key); |
| 53 | extern void jump_label_dec(struct jump_label_key *key); | 60 | extern void jump_label_dec(struct jump_label_key *key); |
| 61 | extern void jump_label_dec_deferred(struct jump_label_key_deferred *key); | ||
| 54 | extern bool jump_label_enabled(struct jump_label_key *key); | 62 | extern bool jump_label_enabled(struct jump_label_key *key); |
| 55 | extern void jump_label_apply_nops(struct module *mod); | 63 | extern void jump_label_apply_nops(struct module *mod); |
| 64 | extern void jump_label_rate_limit(struct jump_label_key_deferred *key, | ||
| 65 | unsigned long rl); | ||
| 56 | 66 | ||
| 57 | #else /* !HAVE_JUMP_LABEL */ | 67 | #else /* !HAVE_JUMP_LABEL */ |
| 58 | 68 | ||
| @@ -68,6 +78,10 @@ static __always_inline void jump_label_init(void) | |||
| 68 | { | 78 | { |
| 69 | } | 79 | } |
| 70 | 80 | ||
| 81 | struct jump_label_key_deferred { | ||
| 82 | struct jump_label_key key; | ||
| 83 | }; | ||
| 84 | |||
| 71 | static __always_inline bool static_branch(struct jump_label_key *key) | 85 | static __always_inline bool static_branch(struct jump_label_key *key) |
| 72 | { | 86 | { |
| 73 | if (unlikely(atomic_read(&key->enabled))) | 87 | if (unlikely(atomic_read(&key->enabled))) |
| @@ -85,6 +99,11 @@ static inline void jump_label_dec(struct jump_label_key *key) | |||
| 85 | atomic_dec(&key->enabled); | 99 | atomic_dec(&key->enabled); |
| 86 | } | 100 | } |
| 87 | 101 | ||
| 102 | static inline void jump_label_dec_deferred(struct jump_label_key_deferred *key) | ||
| 103 | { | ||
| 104 | jump_label_dec(&key->key); | ||
| 105 | } | ||
| 106 | |||
| 88 | static inline int jump_label_text_reserved(void *start, void *end) | 107 | static inline int jump_label_text_reserved(void *start, void *end) |
| 89 | { | 108 | { |
| 90 | return 0; | 109 | return 0; |
| @@ -102,6 +121,14 @@ static inline int jump_label_apply_nops(struct module *mod) | |||
| 102 | { | 121 | { |
| 103 | return 0; | 122 | return 0; |
| 104 | } | 123 | } |
| 124 | |||
| 125 | static inline void jump_label_rate_limit(struct jump_label_key_deferred *key, | ||
| 126 | unsigned long rl) | ||
| 127 | { | ||
| 128 | } | ||
| 105 | #endif /* HAVE_JUMP_LABEL */ | 129 | #endif /* HAVE_JUMP_LABEL */ |
| 106 | 130 | ||
| 131 | #define jump_label_key_enabled ((struct jump_label_key){ .enabled = ATOMIC_INIT(1), }) | ||
| 132 | #define jump_label_key_disabled ((struct jump_label_key){ .enabled = ATOMIC_INIT(0), }) | ||
| 133 | |||
| 107 | #endif /* _LINUX_JUMP_LABEL_H */ | 134 | #endif /* _LINUX_JUMP_LABEL_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index b1f89122bf6a..08855613ceb3 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -54,6 +54,7 @@ enum perf_hw_id { | |||
| 54 | PERF_COUNT_HW_BUS_CYCLES = 6, | 54 | PERF_COUNT_HW_BUS_CYCLES = 6, |
| 55 | PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7, | 55 | PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7, |
| 56 | PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8, | 56 | PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8, |
| 57 | PERF_COUNT_HW_REF_CPU_CYCLES = 9, | ||
| 57 | 58 | ||
| 58 | PERF_COUNT_HW_MAX, /* non-ABI */ | 59 | PERF_COUNT_HW_MAX, /* non-ABI */ |
| 59 | }; | 60 | }; |
| @@ -890,6 +891,7 @@ struct perf_event_context { | |||
| 890 | int nr_active; | 891 | int nr_active; |
| 891 | int is_active; | 892 | int is_active; |
| 892 | int nr_stat; | 893 | int nr_stat; |
| 894 | int nr_freq; | ||
| 893 | int rotate_disable; | 895 | int rotate_disable; |
| 894 | atomic_t refcount; | 896 | atomic_t refcount; |
| 895 | struct task_struct *task; | 897 | struct task_struct *task; |
| @@ -1063,12 +1065,12 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) | |||
| 1063 | } | 1065 | } |
| 1064 | } | 1066 | } |
| 1065 | 1067 | ||
| 1066 | extern struct jump_label_key perf_sched_events; | 1068 | extern struct jump_label_key_deferred perf_sched_events; |
| 1067 | 1069 | ||
| 1068 | static inline void perf_event_task_sched_in(struct task_struct *prev, | 1070 | static inline void perf_event_task_sched_in(struct task_struct *prev, |
| 1069 | struct task_struct *task) | 1071 | struct task_struct *task) |
| 1070 | { | 1072 | { |
| 1071 | if (static_branch(&perf_sched_events)) | 1073 | if (static_branch(&perf_sched_events.key)) |
| 1072 | __perf_event_task_sched_in(prev, task); | 1074 | __perf_event_task_sched_in(prev, task); |
| 1073 | } | 1075 | } |
| 1074 | 1076 | ||
| @@ -1077,7 +1079,7 @@ static inline void perf_event_task_sched_out(struct task_struct *prev, | |||
| 1077 | { | 1079 | { |
| 1078 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); | 1080 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); |
| 1079 | 1081 | ||
| 1080 | if (static_branch(&perf_sched_events)) | 1082 | if (static_branch(&perf_sched_events.key)) |
| 1081 | __perf_event_task_sched_out(prev, next); | 1083 | __perf_event_task_sched_out(prev, next); |
| 1082 | } | 1084 | } |
| 1083 | 1085 | ||
