Re: ftrace trace_raw_pipe format

From: Steven Rostedt
Date: Tue Dec 17 2019 - 17:47:36 EST


On Tue, 17 Dec 2019 17:34:03 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> static void read_raw_buffer(int i, const char *buffer)
> {
> struct trace_seq s;
> char buf[page_size];
> int fd;
> int r;
>
> printf("Parsing CPU %d buffer\n", i);
>
> fd = open(buffer, O_RDONLY);

Changing the above to:

fd = open(buffer, O_RDONLY|O_NONBLOCK);

Will then not make it block on empty buffers.

-- Steve

> if (fd < 0)
> pdie("Failed to open %s", buffer);