diff options
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) |