Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128217
b: refs/heads/master
c: d9928c2
h: refs/heads/master
i:
  128215: 0774b84
v: v3
  • Loading branch information
Robert Richter committed Jan 7, 2009
1 parent 25f1268 commit ffec7bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae735e9964b4584923f2997d98a8d80ae9c1a75c
refs/heads/master: d9928c25a6960cf128c2078a89fe6f8e0180ff60
2 changes: 1 addition & 1 deletion trunk/drivers/oprofile/cpu_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ op_add_code(struct oprofile_cpu_buffer *cpu_buf, unsigned long backtrace,
sample->event = flags;

if (size)
sample->data[0] = (unsigned long)task;
op_cpu_buffer_add_data(&entry, (unsigned long)task);

op_cpu_buffer_write_commit(&entry);

Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/oprofile/cpu_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ int op_cpu_buffer_write_commit(struct op_entry *entry);
struct op_sample *op_cpu_buffer_read_entry(struct op_entry *entry, int cpu);
unsigned long op_cpu_buffer_entries(int cpu);

/* returns the remaining free size of data in the entry */
static inline
int op_cpu_buffer_add_data(struct op_entry *entry, unsigned long val)
{
if (!entry->size)
return 0;
*entry->data = val;
entry->size--;
entry->data++;
return entry->size;
}

/* extra data flags */
#define KERNEL_CTX_SWITCH (1UL << 0)
#define IS_KERNEL (1UL << 1)
Expand Down

0 comments on commit ffec7bf

Please sign in to comment.