From: Daniel Borkmann <daniel@iogearbox.net>
To: Wang Nan <wangnan0@huawei.com>, davem@davemloft.net, acme@kernel.org
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pi3orama@163.com, lizefan@huawei.com,
Adrian Hunter <adrian.hunter@intel.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Yunlong Song <yunlong.song@huawei.com>
Subject: Re: [PATCH net-next] perf/core: Put size of a sample at the end of it by PERF_SAMPLE_TAILSIZE
Date: Mon, 11 Jan 2016 18:05:10 +0100 [thread overview]
Message-ID: <5693E0C6.2080509@iogearbox.net> (raw)
In-Reply-To: <1452518653-1794-1-git-send-email-wangnan0@huawei.com>
Hi Wang,
On 01/11/2016 02:24 PM, Wang Nan wrote:
> This patch introduces a PERF_SAMPLE_TAILSIZE flag which allows a size
> field attached at the end of a sample. The idea comes from [1] that,
> with tie size at tail of an event, it is possible for user program who
> read from the ring buffer parse events backward.
>
> For example:
>
> head
> |
> V
> +--+---+-------+----------+------+---+
> |E6|...| B 8| C 11| D 7|E..|
> +--+---+-------+----------+------+---+
>
> In this case, from the 'head' pointer provided by kernel, user program
> can first see '6' by (*(head - sizeof(u64))), then it can get the start
> pointer of record 'E', then it can read size and find start position
> of record D, C, B in similar way.
>
> The implementation is easy: adding a PERF_SAMPLE_TAILSIZE flag, makes
> perf_output_sample() output size at the end of a sample.
>
> Following things are done for ensure the ring buffer is safe for
> backward parsing:
>
> - Don't allow two events with different PERF_SAMPLE_TAILSIZE setting
> set their output to each other;
>
> - For non-sample events, also output tailsize if required.
>
> This patch has a limitation for perf:
>
> 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.
>
> [1] http://lkml.kernel.org/g/1449063499-236703-1-git-send-email-wangnan0@huawei.com
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Yunlong Song <yunlong.song@huawei.com>
> Cc: David S. Miller <davem@davemloft.net>
[...]
As this seems unrelated to networking, net-next tree seems not really appropriate?
Cheers,
Daniel
next prev parent reply other threads:[~2016-01-11 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 13:24 Wang Nan
2016-01-11 17:05 ` Daniel Borkmann [this message]
2016-01-11 18:13 ` Alexei Starovoitov
2016-01-11 18:27 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5693E0C6.2080509@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
--cc=yunlong.song@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome