Re: [PATCH 6/9] oprofile: port to the new ring_buffer

From: Andrew Morton
Date: Tue Dec 16 2008 - 04:38:09 EST


On Thu, 11 Dec 2008 17:42:00 +0100 Robert Richter <robert.richter@xxxxxxx> 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..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/