Re: Rotation of instance traces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 18, 2022 at 2:28 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Fri, 18 Feb 2022 14:22:16 -0500
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > Now to be able to do things like splice, and zero copy from the ring
> > buffer, when you read the ring buffer it swaps out a sub buffer from the
> > writable portion of the ring buffer and makes it into the "reader_page".
> > The reader page is now own by the reader, and will never be written to.
>
> I need to correct that statement about never being written to. It can be.
> If the current write head is on the page as it gets swapped out and becomes
> the reader page. A new write will happen on the reader page, but once the
> writer walks off the reader page and into the main ring buffer, it will
> never touch the reader page again.
>
> The read logic detects this, and will do copies of the page to send it to
> the user as it can not give the page itself to the user with the writer
> still on it.

Thanks Steve! I went over your email and it makes sense. I also cannot
reproduce this issue any more so I don't know what I did :P.  I was
messing with the buffer_size_kb while doing reads from 'trace', so
maybe I managed to get the read page in a weird state? Anyway, I think
I am going to collect these traces only with 'trace_pipe_raw' , so as
long as the data in the ring buffer is consistent, that's good.

I was mostly concerned about the validity/integrity of the data stored
since the 'trace' made it look like a corruption :P , when I was doing
"head -n 40 trace" , I was seeing the timestamps of the first couple
of records updating, but the data remained the same. Almost as if, the
header of the record was changing but not the payload. I am not sure
if you have seen anything like that.

Thanks,
             Joel



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux