From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
irogers@google.com, namhyung@kernel.org
Cc: linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
akanksha@linux.ibm.com, maddy@linux.ibm.com,
atrajeev@linux.vnet.ibm.com, kjain@linux.ibm.com,
disgoel@linux.vnet.ibm.com, hbathini@linux.ibm.com
Subject: [PATCH] tools/perf/tests/expr: Make the system_tsc_freq test only for intel
Date: Tue, 22 Oct 2024 19:31:56 +0530 [thread overview]
Message-ID: <20241022140156.98854-1-atrajeev@linux.vnet.ibm.com> (raw)
The "Simple expression parser" test fails on powerpc
as below:
parsing metric: #system_tsc_freq
Unrecognized literal '#system_tsc_freq'literal: #system_tsc_freq = nan
syntax error
FAILED tests/expr.c:247 #system_tsc_freq
---- end(-1) ----
7: Simple expression parser : FAILED!
In the test, system_tsc_freq is checked as below:
if (is_intel)
TEST_ASSERT_VAL("#system_tsc_freq > 0", val > 0);
else
But commit 609aa2667f67 ("perf tool_pmu: Switch to standard
pmu functions and json descriptions")' changed condition in
tool_pmu__skip_event so that system_tsc_freq event should
only appear on x86
+#if !defined(__i386__) && !defined(__x86_64__)
+ /* The system_tsc_freq event should only appear on x86. */
+ if (strcasecmp(name, "system_tsc_freq") == 0)
+ return true;
+#endif
After this commit, the testcase breaks for expr__parse of
system_tsc_freq in powerpc case. Fix the testcase to have
complete system_tsc_freq test within "is_intel" check.
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
tools/perf/tests/expr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
index e3aa9d4fcf3a..eb3bd68fc4ce 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -244,11 +244,10 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
if (num_dies) // Some platforms do not have CPU die support, for example s390
TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);
- TEST_ASSERT_VAL("#system_tsc_freq", expr__parse(&val, ctx, "#system_tsc_freq") == 0);
- if (is_intel)
+ if (is_intel) {
+ TEST_ASSERT_VAL("#system_tsc_freq", expr__parse(&val, ctx, "#system_tsc_freq") == 0);
TEST_ASSERT_VAL("#system_tsc_freq > 0", val > 0);
- else
- TEST_ASSERT_VAL("#system_tsc_freq == 0", fpclassify(val) == FP_ZERO);
+ }
/*
* Source count returns the number of events aggregating in a leader
--
2.43.5
next reply other threads:[~2024-10-22 14:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 14:01 Athira Rajeev [this message]
2024-10-29 23:59 ` [PATCH] tools/perf/tests/expr: Make the system_tsc_freq test only for intel Namhyung Kim
2024-11-04 4:17 ` Athira Rajeev
2024-11-04 20:44 ` Ian Rogers
2024-11-06 9:34 ` Athira Rajeev
2024-11-07 13:56 ` Leo Yan
2024-11-08 5:20 ` Athira Rajeev
2024-12-03 18:16 ` Namhyung Kim
2024-12-03 18:42 ` Namhyung Kim
2024-12-03 18:59 ` Namhyung Kim
2024-12-05 17:00 ` Athira Rajeev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241022140156.98854-1-atrajeev@linux.vnet.ibm.com \
--to=atrajeev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=akanksha@linux.ibm.com \
--cc=disgoel@linux.vnet.ibm.com \
--cc=hbathini@linux.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).