mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
perf test: TSC test, remove is_supported use
Migrate the is_supported functionality to returning TEST_SKIP. Motivation is kunit has no is_supported function. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Sohaib Mohamed <sohaib.amhmd@gmail.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Brendan Higgins <brendanhiggins@google.com> Cc: Daniel Latypov <dlatypov@google.com> Cc: David Gow <davidgow@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Clarke <pc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20211104064208.3156807-21-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
4935e2cd1b
commit
e74dd9cb33
1 changed files with 16 additions and 23 deletions
|
@ -23,6 +23,16 @@
|
||||||
#include "pmu.h"
|
#include "pmu.h"
|
||||||
#include "pmu-hybrid.h"
|
#include "pmu-hybrid.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Except x86_64/i386 and Arm64, other archs don't support TSC in perf. Just
|
||||||
|
* enable the test for x86_64/i386 and Arm64 archs.
|
||||||
|
*/
|
||||||
|
#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
|
||||||
|
#define TSC_IS_SUPPORTED 1
|
||||||
|
#else
|
||||||
|
#define TSC_IS_SUPPORTED 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CHECK__(x) { \
|
#define CHECK__(x) { \
|
||||||
while ((x) < 0) { \
|
while ((x) < 0) { \
|
||||||
pr_debug(#x " failed!\n"); \
|
pr_debug(#x " failed!\n"); \
|
||||||
|
@ -69,6 +79,11 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
|
||||||
u64 test_time, comm1_time = 0, comm2_time = 0;
|
u64 test_time, comm1_time = 0, comm2_time = 0;
|
||||||
struct mmap *md;
|
struct mmap *md;
|
||||||
|
|
||||||
|
if (!TSC_IS_SUPPORTED) {
|
||||||
|
pr_debug("Test not supported on this architecture");
|
||||||
|
return TEST_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
threads = thread_map__new(-1, getpid(), UINT_MAX);
|
threads = thread_map__new(-1, getpid(), UINT_MAX);
|
||||||
CHECK_NOT_NULL__(threads);
|
CHECK_NOT_NULL__(threads);
|
||||||
|
|
||||||
|
@ -185,26 +200,4 @@ out_err:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool test__tsc_is_supported(void)
|
DEFINE_SUITE("Convert perf time to TSC", perf_time_to_tsc);
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Except x86_64/i386 and Arm64, other archs don't support TSC in perf.
|
|
||||||
* Just enable the test for x86_64/i386 and Arm64 archs.
|
|
||||||
*/
|
|
||||||
#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct test_case perf_time_to_tsc_tests[] = {
|
|
||||||
TEST_CASE("Convert perf time to TSC", perf_time_to_tsc),
|
|
||||||
{ .name = NULL, }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct test_suite suite__perf_time_to_tsc = {
|
|
||||||
.desc = "Convert perf time to TSC",
|
|
||||||
.test_cases = perf_time_to_tsc_tests,
|
|
||||||
.is_supported = test__tsc_is_supported,
|
|
||||||
};
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue