Commit-ID:  2b4383470675c85add72725cc08840d36b409276
Gitweb:     http://git.kernel.org/tip/2b4383470675c85add72725cc08840d36b409276
Author:     Wang Nan <wangn...@huawei.com>
AuthorDate: Thu, 14 Jul 2016 08:34:34 +0000
Committer:  Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate: Fri, 15 Jul 2016 17:27:46 -0300

tools lib fd array: Allow associating a pointer cookie with each entry

Add a 'ptr' field to fdarray->priv array.

This feature will be used by following commits, which introduce
muiltiple 'struct perf_mmap' arrays for different types of mapping.

Because of this, during fdarray__filter(), a simple 'idx' is not enough.

Add a pointer cookie that allows to directly associate a 'struct
perf_mmap' pointer to an fdarray entry.

Signed-off-by: Wang Nan <wangn...@huawei.com>
Acked-by: Jiri Olsa <jo...@kernel.org>
Cc: Adrian Hunter <adrian.hun...@intel.com>
Cc: David Ahern <dsah...@gmail.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Masami Hiramatsu <mhira...@kernel.org>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Nilay Vaish <nilayva...@gmail.com>
Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
Cc: Zefan Li <lize...@huawei.com>
Cc: pi3or...@163.com
Link: 
http://lkml.kernel.org/r/1468485287-33422-3-git-send-email-wangn...@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 tools/lib/api/fd/array.h | 1 +
 1 file changed, 1 insertion(+)

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

Reply via email to