lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ftrace trace_raw_pipe format
On Tue, 17 Dec 2019 17:34:03 -0500
Steven Rostedt <rostedt@goodmis.org> 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);

\
 
 \ /
  Last update: 2019-12-17 23:48    [W:0.055 / U:20.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site