[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151203100801.GV3816@twins.programming.kicks-ass.net>
Date: Thu, 3 Dec 2015 11:08:01 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Wang Nan <wangnan0@...wei.com>
Cc: acme@...hat.com, paulus@...ba.org, kan.liang@...el.com,
linux-kernel@...r.kernel.org, pi3orama@....com, lizefen@...wei.com,
Adrian Hunter <adrian.hunter@...el.com>,
David Ahern <dsahern@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Yunlong Song <yunlong.song@...wei.com>
Subject: Re: [RFC PATCH] perf/core: Put size of a sample at the end of it
On Wed, Dec 02, 2015 at 01:38:19PM +0000, Wang Nan wrote:
> This sloution requires user program (perf) do more things. At least
> following things and limitations should be considered:
>
> 1. Before reading such ring buffer, perf must ensure all events which
> may output to it is already stopped, so the 'head' pointer it get
> is the end of the last record.
Right, this is tricky, this would not allow two snapshots to happen back
to back since that would then result in a bunch of missed events.
Aside from this issue its a rather nice idea.
> 2. We must ensure all events attached this ring buffer has
> 'PERF_SAMPLE_SIZE' selected.
That can be easily enforced.
> 3. There must no tracking events output to this ring buffer.
That is rather unfortunate, we'd best fix that up.
> 4. 2 bytes extra space is required for each record.
8, perf records must be 8 byte aligned and sized.
> Further improvement can be taken:
>
> 1. If PERF_SAMPLE_SIZE is selected, we can avoid outputting the event
> size in header. Which eliminate extra space cose;
That would mandate you always parse the stream backwards. Which seems
rather unfortunate. Also, no you cannot recoup the extra space, see the
alignment and size requirement.
> 2. We can find a way to append size information for tracking events
> also.
The !sample records you mean? Yes those had better have them too.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists