summaryrefslogtreecommitdiffstats
path: root/drivers/oprofile
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-01-07 21:50:22 +0100
committerRobert Richter <robert.richter@amd.com>2009-01-07 22:48:15 +0100
commit14f0ca8eaea42a5b5a69cfcb699665dd2618db5f (patch)
tree918cdb7d3ace9c84811bc606db631a1dc68496f7 /drivers/oprofile
parentoprofile: remove #ifdef CONFIG_OPROFILE_IBS in non-ibs code (diff)
downloadlinux-14f0ca8eaea42a5b5a69cfcb699665dd2618db5f.tar.xz
linux-14f0ca8eaea42a5b5a69cfcb699665dd2618db5f.zip
oprofile: make new cpu buffer functions part of the api
This patch creates the new functions oprofile_write_reserve() oprofile_add_data() oprofile_write_commit() and makes them part of the oprofile api. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile')
-rw-r--r--drivers/oprofile/cpu_buffer.c17
-rw-r--r--drivers/oprofile/cpu_buffer.h8
2 files changed, 15 insertions, 10 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index b846af632c81..2e03b6d796d3 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -364,10 +364,11 @@ void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
/*
* Add samples with data to the ring buffer.
*
- * Use op_cpu_buffer_add_data(&entry, val) to add data and
- * op_cpu_buffer_write_commit(&entry) to commit the sample.
+ * Use oprofile_add_data(&entry, val) to add data and
+ * oprofile_write_commit(&entry) to commit the sample.
*/
-void oprofile_add_data(struct op_entry *entry, struct pt_regs * const regs,
+void
+oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs,
unsigned long pc, int code, int size)
{
struct op_sample *sample;
@@ -395,6 +396,16 @@ fail:
cpu_buf->sample_lost_overflow++;
}
+int oprofile_add_data(struct op_entry *entry, unsigned long val)
+{
+ return op_cpu_buffer_add_data(entry, val);
+}
+
+int oprofile_write_commit(struct op_entry *entry)
+{
+ return op_cpu_buffer_write_commit(entry);
+}
+
void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
{
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer);
diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h
index 525cc4d13d8d..63f81c44846a 100644
--- a/drivers/oprofile/cpu_buffer.h
+++ b/drivers/oprofile/cpu_buffer.h
@@ -35,13 +35,7 @@ struct op_sample {
unsigned long data[0];
};
-struct op_entry {
- struct ring_buffer_event *event;
- struct op_sample *sample;
- unsigned long irq_flags;
- unsigned long size;
- unsigned long *data;
-};
+struct op_entry;
struct oprofile_cpu_buffer {
unsigned long buffer_size;