diff options
Diffstat (limited to 'arch/alpha/kernel/time.c')
-rw-r--r-- | arch/alpha/kernel/time.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 1efbed82c0fd..eacceb26d9c8 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
42 | #include <linux/bcd.h> | 42 | #include <linux/bcd.h> |
43 | #include <linux/profile.h> | 43 | #include <linux/profile.h> |
44 | #include <linux/perf_event.h> | ||
44 | 45 | ||
45 | #include <asm/uaccess.h> | 46 | #include <asm/uaccess.h> |
46 | #include <asm/io.h> | 47 | #include <asm/io.h> |
@@ -82,6 +83,26 @@ static struct { | |||
82 | 83 | ||
83 | unsigned long est_cycle_freq; | 84 | unsigned long est_cycle_freq; |
84 | 85 | ||
86 | #ifdef CONFIG_PERF_EVENTS | ||
87 | |||
88 | DEFINE_PER_CPU(u8, perf_event_pending); | ||
89 | |||
90 | #define set_perf_event_pending_flag() __get_cpu_var(perf_event_pending) = 1 | ||
91 | #define test_perf_event_pending() __get_cpu_var(perf_event_pending) | ||
92 | #define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0 | ||
93 | |||
94 | void set_perf_event_pending(void) | ||
95 | { | ||
96 | set_perf_event_pending_flag(); | ||
97 | } | ||
98 | |||
99 | #else /* CONFIG_PERF_EVENTS */ | ||
100 | |||
101 | #define test_perf_event_pending() 0 | ||
102 | #define clear_perf_event_pending() | ||
103 | |||
104 | #endif /* CONFIG_PERF_EVENTS */ | ||
105 | |||
85 | 106 | ||
86 | static inline __u32 rpcc(void) | 107 | static inline __u32 rpcc(void) |
87 | { | 108 | { |
@@ -175,6 +196,11 @@ irqreturn_t timer_interrupt(int irq, void *dev) | |||
175 | update_process_times(user_mode(get_irq_regs())); | 196 | update_process_times(user_mode(get_irq_regs())); |
176 | #endif | 197 | #endif |
177 | 198 | ||
199 | if (test_perf_event_pending()) { | ||
200 | clear_perf_event_pending(); | ||
201 | perf_event_do_pending(); | ||
202 | } | ||
203 | |||
178 | return IRQ_HANDLED; | 204 | return IRQ_HANDLED; |
179 | } | 205 | } |
180 | 206 | ||