Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81f17c90 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf test: Add 'struct test *' to the test functions

This way we'll be able to pass more test specific parameters without
having to change this function signature.

Will be used by the upcoming 'shell tests', shell scripts that will
call perf tools and check if they work as expected, comparing its
effects on the system (think 'perf probe foo') the output produced, etc.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-wq250w7j1opbzyiynozuajbl@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 28765bf2
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
#ifndef ARCH_TESTS_H
#ifndef ARCH_TESTS_H
#define ARCH_TESTS_H
#define ARCH_TESTS_H


#include <linux/compiler.h>
struct test;

/* Tests */
/* Tests */
int test__rdpmc(int subtest);
int test__rdpmc(struct test *test __maybe_unused, int subtest);
int test__perf_time_to_tsc(int subtest);
int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest);
int test__insn_x86(int subtest);
int test__insn_x86(struct test *test __maybe_unused, int subtest);
int test__intel_cqm_count_nmi_context(int subtest);
int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest);


#ifdef HAVE_DWARF_UNWIND_SUPPORT
#ifdef HAVE_DWARF_UNWIND_SUPPORT
struct thread;
struct thread;
+1 −1
Original line number Original line Diff line number Diff line
@@ -171,7 +171,7 @@ static int test_data_set(struct test_data *dat_set, int x86_64)
 * verbose (-v) option to see all the instructions and whether or not they
 * verbose (-v) option to see all the instructions and whether or not they
 * decoded successfuly.
 * decoded successfuly.
 */
 */
int test__insn_x86(int subtest __maybe_unused)
int test__insn_x86(struct test *test __maybe_unused, int subtest __maybe_unused)
{
{
	int ret = 0;
	int ret = 0;


+1 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ static pid_t spawn(void)
 * the last read counter value to avoid triggering a WARN_ON_ONCE() in
 * the last read counter value to avoid triggering a WARN_ON_ONCE() in
 * smp_call_function_many() caused by sending IPIs from NMI context.
 * smp_call_function_many() caused by sending IPIs from NMI context.
 */
 */
int test__intel_cqm_count_nmi_context(int subtest __maybe_unused)
int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused)
{
{
	struct perf_evlist *evlist = NULL;
	struct perf_evlist *evlist = NULL;
	struct perf_evsel *evsel = NULL;
	struct perf_evsel *evsel = NULL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@
 * %0 is returned, otherwise %-1 is returned.  If TSC conversion is not
 * %0 is returned, otherwise %-1 is returned.  If TSC conversion is not
 * supported then then the test passes but " (not supported)" is printed.
 * supported then then the test passes but " (not supported)" is printed.
 */
 */
int test__perf_time_to_tsc(int subtest __maybe_unused)
int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe_unused)
{
{
	struct record_opts opts = {
	struct record_opts opts = {
		.mmap_pages	     = UINT_MAX,
		.mmap_pages	     = UINT_MAX,
+1 −1
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ static int __test__rdpmc(void)
	return 0;
	return 0;
}
}


int test__rdpmc(int subtest __maybe_unused)
int test__rdpmc(struct test *test __maybe_unused, int subtest __maybe_unused)
{
{
	int status = 0;
	int status = 0;
	int wret = 0;
	int wret = 0;
Loading