From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 01/21] perf test: Fix dso cache testcase
Date: Wed, 11 Feb 2015 18:08:55 -0300 [thread overview]
Message-ID: <1423688955-8094-2-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1423688955-8094-1-git-send-email-acme@kernel.org>
From: Namhyung Kim <namhyung@kernel.org>
The current dso cache permits to keep dso->data.fd is open under a half
of open file limit. But test__dso_data_cache() sets dso_cnt to limit /
2 + 1 so it'll reach the limit in the loop even though the loop count is
one less than the dso_cnt and it makes the final dso__data_fd() after
the loop meaningless.
I guess the intention was dsos[0]->data.fd is open before the last open
and gets closed after it. So add an assert before the last open.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1422585209-32742-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/dso-data.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index caaf37f079b1..22a8c428283a 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -243,8 +243,8 @@ int test__dso_data_cache(void)
limit = nr * 4;
TEST_ASSERT_VAL("failed to set file limit", !set_fd_limit(limit));
- /* and this is now our dso open FDs limit + 1 extra */
- dso_cnt = limit / 2 + 1;
+ /* and this is now our dso open FDs limit */
+ dso_cnt = limit / 2;
TEST_ASSERT_VAL("failed to create dsos\n",
!dsos__create(dso_cnt, TEST_FILE_SIZE));
@@ -268,7 +268,10 @@ int test__dso_data_cache(void)
}
}
- /* open +1 dso over the allowed limit */
+ /* verify the first one is already open */
+ TEST_ASSERT_VAL("dsos[0] is not open", dsos[0]->data.fd != -1);
+
+ /* open +1 dso to reach the allowed limit */
fd = dso__data_fd(dsos[i], &machine);
TEST_ASSERT_VAL("failed to get fd", fd > 0);
--
1.9.3
next prev parent reply other threads:[~2015-02-11 21:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 21:08 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-02-11 21:08 ` Arnaldo Carvalho de Melo [this message]
2015-02-11 21:08 ` [PATCH 02/21] perf tests: Do not rely on dso__data_read_offset() to open dso Arnaldo Carvalho de Melo
2015-02-11 21:08 ` [PATCH 03/21] perf tools: Fix a dso open fail message Arnaldo Carvalho de Melo
2015-02-11 21:08 ` [PATCH 04/21] perf probe: Fix to handle optimized not-inlined functions Arnaldo Carvalho de Melo
2015-02-11 21:08 ` [PATCH 05/21] perf probe: Update man page Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 06/21] perf symbols: Ignore mapping symbols on aarch64 Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 07/21] perf symbols: debuglink should take symfs option into account Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 08/21] tools lib traceevent: Introduce trace_seq_do_fprintf function Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 09/21] perf tools: Introduce event_format__fprintf method Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 10/21] perf trace: No need to enable evsels for workload started from perf Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 11/21] perf evlist: Fix typo in comment Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 12/21] perf tools: Do not check debugfs MAGIC for tracing files Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 13/21] tools lib fs: Add helper to find mounted file systems Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 14/21] tools lib api fs: Add tracefs mount helper functions Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 15/21] tools lib api debugfs: Add DEBUGFS_DEFAULT_PATH macro Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 16/21] tools lib api fs: Add {tracefs,debugfs}_configured() functions Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 17/21] perf tools: Make perf aware of tracefs Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 19/21] perf buildid-cache: Remove unneeded debugdir parameters Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 20/21] perf buildid-cache: Consolidate .build-id cache path generators Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 21/21] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check Arnaldo Carvalho de Melo
2015-03-05 4:30 ` [GIT PULL 00/21] perf/core improvements and fixes Victor Kamensky
2015-03-05 6:37 ` Ingo Molnar
2015-03-05 6:49 ` Victor Kamensky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423688955-8094-2-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).