Hopefully get the Kconfig PCI stuff right, finally.
[linux-2.6/linux-mips.git] / drivers / oprofile / cpu_buffer.h
blob66eafcdb12eef03a31810176fb86caf03c845040
1 /**
2 * @file cpu_buffer.h
4 * @remark Copyright 2002 OProfile authors
5 * @remark Read the file COPYING
7 * @author John Levon <levon@movementarian.org>
8 */
10 #ifndef OPROFILE_CPU_BUFFER_H
11 #define OPROFILE_CPU_BUFFER_H
13 #include <linux/types.h>
14 #include <linux/spinlock.h>
15 #include <linux/cache.h>
17 struct task_struct;
19 /* allocate a sample buffer for each CPU */
20 int alloc_cpu_buffers(void);
22 void free_cpu_buffers(void);
24 /* CPU buffer is composed of such entries (which are
25 * also used for context switch notes)
27 struct op_sample {
28 unsigned long eip;
29 unsigned long event;
32 struct oprofile_cpu_buffer {
33 volatile unsigned long head_pos;
34 volatile unsigned long tail_pos;
35 unsigned long buffer_size;
36 struct task_struct * last_task;
37 int last_is_kernel;
38 struct op_sample * buffer;
39 unsigned long sample_received;
40 unsigned long sample_lost_overflow;
41 unsigned long sample_lost_task_exit;
42 } ____cacheline_aligned;
44 extern struct oprofile_cpu_buffer cpu_buffer[];
46 void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf);
48 #endif /* OPROFILE_CPU_BUFFER_H */