diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-12-04 14:12:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-08 09:47:03 -0500 |
commit | 0793a61d4df8daeac6492dbf8d2f3e5713caae5e (patch) | |
tree | cc9603eb8daffeb7ace521c42a6a44db164ac551 /include/linux/sched.h | |
parent | b5aa97e83bcc31a96374d18f5452d53909a16c90 (diff) |
performance counters: core code
Implement the core kernel bits of Performance Counters subsystem.
The Linux Performance Counter subsystem provides an abstraction of
performance counter hardware capabilities. It provides per task and per
CPU counters, and it provides event capabilities on top of those.
Performance counters are accessed via special file descriptors.
There's one file descriptor per virtual counter used.
The special file descriptor is opened via the perf_counter_open()
system call:
int
perf_counter_open(u32 hw_event_type,
u32 hw_event_period,
u32 record_type,
pid_t pid,
int cpu);
The syscall returns the new fd. The fd can be used via the normal
VFS system calls: read() can be used to read the counter, fcntl()
can be used to set the blocking mode, etc.
Multiple counters can be kept open at a time, and the counters
can be poll()ed.
See more details in Documentation/perf-counters.txt.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 55e30d114477..4c530278391b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -71,6 +71,7 @@ struct sched_param { | |||
71 | #include <linux/fs_struct.h> | 71 | #include <linux/fs_struct.h> |
72 | #include <linux/compiler.h> | 72 | #include <linux/compiler.h> |
73 | #include <linux/completion.h> | 73 | #include <linux/completion.h> |
74 | #include <linux/perf_counter.h> | ||
74 | #include <linux/pid.h> | 75 | #include <linux/pid.h> |
75 | #include <linux/percpu.h> | 76 | #include <linux/percpu.h> |
76 | #include <linux/topology.h> | 77 | #include <linux/topology.h> |
@@ -1326,6 +1327,7 @@ struct task_struct { | |||
1326 | struct list_head pi_state_list; | 1327 | struct list_head pi_state_list; |
1327 | struct futex_pi_state *pi_state_cache; | 1328 | struct futex_pi_state *pi_state_cache; |
1328 | #endif | 1329 | #endif |
1330 | struct perf_counter_context perf_counter_ctx; | ||
1329 | #ifdef CONFIG_NUMA | 1331 | #ifdef CONFIG_NUMA |
1330 | struct mempolicy *mempolicy; | 1332 | struct mempolicy *mempolicy; |
1331 | short il_next; | 1333 | short il_next; |
@@ -2285,6 +2287,13 @@ static inline void inc_syscw(struct task_struct *tsk) | |||
2285 | #define TASK_SIZE_OF(tsk) TASK_SIZE | 2287 | #define TASK_SIZE_OF(tsk) TASK_SIZE |
2286 | #endif | 2288 | #endif |
2287 | 2289 | ||
2290 | /* | ||
2291 | * Call the function if the target task is executing on a CPU right now: | ||
2292 | */ | ||
2293 | extern void task_oncpu_function_call(struct task_struct *p, | ||
2294 | void (*func) (void *info), void *info); | ||
2295 | |||
2296 | |||
2288 | #ifdef CONFIG_MM_OWNER | 2297 | #ifdef CONFIG_MM_OWNER |
2289 | extern void mm_update_next_owner(struct mm_struct *mm); | 2298 | extern void mm_update_next_owner(struct mm_struct *mm); |
2290 | extern void mm_init_owner(struct mm_struct *mm, struct task_struct *p); | 2299 | extern void mm_init_owner(struct mm_struct *mm, struct task_struct *p); |