libperf: Avoid internal moving of fdarray fds
authorAlexey Budankov <alexey.budankov@linux.intel.com>
Fri, 17 Jul 2020 06:59:12 +0000 (09:59 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 21 Jul 2020 11:49:30 +0000 (08:49 -0300)
commit59b4412f27f1410a5b22f0244368c4d5ea00d316
treef12829e1c6aa82e7c6b6f75bab0ff984a4441a35
parent070b3b5ad7bd077e673cad2c591a2ecf49c0b58a
libperf: Avoid internal moving of fdarray fds

Avoid moving of fds by fdarray__filter() so fds indices returned by
fdarray__add() can be used for access and processing of objects at
struct pollfd *entries.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/676844f8-55d3-c628-23db-aa163a81519e@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/api/fd/array.c
tools/perf/tests/fdarray.c