diff options
author | Robert Richter <robert.richter@amd.com> | 2009-01-07 15:50:22 -0500 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-01-07 16:48:15 -0500 |
commit | 14f0ca8eaea42a5b5a69cfcb699665dd2618db5f (patch) | |
tree | 918cdb7d3ace9c84811bc606db631a1dc68496f7 /drivers/oprofile | |
parent | ebf8d974e298018f0b4ee02b1b097bf5500d3d27 (diff) |
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.c | 17 | ||||
-rw-r--r-- | drivers/oprofile/cpu_buffer.h | 8 |
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) | |||
364 | /* | 364 | /* |
365 | * Add samples with data to the ring buffer. | 365 | * Add samples with data to the ring buffer. |
366 | * | 366 | * |
367 | * Use op_cpu_buffer_add_data(&entry, val) to add data and | 367 | * Use oprofile_add_data(&entry, val) to add data and |
368 | * op_cpu_buffer_write_commit(&entry) to commit the sample. | 368 | * oprofile_write_commit(&entry) to commit the sample. |
369 | */ | 369 | */ |
370 | void oprofile_add_data(struct op_entry *entry, struct pt_regs * const regs, | 370 | void |
371 | oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs, | ||
371 | unsigned long pc, int code, int size) | 372 | unsigned long pc, int code, int size) |
372 | { | 373 | { |
373 | struct op_sample *sample; | 374 | struct op_sample *sample; |
@@ -395,6 +396,16 @@ fail: | |||
395 | cpu_buf->sample_lost_overflow++; | 396 | cpu_buf->sample_lost_overflow++; |
396 | } | 397 | } |
397 | 398 | ||
399 | int oprofile_add_data(struct op_entry *entry, unsigned long val) | ||
400 | { | ||
401 | return op_cpu_buffer_add_data(entry, val); | ||
402 | } | ||
403 | |||
404 | int oprofile_write_commit(struct op_entry *entry) | ||
405 | { | ||
406 | return op_cpu_buffer_write_commit(entry); | ||
407 | } | ||
408 | |||
398 | void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event) | 409 | void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event) |
399 | { | 410 | { |
400 | struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer); | 411 | 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 { | |||
35 | unsigned long data[0]; | 35 | unsigned long data[0]; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | struct op_entry { | 38 | struct op_entry; |
39 | struct ring_buffer_event *event; | ||
40 | struct op_sample *sample; | ||
41 | unsigned long irq_flags; | ||
42 | unsigned long size; | ||
43 | unsigned long *data; | ||
44 | }; | ||
45 | 39 | ||
46 | struct oprofile_cpu_buffer { | 40 | struct oprofile_cpu_buffer { |
47 | unsigned long buffer_size; | 41 | unsigned long buffer_size; |