lkml.org 
[lkml]   [2008]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/9] oprofile: port to the new ring_buffer
On Thu, 11 Dec 2008 17:42:00 +0100 Robert Richter <robert.richter@amd.com> wrote:

> -static inline
> -struct op_sample *cpu_buffer_read_entry(struct oprofile_cpu_buffer *cpu_buf)
> +static inline struct op_sample *cpu_buffer_read_entry(int cpu)
> {
> - return &cpu_buf->buffer[cpu_buf->tail_pos];
> + struct ring_buffer_event *e;
> + e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
> + if (e)
> + return ring_buffer_event_data(e);
> + if (ring_buffer_swap_cpu(op_ring_buffer_read,
> + op_ring_buffer_write,
> + cpu))
> + return NULL;
> + e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
> + if (e)
> + return ring_buffer_event_data(e);
> + return NULL;
> }

This file has some really large inlined functions.
cpu_buffer_read_entry() has three callsites..


\
 
 \ /
  Last update: 2008-12-16 10:41    [W:0.184 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site