perf tests: Move tests from builtin-test
cover perf tests: Move tests from builtin-test
hi,
I discussed with Arnaldo of moving tests from builtin-test into separated objects.. here it is. I swear not to touch test code for a while after this one ;-)
Attached patches:
01/12 perf tests: Move test__vmlinux_matches_kallsyms into separate object 02/12 perf tests: Move test__open_syscall_event into separate object 03/12 perf tests: Move test__open_syscall_event_on_all_cpus into separate object 04/12 perf tests: Move test__basic_mmap into separate object
05/12 perf tests: Move test__PERF_RECORD into separate object
06/12 perf tests: Move test__rdpmc into separate object
07/12 perf tests: Move perf_evsel__roundtrip_name_test into separate object 08/12 perf tests: Move perf_evsel__tp_sched_test into separate object 09/12 perf tests: Move test__syscall_open_tp_fields into separate object 10/12 perf tests: Move pmu tests into separate object
11/12 perf tests: Final cleanup for builtin-test move
12/12 perf tests: Check for mkstemp return value in dso-data test
Also available here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/linux.git
perf/tests
thanks,
jirka
--- tools/perf/Makefile | 11 + tools/perf/perf.h | 1 - tools/perf/tests/attr.c | 3 +- tools/perf/tests/builtin-test.c | 1399 +---------------------------------------------------------- tools/perf/tests/dso-data.c | 7 +- tools/perf/tests/evsel-roundtrip-name.c | 114 +++++ tools/perf/tests/evsel-tp-sched.c | 84 ++++ tools/perf/tests/mmap-basic.c | 162 +++++++ tools/perf/tests/open-syscall-all-cpus.c | 120 +++++ tools/perf/tests/open-syscall-tp-fields.c | 117 +++++ tools/perf/tests/open-syscall.c | 66 +++ tools/perf/tests/parse-events.c | 3 +- tools/perf/tests/perf-record.c | 314 ++++++++++++++ tools/perf/tests/pmu.c | 178 ++++++++ tools/perf/tests/rdpmc.c | 175 ++++++++ tools/perf/tests/tests.h | 22 + tools/perf/tests/util.c | 30 ++ tools/perf/tests/vmlinux-kallsyms.c | 230 ++++++++++ tools/perf/util/parse-events.h | 1 - tools/perf/util/pmu.c | 185 +------- tools/perf/util/pmu.h | 4 + tools/perf/util/symbol.h | 1 - 22 files changed, 1654 insertions(+), 1573 deletions(-)
PATCH 1/12 perf tests: Move test__vmlinux_matches_kallsyms into separate object
Separating test__vmlinux_matches_kallsyms test from the builtin-test into vmlinux-kallsyms object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 223 +--------------------------------- tools/perf/tests/tests.h | 6 + tools/perf/tests/vmlinux-kallsyms.c | 230 ++++++++++++++++++++++++++++++++++++ 4 files changed, 239 insertions(+), 221 deletions(-) create mode 100644 tools/perf/tests/tests.h create mode 100644 tools/perf/tests/vmlinux-kallsyms.c
tools/perf/Makefile +1 -0
@@ -431,6 +431,7 @@ LIB_OBJS += $(OUTPUT)arch/common.o LIB_OBJS += $(OUTPUT)tests/parse-events.o LIB_OBJS += $(OUTPUT)tests/dso-data.o LIB_OBJS += $(OUTPUT)tests/attr.o +LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
tools/perf/tests/builtin-test.c +2 -221
233 lines not on this page · raw message
tools/perf/tests/tests.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef TESTS_H +#define TESTS_H + +int test__vmlinux_matches_kallsyms (void ); + +#endif /* TESTS_H */
tools/perf/tests/vmlinux-kallsyms.c new file +230 -0
230 lines not on this page · raw message
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__vmlinux_matches_kallsyms into separate object
Commit-ID: 0a4e1ae6808a28a92573550603121b146b11312e Gitweb: http://git.kernel.org/tip/0a4e1ae6808a28a92573550603121b146b11312e Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:41 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:48:35 -0300
perf tests: Move test__vmlinux_matches_kallsyms into separate object
Separating test__vmlinux_matches_kallsyms test from the builtin-test into vmlinux-kallsyms object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 223 +--------------------------------- tools/perf/tests/tests.h | 6 + tools/perf/tests/vmlinux-kallsyms.c | 230 ++++++++++++++++++++++++++++++++++++ 4 files changed, 239 insertions(+), 221 deletions(-)
tools/perf/Makefile +1 -0
@@ -431,6 +431,7 @@ LIB_OBJS += $(OUTPUT)arch/common.o LIB_OBJS += $(OUTPUT)tests/parse-events.o LIB_OBJS += $(OUTPUT)tests/dso-data.o LIB_OBJS += $(OUTPUT)tests/attr.o +LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
tools/perf/tests/builtin-test.c +2 -221
233 lines not on this page · raw message
tools/perf/tests/tests.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef TESTS_H +#define TESTS_H + +int test__vmlinux_matches_kallsyms (void ); + +#endif /* TESTS_H */
tools/perf/tests/vmlinux-kallsyms.c new file +230 -0
230 lines not on this page · raw message
PATCH 2/12 perf tests: Move test__open_syscall_event into separate object
In reply to Jiri OlsaSeparating test__open_syscall_event test from
the builtin-test into open-syscall object.
Adding util object under tests directory to gather help functions common to more tests.
--- tools/perf/Makefile | 2 + tools/perf/tests/builtin-test.c | 84 ----------------------------------------- tools/perf/tests/open-syscall.c | 66 ++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 5 +++ tools/perf/tests/util.c | 30 +++++++++++++++ 5 files changed, 103 insertions(+), 84 deletions(-) create mode 100644 tools/perf/tests/open-syscall.c create mode 100644 tools/perf/tests/util.c
tools/perf/Makefile +2 -0
@@ -432,6 +432,8 @@ LIB_OBJS += $(OUTPUT)tests/parse-events.o LIB_OBJS += $(OUTPUT)tests/dso-data.o LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o +LIB_OBJS += $(OUTPUT)tests/open-syscall.o +LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
tools/perf/tests/builtin-test.c +0 -84
90 lines not on this page · raw message
tools/perf/tests/open-syscall.c new file +66 -0
66 lines not on this page · raw message
tools/perf/tests/tests.h +5 -0
@@ -1,6 +1,11 @@#ifndef TESTS_H #define TESTS_H +/* Tests */ int test__vmlinux_matches_kallsyms (void ); +int test__open_syscall_event (void ); + +/* Util */ +int trace_event__id (const char *evname);#endif /* TESTS_H */
tools/perf/tests/util.c new file +30 -0
@@ -0,0 +1,30 @@ +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include "tests.h" +#include "debugfs.h" + +int trace_event__id (const char *evname) +{ +char *filename; +int err =-1 , fd; + +if (asprintf (&filename, +"%s/syscalls/%s/id" , + tracing_events_path, evname) <0 ) +return -1 ; + + fd =open (filename,O_RDONLY ); +if (fd >=0 ) { +char id[16 ]; +if (read (fd, id,sizeof (id)) >0 ) + err =atoi (id); +close (fd); + } + +free (filename); +return err; +}
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__open_syscall_event into separate object
Commit-ID: d3b59a38bcdab4248134023c2c5dfabee5a4878e Gitweb: http://git.kernel.org/tip/d3b59a38bcdab4248134023c2c5dfabee5a4878e Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:42 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:49:17 -0300
perf tests: Move test__open_syscall_event into separate object
Separating test__open_syscall_event test from the builtin-test into open-syscall object.
Adding util object under tests directory to gather help functions common to more tests.
--- tools/perf/Makefile | 2 + tools/perf/tests/builtin-test.c | 84 ----------------------------------------- tools/perf/tests/open-syscall.c | 66 ++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 5 +++ tools/perf/tests/util.c | 30 +++++++++++++++ 5 files changed, 103 insertions(+), 84 deletions(-)
tools/perf/Makefile +2 -0
@@ -432,6 +432,8 @@ LIB_OBJS += $(OUTPUT)tests/parse-events.o LIB_OBJS += $(OUTPUT)tests/dso-data.o LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o +LIB_OBJS += $(OUTPUT)tests/open-syscall.o +LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
tools/perf/tests/builtin-test.c +0 -84
90 lines not on this page · raw message
tools/perf/tests/open-syscall.c new file +66 -0
66 lines not on this page · raw message
tools/perf/tests/tests.h +5 -0
@@ -1,6 +1,11 @@#ifndef TESTS_H #define TESTS_H +/* Tests */ int test__vmlinux_matches_kallsyms (void ); +int test__open_syscall_event (void ); + +/* Util */ +int trace_event__id (const char *evname);#endif /* TESTS_H */
tools/perf/tests/util.c new file +30 -0
@@ -0,0 +1,30 @@ +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include "tests.h" +#include "debugfs.h" + +int trace_event__id (const char *evname) +{ +char *filename; +int err =-1 , fd; + +if (asprintf (&filename, +"%s/syscalls/%s/id" , + tracing_events_path, evname) <0 ) +return -1 ; + + fd =open (filename,O_RDONLY ); +if (fd >=0 ) { +char id[16 ]; +if (read (fd, id,sizeof (id)) >0 ) + err =atoi (id); +close (fd); + } + +free (filename); +return err; +}
PATCH 3/12 perf tests: Move test__open_syscall_event_on_all_cpus into separate object
In reply to Jiri OlsaSeparating test__open_syscall_event_on_all_cpus test from the builtin-test into open-syscall-all-cpus object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 114 ----------------------------- tools/perf/tests/open-syscall-all-cpus.c | 120 +++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 122 insertions(+), 114 deletions(-) create mode 100644 tools/perf/tests/open-syscall-all-cpus.c
tools/perf/Makefile +1 -0
@@ -433,6 +433,7 @@ LIB_OBJS += $(OUTPUT)tests/dso-data.o LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o +LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -114
120 lines not on this page · raw message
tools/perf/tests/open-syscall-all-cpus.c new file +120 -0
120 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -4,6 +4,7 @@/* Tests */ int test__vmlinux_matches_kallsyms (void );int test__open_syscall_event (void ); +int test__open_syscall_event_on_all_cpus (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__open_syscall_event_on_all_cpus into separate object
Commit-ID: bd90517b374b1d6381a5509f55df1a9b7c33a6b1 Gitweb: http://git.kernel.org/tip/bd90517b374b1d6381a5509f55df1a9b7c33a6b1 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:43 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:49:25 -0300
perf tests: Move test__open_syscall_event_on_all_cpus into separate object
Separating test__open_syscall_event_on_all_cpus test from the builtin-test into open-syscall-all-cpus object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 114 ----------------------------- tools/perf/tests/open-syscall-all-cpus.c | 120 +++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 122 insertions(+), 114 deletions(-)
tools/perf/Makefile +1 -0
@@ -433,6 +433,7 @@ LIB_OBJS += $(OUTPUT)tests/dso-data.o LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o +LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -114
120 lines not on this page · raw message
tools/perf/tests/open-syscall-all-cpus.c new file +120 -0
120 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -4,6 +4,7 @@/* Tests */ int test__vmlinux_matches_kallsyms (void );int test__open_syscall_event (void ); +int test__open_syscall_event_on_all_cpus (void );/* Util */ int trace_event__id (const char *evname);
PATCH 4/12 perf tests: Move test__basic_mmap into separate object
In reply to Jiri OlsaSeparating test__basic_mmap test from the builtin-test into mmap-basic object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 157 -------------------------------------- tools/perf/tests/mmap-basic.c | 162 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 164 insertions(+), 157 deletions(-) create mode 100644 tools/perf/tests/mmap-basic.c
tools/perf/Makefile +1 -0
@@ -434,6 +434,7 @@ LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o +LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -157
163 lines not on this page · raw message
tools/perf/tests/mmap-basic.c new file +162 -0
162 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -5,6 +5,7 @@int test__vmlinux_matches_kallsyms (void );int test__open_syscall_event (void );int test__open_syscall_event_on_all_cpus (void ); +int test__basic_mmap (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__basic_mmap into separate object
Commit-ID: a65b9c62be044b7956022e2823c5f079cf35b069 Gitweb: http://git.kernel.org/tip/a65b9c62be044b7956022e2823c5f079cf35b069 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:44 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:49:32 -0300
perf tests: Move test__basic_mmap into separate object
Separating test__basic_mmap test from the builtin-test into mmap-basic object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 157 -------------------------------------- tools/perf/tests/mmap-basic.c | 162 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 164 insertions(+), 157 deletions(-)
tools/perf/Makefile +1 -0
@@ -434,6 +434,7 @@ LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o +LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -157
163 lines not on this page · raw message
tools/perf/tests/mmap-basic.c new file +162 -0
162 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -5,6 +5,7 @@int test__vmlinux_matches_kallsyms (void );int test__open_syscall_event (void );int test__open_syscall_event_on_all_cpus (void ); +int test__basic_mmap (void );/* Util */ int trace_event__id (const char *evname);
PATCH 5/12 perf tests: Move test__PERF_RECORD into separate object
In reply to Jiri OlsaSeparating test__PERF_RECORD test from the builtin-test into perf-record object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 307 --------------------------------------- tools/perf/tests/perf-record.c | 314 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 316 insertions(+), 307 deletions(-) create mode 100644 tools/perf/tests/perf-record.c
tools/perf/Makefile +1 -0
@@ -435,6 +435,7 @@ LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o +LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -307
313 lines not on this page · raw message
tools/perf/tests/perf-record.c new file +314 -0
314 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -6,6 +6,7 @@ int test__vmlinux_matches_kallsyms(void);int test__open_syscall_event (void );int test__open_syscall_event_on_all_cpus (void );int test__basic_mmap (void ); +int test__PERF_RECORD (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__PERF_RECORD into separate object
Commit-ID: 16d00fee703866c61c9006eff097952289335479 Gitweb: http://git.kernel.org/tip/16d00fee703866c61c9006eff097952289335479 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:45 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:49:43 -0300
perf tests: Move test__PERF_RECORD into separate object
Separating test__PERF_RECORD test from the builtin-test into perf-record object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 307 --------------------------------------- tools/perf/tests/perf-record.c | 312 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 314 insertions(+), 307 deletions(-)
tools/perf/Makefile +1 -0
@@ -435,6 +435,7 @@ LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o +LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -307
313 lines not on this page · raw message
tools/perf/tests/perf-record.c new file +312 -0
312 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -6,6 +6,7 @@ int test__vmlinux_matches_kallsyms(void);int test__open_syscall_event (void );int test__open_syscall_event_on_all_cpus (void );int test__basic_mmap (void ); +int test__PERF_RECORD (void );/* Util */ int trace_event__id (const char *evname);
PATCH 6/12 perf tests: Move test__rdpmc into separate object
In reply to Jiri OlsaSeparating test__rdpmc test from the builtin-test
into rdpmc object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 168 -------------------------------------- tools/perf/tests/rdpmc.c | 175 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 177 insertions(+), 168 deletions(-) create mode 100644 tools/perf/tests/rdpmc.c
tools/perf/Makefile +1 -0
@@ -436,6 +436,7 @@ LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o +LIB_OBJS += $(OUTPUT)tests/rdpmc.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -168
174 lines not on this page · raw message
tools/perf/tests/rdpmc.c new file +175 -0
175 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -7,6 +7,7 @@ int test__open_syscall_event(void);int test__open_syscall_event_on_all_cpus (void );int test__basic_mmap (void );int test__PERF_RECORD (void ); +int test__rdpmc (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__rdpmc into separate object
Commit-ID: bacf7e5d4055b65506292cf6412ec71e7948a9cf Gitweb: http://git.kernel.org/tip/bacf7e5d4055b65506292cf6412ec71e7948a9cf Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:46 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:49:50 -0300
perf tests: Move test__rdpmc into separate object
Separating test__rdpmc test from the builtin-test
into rdpmc object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 168 -------------------------------------- tools/perf/tests/rdpmc.c | 175 ++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 177 insertions(+), 168 deletions(-)
tools/perf/Makefile +1 -0
@@ -436,6 +436,7 @@ LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o +LIB_OBJS += $(OUTPUT)tests/rdpmc.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +0 -168
174 lines not on this page · raw message
tools/perf/tests/rdpmc.c new file +175 -0
175 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -7,6 +7,7 @@ int test__open_syscall_event(void);int test__open_syscall_event_on_all_cpus (void );int test__basic_mmap (void );int test__PERF_RECORD (void ); +int test__rdpmc (void );/* Util */ int trace_event__id (const char *evname);
PATCH 7/12 perf tests: Move perf_evsel__roundtrip_name_test into separate object
In reply to Jiri OlsaSeparating perf_evsel__roundtrip_name_test test from the builtin-test into evsel-roundtrip-name object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 112 +------------------------------ tools/perf/tests/evsel-roundtrip-name.c | 114 ++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 117 insertions(+), 111 deletions(-) create mode 100644 tools/perf/tests/evsel-roundtrip-name.c
tools/perf/Makefile +1 -0
@@ -437,6 +437,7 @@ LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o +LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +1 -111
124 lines not on this page · raw message
tools/perf/tests/evsel-roundtrip-name.c new file +114 -0
114 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -8,6 +8,7 @@ int test__open_syscall_event_on_all_cpus(void);int test__basic_mmap (void );int test__PERF_RECORD (void );int test__rdpmc (void ); +int test__perf_evsel__roundtrip_name_test (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move perf_evsel__roundtrip_name_test into separate object
Commit-ID: cfffae2ef7029d38e71d337fbc2a9c6cf1fa5aaf Gitweb: http://git.kernel.org/tip/cfffae2ef7029d38e71d337fbc2a9c6cf1fa5aaf Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:47 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:49:56 -0300
perf tests: Move perf_evsel__roundtrip_name_test into separate object
Separating perf_evsel__roundtrip_name_test test from the builtin-test into evsel-roundtrip-name object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 112 +------------------------------ tools/perf/tests/evsel-roundtrip-name.c | 114 ++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 117 insertions(+), 111 deletions(-)
tools/perf/Makefile +1 -0
@@ -437,6 +437,7 @@ LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o +LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +1 -111
124 lines not on this page · raw message
tools/perf/tests/evsel-roundtrip-name.c new file +114 -0
114 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -8,6 +8,7 @@ int test__open_syscall_event_on_all_cpus(void);int test__basic_mmap (void );int test__PERF_RECORD (void );int test__rdpmc (void ); +int test__perf_evsel__roundtrip_name_test (void );/* Util */ int trace_event__id (const char *evname);
PATCH 8/12 perf tests: Move perf_evsel__tp_sched_test into separate object
In reply to Jiri OlsaSeparating perf_evsel__tp_sched_test test from the builtin-test into evsel-tp-sched object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 83 +------------------------------------- tools/perf/tests/evsel-tp-sched.c | 84 +++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 87 insertions(+), 82 deletions(-) create mode 100644 tools/perf/tests/evsel-tp-sched.c
tools/perf/Makefile +1 -0
@@ -438,6 +438,7 @@ LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o +LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +1 -82
95 lines not on this page · raw message
tools/perf/tests/evsel-tp-sched.c new file +84 -0
84 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -9,6 +9,7 @@ int test__basic_mmap(void);int test__PERF_RECORD (void );int test__rdpmc (void );int test__perf_evsel__roundtrip_name_test (void ); +int test__perf_evsel__tp_sched_test (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move perf_evsel__tp_sched_test into separate object
Commit-ID: 5e24a0904ed4029f6778a214b6fe41b9265fd620 Gitweb: http://git.kernel.org/tip/5e24a0904ed4029f6778a214b6fe41b9265fd620 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:48 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:50:02 -0300
perf tests: Move perf_evsel__tp_sched_test into separate object
Separating perf_evsel__tp_sched_test test from the builtin-test into evsel-tp-sched object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 83 +------------------------------------- tools/perf/tests/evsel-tp-sched.c | 84 +++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 87 insertions(+), 82 deletions(-)
tools/perf/Makefile +1 -0
@@ -438,6 +438,7 @@ LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o +LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +1 -82
95 lines not on this page · raw message
tools/perf/tests/evsel-tp-sched.c new file +84 -0
84 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -9,6 +9,7 @@ int test__basic_mmap(void);int test__PERF_RECORD (void );int test__rdpmc (void );int test__perf_evsel__roundtrip_name_test (void ); +int test__perf_evsel__tp_sched_test (void );/* Util */ int trace_event__id (const char *evname);
PATCH 9/12 perf tests: Move test__syscall_open_tp_fields into separate object
In reply to Jiri OlsaSeparating test__syscall_open_tp_fields test from the builtin-test into open-syscall-tp-fields object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 112 ---------------------------- tools/perf/tests/open-syscall-tp-fields.c | 117 ++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 119 insertions(+), 112 deletions(-) create mode 100644 tools/perf/tests/open-syscall-tp-fields.c
tools/perf/Makefile +1 -0
@@ -434,6 +434,7 @@ LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o +LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o
tools/perf/tests/builtin-test.c +0 -112
118 lines not on this page · raw message
tools/perf/tests/open-syscall-tp-fields.c new file +117 -0
117 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -10,6 +10,7 @@ int test__PERF_RECORD(void);int test__rdpmc (void );int test__perf_evsel__roundtrip_name_test (void );int test__perf_evsel__tp_sched_test (void ); +int test__syscall_open_tp_fields (void );/* Util */ int trace_event__id (const char *evname);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move test__syscall_open_tp_fields into separate object
Commit-ID: dc447eed59037c1c65feab9c72d372b6249af978 Gitweb: http://git.kernel.org/tip/dc447eed59037c1c65feab9c72d372b6249af978 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:49 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:50:09 -0300
perf tests: Move test__syscall_open_tp_fields into separate object
Separating test__syscall_open_tp_fields test from the builtin-test into open-syscall-tp-fields object.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 112 ---------------------------- tools/perf/tests/open-syscall-tp-fields.c | 117 ++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 4 files changed, 119 insertions(+), 112 deletions(-)
tools/perf/Makefile +1 -0
@@ -434,6 +434,7 @@ LIB_OBJS += $(OUTPUT)tests/attr.o LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o LIB_OBJS += $(OUTPUT)tests/open-syscall.o LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o +LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o LIB_OBJS += $(OUTPUT)tests/mmap-basic.o LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o
tools/perf/tests/builtin-test.c +0 -112
118 lines not on this page · raw message
tools/perf/tests/open-syscall-tp-fields.c new file +117 -0
117 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -10,6 +10,7 @@ int test__PERF_RECORD(void);int test__rdpmc (void );int test__perf_evsel__roundtrip_name_test (void );int test__perf_evsel__tp_sched_test (void ); +int test__syscall_open_tp_fields (void );/* Util */ int trace_event__id (const char *evname);
PATCH 10/12 perf tests: Move pmu tests into separate object
In reply to Jiri OlsaSeparating pmu's object tests into pmu object under tests directory.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 7 +- tools/perf/tests/pmu.c | 178 ++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/util/pmu.c | 185 ++-------------------------------------- tools/perf/util/pmu.h | 4 + 6 files changed, 191 insertions(+), 185 deletions(-) create mode 100644 tools/perf/tests/pmu.c
tools/perf/Makefile +1 -0
@@ -440,6 +440,7 @@ LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o +LIB_OBJS += $(OUTPUT)tests/pmu.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +1 -6
@@ -30,11 +30,6 @@#include <sched.h> -static int test__perf_pmu (void ) -{ -return perf_pmu__test (); -} - static struct test { const char *desc; int (*func)(void);
@@ -71,7 +66,7 @@ static struct test { }, { .desc = "Test perf pmu format parsing", - .func = test__perf_pmu, + .func = test__pmu, }, { .desc = "Test dso data interface",
tools/perf/tests/pmu.c new file +178 -0
178 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -11,6 +11,7 @@ int test__rdpmc(void);int test__perf_evsel__roundtrip_name_test (void );int test__perf_evsel__tp_sched_test (void );int test__syscall_open_tp_fields (void ); +int test__pmu (void );/* Util */ int trace_event__id (const char *evname);
tools/perf/util/pmu.c +6 -179
212 lines not on this page · raw message
tools/perf/util/pmu.h +4 -0
@@ -37,6 +37,9 @@ struct perf_pmu {struct perf_pmu *perf_pmu__find (char *name);int perf_pmu__config (struct perf_pmu *pmu,struct perf_event_attr *attr,struct list_head *head_terms); +int perf_pmu__config_terms (struct list_head *formats, +struct perf_event_attr *attr, +struct list_head *head_terms);int perf_pmu__check_alias (struct perf_pmu *pmu,struct list_head *head_terms);struct list_head *perf_pmu__alias (struct perf_pmu *pmu,struct list_head *head_terms);
@@ -46,6 +49,7 @@ void perf_pmu_error(struct list_head *list, char *name, char const *msg);int perf_pmu__new_format (struct list_head *list,char *name,int config,unsigned long *bits);void perf_pmu__set_format (unsigned long *bits,long from,long to); +int perf_pmu__format_parse (char *dir,struct list_head *head);struct perf_pmu *perf_pmu__scan (struct perf_pmu *pmu);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Move pmu tests into separate object
Commit-ID: cff7f956ec4a1ede9b752cfae3c12f588292ad80 Gitweb: http://git.kernel.org/tip/cff7f956ec4a1ede9b752cfae3c12f588292ad80 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:50 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:50:19 -0300
perf tests: Move pmu tests into separate object
Separating pmu's object tests into pmu object under tests directory.
--- tools/perf/Makefile | 1 + tools/perf/tests/builtin-test.c | 7 +- tools/perf/tests/pmu.c | 178 ++++++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/util/pmu.c | 185 ++-------------------------------------- tools/perf/util/pmu.h | 4 + 6 files changed, 191 insertions(+), 185 deletions(-)
tools/perf/Makefile +1 -0
@@ -440,6 +440,7 @@ LIB_OBJS += $(OUTPUT)tests/perf-record.o LIB_OBJS += $(OUTPUT)tests/rdpmc.o LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o +LIB_OBJS += $(OUTPUT)tests/pmu.o LIB_OBJS += $(OUTPUT)tests/util.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
tools/perf/tests/builtin-test.c +1 -6
@@ -30,11 +30,6 @@#include <sched.h> -static int test__perf_pmu (void ) -{ -return perf_pmu__test (); -} - static struct test { const char *desc; int (*func)(void);
@@ -71,7 +66,7 @@ static struct test { }, { .desc = "Test perf pmu format parsing", - .func = test__perf_pmu, + .func = test__pmu, }, { .desc = "Test dso data interface",
tools/perf/tests/pmu.c new file +178 -0
178 lines not on this page · raw message
tools/perf/tests/tests.h +1 -0
@@ -11,6 +11,7 @@ int test__rdpmc(void);int test__perf_evsel__roundtrip_name_test (void );int test__perf_evsel__tp_sched_test (void );int test__syscall_open_tp_fields (void ); +int test__pmu (void );/* Util */ int trace_event__id (const char *evname);
tools/perf/util/pmu.c +6 -179
212 lines not on this page · raw message
tools/perf/util/pmu.h +4 -0
@@ -37,6 +37,9 @@ struct perf_pmu {struct perf_pmu *perf_pmu__find (char *name);int perf_pmu__config (struct perf_pmu *pmu,struct perf_event_attr *attr,struct list_head *head_terms); +int perf_pmu__config_terms (struct list_head *formats, +struct perf_event_attr *attr, +struct list_head *head_terms);int perf_pmu__check_alias (struct perf_pmu *pmu,struct list_head *head_terms);struct list_head *perf_pmu__alias (struct perf_pmu *pmu,struct list_head *head_terms);
@@ -46,6 +49,7 @@ void perf_pmu_error(struct list_head *list, char *name, char const *msg);int perf_pmu__new_format (struct list_head *list,char *name,int config,unsigned long *bits);void perf_pmu__set_format (unsigned long *bits,long from,long to); +int perf_pmu__format_parse (char *dir,struct list_head *head);struct perf_pmu *perf_pmu__scan (struct perf_pmu *pmu);
PATCH 11/12 perf tests: Final cleanup for builtin-test move
In reply to Jiri OlsaFinal function renames to match test__* style and include cleanup.
--- tools/perf/perf.h | 1 - tools/perf/tests/attr.c | 3 ++- tools/perf/tests/builtin-test.c | 34 +++++++--------------------------- tools/perf/tests/dso-data.c | 3 ++- tools/perf/tests/parse-events.c | 3 ++- tools/perf/tests/tests.h | 3 +++ tools/perf/util/parse-events.h | 1 - tools/perf/util/symbol.h | 1 - 8 files changed, 16 insertions(+), 33 deletions(-)
tools/perf/perf.h +0 -1
@@ -178,7 +178,6 @@ extern bool test_attr__enabled;void test_attr__init (void );void test_attr__open (struct perf_event_attr *attr,pid_t pid,int cpu,int fd,int group_fd,unsigned long flags); -int test_attr__run (void ); static inline int sys_perf_event_open(struct perf_event_attr *attr,
tools/perf/tests/attr.c +2 -1
@@ -27,6 +27,7 @@#include "../perf.h" #include "util.h" #include "exec_cmd.h" +#include "tests.h" #define ENV "PERF_TEST_ATTR"
@@ -151,7 +152,7 @@ static int run_dir(const char *d, const char *perf)return system (cmd); } -int test_attr__run (void ) +int test__attr (void ) {struct stat st;char path_perf[PATH_MAX ];
tools/perf/tests/builtin-test.c +7 -27
@@ -4,31 +4,11 @@* Builtin regression testing command: ever growing number of sanity tests */ #include "builtin.h" - -#include "util/cache.h" -#include "util/color.h" -#include "util/debug.h" -#include "util/debugfs.h" -#include "util/evlist.h" -#include "util/machine.h" -#include "util/parse-options.h" -#include "util/parse-events.h" -#include "util/symbol.h" -#include "util/thread_map.h" -#include "util/pmu.h" -#include "event-parse.h" -#include "../../include/linux/hw_breakpoint.h" - -#include <sys/mman.h> - -#include "util/cpumap.h" -#include "util/evsel.h" -#include <sys/types.h> -#include "tests.h" - -#include <sched.h> - +#include "debug.h" +#include "color.h" +#include "parse-options.h" +#include "symbol.h" static struct test { const char *desc;
@@ -52,7 +32,7 @@ static struct test { }, { .desc = "parse events tests", - .func = parse_events__test, + .func = test__parse_events, },#if defined(__x86_64__) || defined(__i386__) {
@@ -70,7 +50,7 @@ static struct test { }, { .desc = "Test dso data interface", - .func = dso__test_data, + .func = test__dso_data, }, { .desc = "roundtrip evsel->name check",
@@ -86,7 +66,7 @@ static struct test { }, { .desc = "struct perf_event_attr setup", - .func = test_attr__run, + .func = test__attr, }, { .func = NULL,
tools/perf/tests/dso-data.c +2 -1
@@ -8,6 +8,7 @@#include "machine.h" #include "symbol.h" +#include "tests.h" #define TEST_ASSERT_VAL (text, cond) \ do { \
@@ -95,7 +96,7 @@ struct test_data_offset offsets[] = { }, }; -int dso__test_data (void ) +int test__dso_data (void ) {struct machine machine;struct dso *dso;
tools/perf/tests/parse-events.c +2 -1
@@ -4,6 +4,7 @@#include "evlist.h" #include "sysfs.h" #include "../../../include/linux/hw_breakpoint.h" +#include "tests.h" #define TEST_ASSERT_VAL (text, cond) \ do { \
@@ -1086,7 +1087,7 @@ static int test_pmu_events(void)return ret; } -int parse_events__test (void ) +int test__parse_events (void ) {int ret1, ret2 =0 ;
tools/perf/tests/tests.h +3 -0
@@ -12,6 +12,9 @@ int test__perf_evsel__roundtrip_name_test(void);int test__perf_evsel__tp_sched_test (void );int test__syscall_open_tp_fields (void );int test__pmu (void ); +int test__attr (void ); +int test__dso_data (void ); +int test__parse_events (void );/* Util */ int trace_event__id (const char *evname);
tools/perf/util/parse-events.h +0 -1
@@ -99,7 +99,6 @@ void parse_events__set_leader(char *name, struct list_head *list);void parse_events_update_lists (struct list_head *list_event,struct list_head *list_all);void parse_events_error (void *data,void *scanner,char const *msg); -int parse_events__test (void );void print_events (const char *event_glob,bool name_only);void print_events_type (u8 type);
tools/perf/util/symbol.h +0 -1
@@ -224,7 +224,6 @@ size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);size_t symbol__fprintf (struct symbol *sym,FILE *fp);bool symbol_type__is_a (char symbol_type,enum map_type map_type); -int dso__test_data (void );int dso__load_sym (struct dso *dso,struct map *map,struct symsrc *syms_ss,struct symsrc *runtime_ss,symbol_filter_t filter,int kmodule);
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Final cleanup for builtin-test move
Commit-ID: c81251e808fe2386e71990ecd49c408bb7cb4666 Gitweb: http://git.kernel.org/tip/c81251e808fe2386e71990ecd49c408bb7cb4666 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:51 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:50:24 -0300
perf tests: Final cleanup for builtin-test move
Final function renames to match test__* style and include cleanup.
--- tools/perf/perf.h | 1 - tools/perf/tests/attr.c | 3 ++- tools/perf/tests/builtin-test.c | 34 +++++++--------------------------- tools/perf/tests/dso-data.c | 3 ++- tools/perf/tests/parse-events.c | 3 ++- tools/perf/tests/tests.h | 3 +++ tools/perf/util/parse-events.h | 1 - tools/perf/util/symbol.h | 1 - 8 files changed, 16 insertions(+), 33 deletions(-)
tools/perf/perf.h +0 -1
@@ -178,7 +178,6 @@ extern bool test_attr__enabled;void test_attr__init (void );void test_attr__open (struct perf_event_attr *attr,pid_t pid,int cpu,int fd,int group_fd,unsigned long flags); -int test_attr__run (void ); static inline int sys_perf_event_open(struct perf_event_attr *attr,
tools/perf/tests/attr.c +2 -1
@@ -27,6 +27,7 @@#include "../perf.h" #include "util.h" #include "exec_cmd.h" +#include "tests.h" #define ENV "PERF_TEST_ATTR"
@@ -151,7 +152,7 @@ static int run_dir(const char *d, const char *perf)return system (cmd); } -int test_attr__run (void ) +int test__attr (void ) {struct stat st;char path_perf[PATH_MAX ];
tools/perf/tests/builtin-test.c +7 -27
@@ -4,31 +4,11 @@* Builtin regression testing command: ever growing number of sanity tests */ #include "builtin.h" - -#include "util/cache.h" -#include "util/color.h" -#include "util/debug.h" -#include "util/debugfs.h" -#include "util/evlist.h" -#include "util/machine.h" -#include "util/parse-options.h" -#include "util/parse-events.h" -#include "util/symbol.h" -#include "util/thread_map.h" -#include "util/pmu.h" -#include "event-parse.h" -#include "../../include/linux/hw_breakpoint.h" - -#include <sys/mman.h> - -#include "util/cpumap.h" -#include "util/evsel.h" -#include <sys/types.h> -#include "tests.h" - -#include <sched.h> - +#include "debug.h" +#include "color.h" +#include "parse-options.h" +#include "symbol.h" static struct test { const char *desc;
@@ -52,7 +32,7 @@ static struct test { }, { .desc = "parse events tests", - .func = parse_events__test, + .func = test__parse_events, },#if defined(__x86_64__) || defined(__i386__) {
@@ -70,7 +50,7 @@ static struct test { }, { .desc = "Test dso data interface", - .func = dso__test_data, + .func = test__dso_data, }, { .desc = "roundtrip evsel->name check",
@@ -86,7 +66,7 @@ static struct test { }, { .desc = "struct perf_event_attr setup", - .func = test_attr__run, + .func = test__attr, }, { .func = NULL,
tools/perf/tests/dso-data.c +2 -1
@@ -8,6 +8,7 @@#include "machine.h" #include "symbol.h" +#include "tests.h" #define TEST_ASSERT_VAL (text, cond) \ do { \
@@ -95,7 +96,7 @@ struct test_data_offset offsets[] = { }, }; -int dso__test_data (void ) +int test__dso_data (void ) {struct machine machine;struct dso *dso;
tools/perf/tests/parse-events.c +2 -1
@@ -4,6 +4,7 @@#include "evlist.h" #include "sysfs.h" #include "../../../include/linux/hw_breakpoint.h" +#include "tests.h" #define TEST_ASSERT_VAL (text, cond) \ do { \
@@ -1086,7 +1087,7 @@ static int test_pmu_events(void)return ret; } -int parse_events__test (void ) +int test__parse_events (void ) {int ret1, ret2 =0 ;
tools/perf/tests/tests.h +3 -0
@@ -12,6 +12,9 @@ int test__perf_evsel__roundtrip_name_test(void);int test__perf_evsel__tp_sched_test (void );int test__syscall_open_tp_fields (void );int test__pmu (void ); +int test__attr (void ); +int test__dso_data (void ); +int test__parse_events (void );/* Util */ int trace_event__id (const char *evname);
tools/perf/util/parse-events.h +0 -1
@@ -99,7 +99,6 @@ void parse_events__set_leader(char *name, struct list_head *list);void parse_events_update_lists (struct list_head *list_event,struct list_head *list_all);void parse_events_error (void *data,void *scanner,char const *msg); -int parse_events__test (void );void print_events (const char *event_glob,bool name_only);void print_events_type (u8 type);
tools/perf/util/symbol.h +0 -1
@@ -224,7 +224,6 @@ size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);size_t symbol__fprintf (struct symbol *sym,FILE *fp);bool symbol_type__is_a (char symbol_type,enum map_type map_type); -int dso__test_data (void );int dso__load_sym (struct dso *dso,struct map *map,struct symsrc *syms_ss,struct symsrc *runtime_ss,symbol_filter_t filter,int kmodule);
PATCH 12/12 perf tests: Check for mkstemp return value in dso-data test
In reply to Jiri OlsaAdding check for mkstemp return error value in dso-data test.
--- tools/perf/tests/dso-data.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/perf/tests/dso-data.c +4 -0
@@ -26,6 +26,10 @@ static char *test_file(int size)unsigned char *buf; fd =mkstemp (templ); +if (fd <0 ) { +perror ("mkstemp failed" ); +return NULL ; + } buf =malloc (size);if (!buf) {
Signature · 1 line
1.7.11.7
[tip:perf/core] perf tests: Check for mkstemp return value in dso-data test
Commit-ID: f95e0818cbd026a8f2277895c65fcc9cc5b28cf6 Gitweb: http://git.kernel.org/tip/f95e0818cbd026a8f2277895c65fcc9cc5b28cf6 Author: Jiri Olsa <[email protected]> AuthorDate: Sat, 10 Nov 2012 01:46:52 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 14 Nov 2012 16:50:30 -0300
perf tests: Check for mkstemp return value in dso-data test
Adding check for mkstemp return error value in dso-data test.
--- tools/perf/tests/dso-data.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/perf/tests/dso-data.c +4 -0
@@ -26,6 +26,10 @@ static char *test_file(int size)unsigned char *buf; fd =mkstemp (templ); +if (fd <0 ) { +perror ("mkstemp failed" ); +return NULL ; + } buf =malloc (size);if (!buf) {