Skip to contentSkip to conversation

perf test: Add watchpoint test

PATCH Applied Ravi Bangoria 3 participants 3 messages Sep 12, 2018 – Sep 25, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf test: Add watchpoint test

We don't have perf test available to test watchpoint functionality. Add simple set of tests:
- Read only watchpoint
- Write only watchpoint
- Read / Write watchpoint
- Runtime watchpoint modification

Ex on powerpc:

  $ sudo ./perf test 22
  22: Watchpoint                                            :
  22.1: Read Only Watchpoint                                : Ok
  22.2: Write Only Watchpoint                               : Ok
  22.3: Read / Write Watchpoint                             : Ok
  22.4: Modify Watchpoint                                   : Ok

---
v1 -> v2:
- Fix build failure for mips and other archs.
- Show debug message if subtest is not supported.

 tools/perf/tests/Build          |   1 +
 tools/perf/tests/builtin-test.c |   9 ++
 tools/perf/tests/tests.h        |   3 +
 tools/perf/tests/wp.c           | 229 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 242 insertions(+)
 create mode 100644 tools/perf/tests/wp.c
tools/perf/tests/Build +1 -0
index 6c108fa79ae3..0b2b8305c965 100644
@@ -21,6 +21,7 @@ perf-y += python-use.o
 perf-y += bp_signal.o
 perf-y += bp_signal_overflow.o
 perf-y += bp_account.o
+perf-y += wp.o
 perf-y += task-exit.o
 perf-y += sw-clock.o
 perf-y += mmap-thread-lookup.o
tools/perf/tests/builtin-test.c +9 -0
index d7a5e1b9aa6f..54ca7d87236f 100644
@@ -120,6 +120,15 @@ static struct test generic_tests[] = {
 		.func = test__bp_accounting,
 		.is_supported = test__bp_signal_is_supported,
 	},
+	{
+		.desc = "Watchpoint",
+		.func = test__wp,
+		.subtest = {
+			.skip_if_fail	= false,
+			.get_nr		= test__wp_subtest_get_nr,
+			.get_desc	= test__wp_subtest_get_desc,
+		},
+	},
 	{
 		.desc = "Number of exit events of a simple workload",
 		.func = test__task_exit,
tools/perf/tests/tests.h +3 -0
index a9760e790563..8e26a4148f30 100644
@@ -59,6 +59,9 @@ int test__python_use(struct test *test, int subtest);
 int test__bp_signal(struct test *test, int subtest);
 int test__bp_signal_overflow(struct test *test, int subtest);
 int test__bp_accounting(struct test *test, int subtest);
+int test__wp(struct test *test, int subtest);
+const char *test__wp_subtest_get_desc(int subtest);
+int test__wp_subtest_get_nr(void);
 int test__task_exit(struct test *test, int subtest);
 int test__mem(struct test *test, int subtest);
 int test__sw_clock_freq(struct test *test, int subtest);
tools/perf/tests/wp.c new file +229 -0

229 lines not on this page · raw message

Signature · 1 line
2.14.4
maintainer Applied
#1 lore raw

Em Wed, Sep 12, 2018 at 11:42:29AM +0530, Ravi Bangoria escreveu:

Quoted 6 lines

We don't have perf test available to test watchpoint functionality. Add simple set of tests:
- Read only watchpoint
- Write only watchpoint
- Read / Write watchpoint
- Runtime watchpoint modification

Thanks, applied.

- Arnaldo

#2 lore raw
In reply to Ravi Bangoria
perf test: Add watchpoint test
Commit-ID:  2e85d5979e8d2866db6185de231461b21159ef6f
Gitweb:     https://git.kernel.org/tip/2e85d5979e8d2866db6185de231461b21159ef6f
Author:     Ravi Bangoria <[email protected]>
AuthorDate: Wed, 12 Sep 2018 11:42:29 +0530
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 18 Sep 2018 17:21:13 -0300

perf test: Add watchpoint test

We don't have a 'perf test' entry available to test the watchpoint functionality.

Add a simple set of tests:

- Read only watchpoint
- Write only watchpoint
- Read / Write watchpoint
- Runtime watchpoint modification

Ex.: on powerpc:

  $ sudo perf test 22
  22: Watchpoint                                            :
  22.1: Read Only Watchpoint                                : Ok
  22.2: Write Only Watchpoint                               : Ok
  22.3: Read / Write Watchpoint                             : Ok
  22.4: Modify Watchpoint                                   : Ok
---
 tools/perf/tests/Build          |   1 +
 tools/perf/tests/builtin-test.c |   9 ++
 tools/perf/tests/tests.h        |   3 +
 tools/perf/tests/wp.c           | 229 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 242 insertions(+)
tools/perf/tests/Build +1 -0
index 6c108fa79ae3..0b2b8305c965 100644
@@ -21,6 +21,7 @@ perf-y += python-use.o
 perf-y += bp_signal.o
 perf-y += bp_signal_overflow.o
 perf-y += bp_account.o
+perf-y += wp.o
 perf-y += task-exit.o
 perf-y += sw-clock.o
 perf-y += mmap-thread-lookup.o
tools/perf/tests/builtin-test.c +9 -0
index d7a5e1b9aa6f..54ca7d87236f 100644
@@ -120,6 +120,15 @@ static struct test generic_tests[] = {
 		.func = test__bp_accounting,
 		.is_supported = test__bp_signal_is_supported,
 	},
+	{
+		.desc = "Watchpoint",
+		.func = test__wp,
+		.subtest = {
+			.skip_if_fail	= false,
+			.get_nr		= test__wp_subtest_get_nr,
+			.get_desc	= test__wp_subtest_get_desc,
+		},
+	},
 	{
 		.desc = "Number of exit events of a simple workload",
 		.func = test__task_exit,
tools/perf/tests/tests.h +3 -0
index a9760e790563..8e26a4148f30 100644
@@ -59,6 +59,9 @@ int test__python_use(struct test *test, int subtest);
 int test__bp_signal(struct test *test, int subtest);
 int test__bp_signal_overflow(struct test *test, int subtest);
 int test__bp_accounting(struct test *test, int subtest);
+int test__wp(struct test *test, int subtest);
+const char *test__wp_subtest_get_desc(int subtest);
+int test__wp_subtest_get_nr(void);
 int test__task_exit(struct test *test, int subtest);
 int test__mem(struct test *test, int subtest);
 int test__sw_clock_freq(struct test *test, int subtest);
tools/perf/tests/wp.c new file +229 -0

229 lines not on this page · raw message