Re: [PATCH 1/2] tracing: kdb: Fix ftdump to not sleep
From: Steven Rostedt
Date: Tue Mar 05 2019 - 18:47:38 EST
On Tue, 5 Mar 2019 15:31:49 -0800
Douglas Anderson <dianders@xxxxxxxxxxxx> wrote:
> diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
> index 5b9ae62272bb..0c8ab8bf4cfb 100644
> --- a/include/linux/ring_buffer.h
> +++ b/include/linux/ring_buffer.h
> @@ -127,6 +127,8 @@ struct ring_buffer_event *
> ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts,
> unsigned long *lost_events);
>
> +struct ring_buffer_iter *
> +_ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu, gfp_t flags);
> struct ring_buffer_iter *
> ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu);
> void ring_buffer_read_prepare_sync(void);
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 06e864a334bb..fd60007aa7a1 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -4201,6 +4201,29 @@ ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts,
> }
> EXPORT_SYMBOL_GPL(ring_buffer_consume);
>
> +struct ring_buffer_iter *
> +_ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu, gfp_t flags)
> +{
> + struct ring_buffer_per_cpu *cpu_buffer;
I don't care for this duplicate function. ring_buffer_read_prepare() is
only used in a few places, just add flags to it and to its users.
-- Steve