aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-05-25 11:39:05 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-25 15:41:12 -0400
commita78ac3258782f3e64cb40beb5990808e1febcc0c (patch)
tree692462a974e4c26bdb7fa7fae727a6b326a0eeee /include/linux/perf_counter.h
parent48e22d56ecdeddd1ffb42a02fccba5c6ef42b133 (diff)
perf_counter: Generic per counter interrupt throttle
Introduce a generic per counter interrupt throttle. This uses the perf_counter_overflow() quick disable to throttle a specific counter when its going too fast when a pmu->unthrottle() method is provided which can undo the quick disable. Power needs to implement both the quick disable and the unthrottle method. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: John Kacur <jkacur@redhat.com> LKML-Reference: <20090525153931.703093461@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 0c160be2078f..e3a7585d3e43 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -267,6 +267,15 @@ enum perf_event_type {
267 PERF_EVENT_PERIOD = 4, 267 PERF_EVENT_PERIOD = 4,
268 268
269 /* 269 /*
270 * struct {
271 * struct perf_event_header header;
272 * u64 time;
273 * };
274 */
275 PERF_EVENT_THROTTLE = 5,
276 PERF_EVENT_UNTHROTTLE = 6,
277
278 /*
270 * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field 279 * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field
271 * will be PERF_RECORD_* 280 * will be PERF_RECORD_*
272 * 281 *
@@ -367,6 +376,7 @@ struct pmu {
367 int (*enable) (struct perf_counter *counter); 376 int (*enable) (struct perf_counter *counter);
368 void (*disable) (struct perf_counter *counter); 377 void (*disable) (struct perf_counter *counter);
369 void (*read) (struct perf_counter *counter); 378 void (*read) (struct perf_counter *counter);
379 void (*unthrottle) (struct perf_counter *counter);
370}; 380};
371 381
372/** 382/**
@@ -613,6 +623,7 @@ extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs);
613 623
614extern int sysctl_perf_counter_priv; 624extern int sysctl_perf_counter_priv;
615extern int sysctl_perf_counter_mlock; 625extern int sysctl_perf_counter_mlock;
626extern int sysctl_perf_counter_limit;
616 627
617extern void perf_counter_init(void); 628extern void perf_counter_init(void);
618 629