All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Wang Nan <wangnan0@huawei.com>
Cc: acme@kernel.org, lizefan@huawei.com,
	linux-kernel@vger.kernel.org, pi3orama@163.com,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	He Kuang <hekuang@huawei.com>, Jiri Olsa <jolsa@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Nilay Vaish <nilayvaish@gmail.com>
Subject: Re: [PATCH v16 05/15] perf tools: Record mmap cookie into fdarray private field
Date: Fri, 15 Jul 2016 16:59:35 +0200	[thread overview]
Message-ID: <20160715145935.GB29695@krava> (raw)
In-Reply-To: <1468485287-33422-6-git-send-email-wangnan0@huawei.com>

On Thu, Jul 14, 2016 at 08:34:37AM +0000, Wang Nan wrote:
> Insetad of saving a index into fdarray entries private field, save the
> corresponding 'struct perf_mmap' pointer, and release them directly
> using perf_mmap__put().
> 
> Following commits introduce multiple mmap arrays to evlist. Without this
> patch, perf_evlist__munmap_filtered() is unable to retrive correct
> 'struct perf_mmap' pointer.
> 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: He Kuang <hekuang@huawei.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Zefan Li <lizefan@huawei.com>
> Cc: Nilay Vaish <nilayvaish@gmail.com>
> Cc: pi3orama@163.com
> ---
>  tools/perf/util/evlist.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index a4137e0..1462085 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -30,6 +30,7 @@
>  static void perf_evlist__mmap_put(struct perf_evlist *evlist, int idx);
>  static void __perf_evlist__munmap(struct perf_evlist *evlist, int idx);
>  static void perf_mmap__munmap(struct perf_mmap *map);
> +static void perf_mmap__put(struct perf_mmap *map);
>  
>  #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
>  #define SID(e, x, y) xyarray__entry(e->sample_id, x, y)
> @@ -466,7 +467,8 @@ int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
>  	return 0;
>  }
>  
> -static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd, int idx, short revent)
> +static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd,
> +				     struct perf_mmap *map, short revent)
>  {
>  	int pos = fdarray__add(&evlist->pollfd, fd, revent | POLLERR | POLLHUP);
>  	/*
> @@ -474,7 +476,7 @@ static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd, int idx
>  	 * close the associated evlist->mmap[] entry.
>  	 */
>  	if (pos >= 0) {
> -		evlist->pollfd.priv[pos].idx = idx;
> +		evlist->pollfd.priv[pos].ptr = map;

looks like there's no user for idx now, patch below compiles for me
I guess we should remove it..

jirka


---
diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h
index 71287dddc05f..54041a4ded39 100644
--- a/tools/lib/api/fd/array.h
+++ b/tools/lib/api/fd/array.h
@@ -21,7 +21,6 @@ struct fdarray {
 	int	       nr_autogrow;
 	struct pollfd *entries;
 	union {
-		int    idx;
 		void   *ptr;
 	} *priv;
 };

  reply	other threads:[~2016-07-15 14:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14  8:34 [PATCH v16 00/15] perf tools: Support overwritable ring buffer Wang Nan
2016-07-14  8:34 ` [PATCH v16 01/15] perf tools: Drop redundant evsel->overwrite indicator Wang Nan
2016-07-16 20:45   ` [tip:perf/core] perf evlist: " tip-bot for Arnaldo Carvalho de Melo
2016-07-14  8:34 ` [PATCH v16 02/15] tools lib fd array: Allow associating a pointer cookie with each entry Wang Nan
2016-07-16 20:46   ` [tip:perf/core] " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 03/15] perf tools: Update perf evlist mmap related APIs and helpers Wang Nan
2016-07-16 20:46   ` [tip:perf/core] perf evlist: Update " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 04/15] perf tools: Decouple record__mmap_read() and evlist Wang Nan
2016-07-16 20:47   ` [tip:perf/core] perf record: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 05/15] perf tools: Record mmap cookie into fdarray private field Wang Nan
2016-07-15 14:59   ` Jiri Olsa [this message]
2016-07-16 20:47   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 06/15] perf tools: Extract common code in mmap failure processing Wang Nan
2016-07-16 20:48   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 07/15] perf tools: Introduce backward_mmap array for evlist Wang Nan
2016-07-16 20:48   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 08/15] perf tools: Map backward events to backward_mmap Wang Nan
2016-07-16 20:48   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 09/15] perf tools: Drop evlist->backward Wang Nan
2016-07-16 20:49   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 10/15] perf tools: Setup backward mmap state machine Wang Nan
2016-07-16 20:49   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 11/15] perf record: Read from overwritable ring buffer Wang Nan
2016-07-16 20:50   ` [tip:perf/core] " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 12/15] perf tools: Make perf_evlist__{pause,resume} internal helpers Wang Nan
2016-07-16 20:50   ` [tip:perf/core] perf evlist: Make {pause,resume} " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 13/15] perf tools: Enable overwrite settings Wang Nan
2016-07-16 20:50   ` [tip:perf/core] " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 14/15] perf tools: Don't warn about out of order event if write_backward is used Wang Nan
2016-07-15 14:59   ` Jiri Olsa
2016-07-16 20:51   ` [tip:perf/core] perf session: " tip-bot for Wang Nan
2016-07-14  8:34 ` [PATCH v16 15/15] perf tools: Add --tail-synthesize option Wang Nan
2016-07-16 20:51   ` [tip:perf/core] perf record: " tip-bot for Wang Nan
2016-07-15 15:00 ` [PATCH v16 00/15] perf tools: Support overwritable ring buffer Jiri Olsa

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=20160715145935.GB29695@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=hekuang@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=nilayvaish@gmail.com \
    --cc=pi3orama@163.com \
    --cc=wangnan0@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.