diff options
author | Robert Richter <robert.richter@amd.com> | 2009-06-03 14:54:56 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-06-11 14:16:00 -0400 |
commit | 51563a0e5650d0d76539625388d72d62b34c726e (patch) | |
tree | 17148f56578af8f7d7d67491f8b7eb05d99acdd9 /drivers/oprofile/cpu_buffer.c | |
parent | c572ae4efd1b0a5cc76c5e6aae05c1b182b6a69c (diff) |
x86/oprofile: introduce oprofile_add_data64()
The IBS implemention writes 64 bit register values to the cpu buffer
by writing two 32 values using oprofile_add_data(). This patch
introduces oprofile_add_data64() to write a single 64 bit value to the
buffer.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile/cpu_buffer.c')
-rw-r--r-- | drivers/oprofile/cpu_buffer.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index 50640cc5eef2..a7aae24f2889 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c | |||
@@ -406,6 +406,21 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val) | |||
406 | return op_cpu_buffer_add_data(entry, val); | 406 | return op_cpu_buffer_add_data(entry, val); |
407 | } | 407 | } |
408 | 408 | ||
409 | int oprofile_add_data64(struct op_entry *entry, u64 val) | ||
410 | { | ||
411 | if (!entry->event) | ||
412 | return 0; | ||
413 | if (op_cpu_buffer_get_size(entry) < 2) | ||
414 | /* | ||
415 | * the function returns 0 to indicate a too small | ||
416 | * buffer, even if there is some space left | ||
417 | */ | ||
418 | return 0; | ||
419 | if (!op_cpu_buffer_add_data(entry, (u32)val)) | ||
420 | return 0; | ||
421 | return op_cpu_buffer_add_data(entry, (u32)(val >> 32)); | ||
422 | } | ||
423 | |||
409 | int oprofile_write_commit(struct op_entry *entry) | 424 | int oprofile_write_commit(struct op_entry *entry) |
410 | { | 425 | { |
411 | if (!entry->event) | 426 | if (!entry->event) |