[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160224142146.GD27710@krava.redhat.com>
Date: Wed, 24 Feb 2016 15:21:46 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Wang Nan <wangnan0@...wei.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Brendan Gregg <brendan.d.gregg@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Cody P Schafer <dev@...yps.com>,
"David S. Miller" <davem@...emloft.net>,
He Kuang <hekuang@...wei.com>,
Jérémie Galarneau
<jeremie.galarneau@...icios.com>, Jiri Olsa <jolsa@...nel.org>,
Kirill Smelkov <kirr@...edi.com>,
Li Zefan <lizefan@...wei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, pi3orama@....com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 18/48] perf tools: Only validate is_pos for tracking
evsels
On Mon, Feb 22, 2016 at 09:10:45AM +0000, Wang Nan wrote:
> is_pos only useful for tracking events (fork, mmap, exit, ...).
> Perf collects those events through evsel with 'tracking' set.
> Therefore, there's no need to validate every is_pos against
> evlist->is_pos.
>
> This patch is required after perf support PERF_SAMPLE_TAILSIZE.
> Since there an extra u64 at the end of this type of evsels, is_pos
> for evsel with PERF_SAMPLE_TAILSIZE setting is different from other
> evsels.
>
> Signed-off-by: Wang Nan <wangnan0@...wei.com>
> Signed-off-by: He Kuang <hekuang@...wei.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Jiri Olsa <jolsa@...nel.org>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Zefan Li <lizefan@...wei.com>
> Cc: pi3orama@....com
> ---
> tools/perf/util/evlist.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index c42e196..fef465a 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -1274,8 +1274,15 @@ bool perf_evlist__valid_sample_type(struct perf_evlist *evlist)
> return false;
>
> evlist__for_each(evlist, pos) {
> - if (pos->id_pos != evlist->id_pos ||
> - pos->is_pos != evlist->is_pos)
> + if (pos->id_pos != evlist->id_pos)
> + return false;
> + /*
> + * Only tracking events needs is_pos. Those events are
> + * collected if evsel->tracking is selected.
> + * For other evsel, is_pos is useless for other evsels,
typo in comment above ^^^ using twice 'other evsel'
> + * so skip validating them.
> + */
> + if (pos->tracking && pos->is_pos != evlist->is_pos)
> return false;
> }
>
> --
> 1.8.3.4
>
Powered by blists - more mailing lists