Skip to contentSkip to conversation

perf tests: Add pollfd growing test

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Sep 26, 2014 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  9ae28035b8677b82e1d71cea4f793cb5504ec104
Gitweb:     http://git.kernel.org/tip/9ae28035b8677b82e1d71cea4f793cb5504ec104
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 18 Aug 2014 16:49:00 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 25 Sep 2014 16:46:54 -0300

perf tests: Add pollfd growing test

[acme@ssdandy linux]$ perf test "Add fd"
34: Add fd to pollfd array, making it autogrow : Ok
[acme@ssdandy linux]$ perf test -v "Add fd"
34: Add fd to pollfd array, making it autogrow :
--- start ---
test child forked, pid 19817

  before growing array:   2 [ 1, 2 ]
  after 3rd add_pollfd:   3 [ 1, 2, 35 ]
  after 4th add_pollfd:   4 [ 1, 2, 35, 88 ]

test child finished with 0
---- end ----
Add fd to pollfd array, making it autogrow: Ok [acme@ssdandy linux]$

Cc Adrian Hunter <[email protected]>
Cc Corey Ashford <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jean Pihet <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/tests/builtin-test.c |   4 ++
 tools/perf/tests/evlist.c       | 111 ++++++++++++++++++++++++++++++++++++++++
 tools/perf/tests/tests.h        |   1 +
 3 files changed, 116 insertions(+)
tools/perf/tests/builtin-test.c +4 -0
index 41e556e..174c3ff 100644
@@ -162,6 +162,10 @@ static struct test {
 		.func = test__perf_evlist__filter_pollfd,
 	},
 	{
+		.desc = "Add fd to pollfd array, making it autogrow",
+		.func = test__perf_evlist__add_pollfd,
+	},
+	{
 		.func = NULL,
 	},
 };
tools/perf/tests/evlist.c +111 -0

119 lines not on this page · raw message

tools/perf/tests/tests.h +1 -0
index 72c4c03..699d4bb 100644
@@ -50,6 +50,7 @@ int test__hists_output(void);
 int test__hists_cumulate(void);
 int test__switch_tracking(void);
 int test__perf_evlist__filter_pollfd(void);
+int test__perf_evlist__add_pollfd(void);
 
 #if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
 #ifdef HAVE_DWARF_UNWIND_SUPPORT