tools lib fd array: Allow associating a pointer cookie with each entry
authorWang Nan <[email protected]>
Thu, 14 Jul 2016 08:34:34 +0000 (08:34 +0000)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 15 Jul 2016 20:27:46 +0000 (17:27 -0300)
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 <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: He Kuang <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Nilay Vaish <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Zefan Li <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/lib/api/fd/array.h

index e87fd800fa8d38f0400e352280a70761afd518ee..71287dddc05fbf7ba58772fc7833a1a6d1505f13 100644 (file)
@@ -22,6 +22,7 @@ struct fdarray {
        struct pollfd *entries;
        union {
                int    idx;
+               void   *ptr;
        } *priv;
 };