From f3069249e9e6b0ce303c3547dfa2960ee2e95b61 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Tue, 28 Jun 2016 13:29:02 +0200 Subject: perf tools: Allow to reset open files counter I hit a bug when running test suite without forking each test (-F option): $ perf test -F dso 8: Test dso data read : Ok 9: Test dso data cache : FAILED! 10: Test dso data reopen : FAILED! The reason the session file limit is set just once for perf process so we need to reset it for each test, otherwise wrong limit is taken into account. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Tested-by: Nilay Vaish Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1467113345-12669-2-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/dso-data.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/perf/tests/dso-data.c') diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c index 8cf0d9e189a8..13725e09ba22 100644 --- a/tools/perf/tests/dso-data.c +++ b/tools/perf/tests/dso-data.c @@ -251,6 +251,9 @@ int test__dso_data_cache(int subtest __maybe_unused) long nr_end, nr = open_files_cnt(); int dso_cnt, limit, i, fd; + /* Rest the internal dso open counter limit. */ + reset_fd_limit(); + memset(&machine, 0, sizeof(machine)); /* set as system limit */ @@ -312,6 +315,9 @@ int test__dso_data_reopen(int subtest __maybe_unused) #define dso_1 (dsos[1]) #define dso_2 (dsos[2]) + /* Rest the internal dso open counter limit. */ + reset_fd_limit(); + memset(&machine, 0, sizeof(machine)); /* -- cgit v1.2.3