From: Wang Nan Date: Thu, 14 Jul 2016 08:34:34 +0000 (+0000) Subject: tools lib fd array: Allow associating a pointer cookie with each entry X-Git-Tag: MMI-PSA29.97-13-9~7534^2~2^2~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b4383470675c85add72725cc08840d36b409276;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: David Ahern Cc: He Kuang Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Nilay Vaish Cc: Peter Zijlstra Cc: Zefan Li Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1468485287-33422-3-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h index e87fd800fa8d..71287dddc05f 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; };