#include "pmus.h"
#include "target.h"
#include <linux/err.h>
+#include "dwarf-regs.h"
#define TEMPL "/tmp/perf-test-XXXXXX"
#define DATA_SIZE 10
struct aggr_cpu_id id;
struct perf_cpu cpu;
struct perf_env *env;
+ uint16_t e_machine;
session = perf_session__new(&data, NULL);
TEST_ASSERT_VAL("can't get session", !IS_ERR(session));
* condition is true (see do_core_id_test in header.c). So always
* run this test on those platforms.
*/
- if (!env->cpu && strncmp(env->arch, "s390", 4) && strncmp(env->arch, "aarch64", 7))
+ e_machine = perf_env__e_machine(env, NULL);
+
+ if (!env->cpu && e_machine != EM_S390 && e_machine != EM_AARCH64)
return TEST_SKIP;
/*
* physical_package_id will be set to -1. Hence skip this
* test if physical_package_id returns -1 for cpu from perf_cpu_map.
*/
- if (!strncmp(env->arch, "ppc64le", 7)) {
+ if (e_machine == EM_PPC64) {
if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
return TEST_SKIP;
}