Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize AArch64 in traceformat #18643

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ protected void summary(BufferedWriter out) throws IOException
* These String arrays refer to enum values in entries of the
* ProcessorInfo structure defined in xhpi.h .
*/
String[] Archs = { "Unknown", "x86", "S390", "Power", "IA64", "S390X", "AMD64", "RISCV"};
String[] SubTypes = { "i486", "i586", "Pentium II", "Pentium III",
"Merced","McKinley", "PowerRS", "PowerPC", "GigaProcessor", "ESA", "Pentium IV", "T-Rex", "Opteron", "RV64G"};
String[] Archs = { "Unknown", "x86", "S390", "Power", "IA64", "S390X", "AMD64", "RISCV", "AArch64" };
String[] SubTypes = { "i486", "i586", "Pentium II", "Pentium III", "Merced", "McKinley",
"PowerRS", "PowerPC", "GigaProcessor", "ESA", "Pentium IV", "T-Rex", "Opteron", "RV64G", "Armv8-A" };
String[] trCounter = { "Sequence Counter", "Special", "RDTSC Timer", "AIX Timer",
"MFSPR Timer", "MFTB Timer", "STCK Timer", "J9 timer"};
out.write("Sys Processor Info :");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ public class ProcessorSection {
protected static final int LONG = 8; // length of a long in bytes
protected static final String SUM_TAB = " ";

private final static String[] Archs = { "Unknown", "x86", "S390", "Power", "IA64", "S390X", "AMD64", "RISCV"};
private final static String[] SubTypes = { "i486", "i586", "Pentium II", "Pentium III", "Merced", "McKinley", "PowerRS", "PowerPC", "GigaProcessor", "ESA", "Pentium IV", "T-Rex", "Opteron", "RV64G"};
private final static String[] Archs = { "Unknown", "x86", "S390", "Power", "IA64", "S390X", "AMD64", "RISCV", "AArch64" };
private final static String[] SubTypes = { "i486", "i586", "Pentium II", "Pentium III", "Merced", "McKinley",
"PowerRS", "PowerPC", "GigaProcessor", "ESA", "Pentium IV", "T-Rex", "Opteron", "RV64G", "Armv8-A" };
private final static String[] trCounter = { "Sequence Counter", "Special", "RDTSC Timer", "AIX Timer", "MFSPR Timer", "MFTB Timer", "STCK Timer", "J9 timer" };

TraceContext context;
Expand Down
11 changes: 2 additions & 9 deletions runtime/oti/j9port.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ typedef enum J9ProcessorArchitecture {

PROCESOR_RISCV64_UNKNOWN,

PROCESOR_AARCH64_UNKNOWN,

PROCESSOR_DUMMY = 0x40000000 /* force wide enums */

} J9ProcessorArchitecture;
Expand Down Expand Up @@ -973,15 +975,6 @@ typedef struct J9CacheInfoQuery {
#define J9PORT_RESOURCE_SHARED_MEMORY OMRPORT_RESOURCE_SHARED_MEMORY
#define J9PORT_RESOURCE_ADDRESS_SPACE OMRPORT_RESOURCE_ADDRESS_SPACE

#define J9PORT_ARCH_X86 OMRPORT_ARCH_X86
#define J9PORT_ARCH_HAMMER OMRPORT_ARCH_HAMMER
#define J9PORT_ARCH_PPC OMRPORT_ARCH_PPC
#define J9PORT_ARCH_PPC64 OMRPORT_ARCH_PPC64
#define J9PORT_ARCH_PPC64LE OMRPORT_ARCH_PPC64LE
#define J9PORT_ARCH_S390 OMRPORT_ARCH_S390
#define J9PORT_ARCH_S390X OMRPORT_ARCH_S390X
#define J9PORT_ARCH_RISCV OMRPORT_ARCH_RISCV

#define J9PORT_RESOURCE_CORE_FLAGS OMRPORT_RESOURCE_CORE_FLAGS
#define J9PORT_RESOURCE_FILE_DESCRIPTORS OMRPORT_RESOURCE_FILE_DESCRIPTORS

Expand Down
16 changes: 16 additions & 0 deletions runtime/port/unix/j9sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ static intptr_t getS390Description(struct J9PortLibrary *portLibrary, J9Processo
static intptr_t getRISCV64Description(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc);
#endif /* defined(RISCV64) */

#if defined(J9AARCH64)
static intptr_t getAArch64Description(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc);
#endif /* defined(J9AARCH64) */

#if (defined(LINUXPPC) || defined(AIXPPC))
static J9ProcessorArchitecture mapPPCProcessor(const char *processorName);
static void setFeature(J9ProcessorDesc *desc, uint32_t feature);
Expand Down Expand Up @@ -445,6 +449,8 @@ j9sysinfo_get_processor_description(struct J9PortLibrary *portLibrary, J9Process
rc = getS390Description(portLibrary, desc);
#elif defined(RISCV64)
rc = getRISCV64Description(portLibrary, desc);
#elif defined(J9AARCH64)
rc = getAArch64Description(portLibrary, desc);
#endif
}

Expand Down Expand Up @@ -1230,6 +1236,16 @@ getRISCV64Description(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc)
}
#endif /* defined(RISCV64) */

#if defined(J9AARCH64)
static intptr_t
getAArch64Description(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc)
{
desc->processor = PROCESOR_AARCH64_UNKNOWN;
desc->physicalProcessor = desc->processor;
return 0;
}
#endif /* defined(J9AARCH64) */

BOOLEAN
j9sysinfo_processor_has_feature(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc, uint32_t feature)
{
Expand Down
19 changes: 11 additions & 8 deletions runtime/rastrace/trclog.c
Original file line number Diff line number Diff line change
Expand Up @@ -2465,27 +2465,30 @@ static UtProcessorInfo * getProcessorInfo(void)
initHeader(&ret->procInfo.header, "PIN", sizeof(UtProcInfo));
osarch = j9sysinfo_get_CPU_architecture();
if (NULL != osarch) {
if ((strcmp(osarch, J9PORT_ARCH_PPC) == 0)
|| (strcmp(osarch, J9PORT_ARCH_PPC64) == 0)
|| (strcmp(osarch, J9PORT_ARCH_PPC64LE) == 0)
if ((0 == strcmp(osarch, OMRPORT_ARCH_PPC))
|| (0 == strcmp(osarch, OMRPORT_ARCH_PPC64))
|| (0 == strcmp(osarch, OMRPORT_ARCH_PPC64LE))
) {
ret->architecture = UT_POWER;
ret->procInfo.subtype = UT_POWERPC;
} else if (strcmp(osarch, J9PORT_ARCH_S390) == 0) {
} else if (0 == strcmp(osarch, OMRPORT_ARCH_S390)) {
ret->architecture = UT_S390;
ret->procInfo.subtype = UT_ESA;
} else if (strcmp(osarch, J9PORT_ARCH_S390X) == 0) {
} else if (0 == strcmp(osarch, OMRPORT_ARCH_S390X)) {
ret->architecture = UT_S390X;
ret->procInfo.subtype = UT_TREX;
} else if (strcmp(osarch, J9PORT_ARCH_HAMMER) == 0) {
} else if (0 == strcmp(osarch, OMRPORT_ARCH_HAMMER)) {
ret->architecture = UT_AMD64;
ret->procInfo.subtype = UT_OPTERON;
} else if (strcmp(osarch, J9PORT_ARCH_X86) == 0) {
} else if (0 == strcmp(osarch, OMRPORT_ARCH_X86)) {
ret->architecture = UT_X86;
ret->procInfo.subtype = UT_PIV;
} else if (0 == strcmp(osarch, J9PORT_ARCH_RISCV)) {
} else if (0 == strcmp(osarch, OMRPORT_ARCH_RISCV)) {
ret->architecture = UT_RISCV;
ret->procInfo.subtype = UT_RV64G;
} else if (0 == strcmp(osarch, OMRPORT_ARCH_AARCH64)) {
ret->architecture = UT_AARCH64;
ret->procInfo.subtype = UT_ARMV8A;
} else {
ret->architecture = UT_UNKNOWN;
}
Expand Down