@@ -75,14 +75,12 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
75
75
double val , num_cpus_online , num_cpus , num_cores , num_dies , num_packages ;
76
76
int ret ;
77
77
struct expr_parse_ctx * ctx ;
78
- bool is_intel = false;
79
78
char strcmp_cpuid_buf [256 ];
80
79
struct perf_cpu cpu = {-1 };
81
80
char * cpuid = get_cpuid_allow_env_override (cpu );
82
81
char * escaped_cpuid1 , * escaped_cpuid2 ;
83
82
84
83
TEST_ASSERT_VAL ("get_cpuid" , cpuid );
85
- is_intel = strstr (cpuid , "Intel" ) != NULL ;
86
84
87
85
TEST_ASSERT_EQUAL ("ids_union" , test_ids_union (), 0 );
88
86
@@ -245,12 +243,19 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
245
243
if (num_dies ) // Some platforms do not have CPU die support, for example s390
246
244
TEST_ASSERT_VAL ("#num_dies >= #num_packages" , num_dies >= num_packages );
247
245
248
- TEST_ASSERT_VAL ("#system_tsc_freq" , expr__parse (& val , ctx , "#system_tsc_freq" ) == 0 );
249
- if (is_intel )
250
- TEST_ASSERT_VAL ("#system_tsc_freq > 0" , val > 0 );
251
- else
252
- TEST_ASSERT_VAL ("#system_tsc_freq == 0" , fpclassify (val ) == FP_ZERO );
253
246
247
+ if (expr__parse (& val , ctx , "#system_tsc_freq" ) == 0 ) {
248
+ bool is_intel = strstr (cpuid , "Intel" ) != NULL ;
249
+
250
+ if (is_intel )
251
+ TEST_ASSERT_VAL ("#system_tsc_freq > 0" , val > 0 );
252
+ else
253
+ TEST_ASSERT_VAL ("#system_tsc_freq == 0" , fpclassify (val ) == FP_ZERO );
254
+ } else {
255
+ #if defined(__i386__ ) || defined(__x86_64__ )
256
+ TEST_ASSERT_VAL ("#system_tsc_freq unsupported" , 0 );
257
+ #endif
258
+ }
254
259
/*
255
260
* Source count returns the number of events aggregating in a leader
256
261
* event including the leader. Check parsing yields an id.
0 commit comments