Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129986
b: refs/heads/master
c: fdb6a8f
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Jan 17, 2009
1 parent 100e43a commit cc9dffb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c903ff837909ccada51243307d4239f86af40179
refs/heads/master: fdb6a8f4db813b4e50f4e975efe6be12ba5bf460
5 changes: 5 additions & 0 deletions trunk/drivers/oprofile/cpu_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,21 @@ oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs,
return;

fail:
entry->event = NULL;
cpu_buf->sample_lost_overflow++;
}

int oprofile_add_data(struct op_entry *entry, unsigned long val)
{
if (!entry->event)
return 0;
return op_cpu_buffer_add_data(entry, val);
}

int oprofile_write_commit(struct op_entry *entry)
{
if (!entry->event)
return -EINVAL;
return op_cpu_buffer_write_commit(entry);
}

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/oprofile/cpu_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ static inline void op_cpu_buffer_reset(int cpu)
cpu_buf->last_task = NULL;
}

/*
* op_cpu_buffer_add_data() and op_cpu_buffer_write_commit() may be
* called only if op_cpu_buffer_write_reserve() did not return NULL or
* entry->event != NULL, otherwise entry->size or entry->event will be
* used uninitialized.
*/

struct op_sample
*op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size);
int op_cpu_buffer_write_commit(struct op_entry *entry);
Expand Down

0 comments on commit cc9dffb

Please sign in to comment.