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

Add processor version in javacore file #5532

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
108 changes: 108 additions & 0 deletions runtime/rasdump/javadump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,105 @@ JavaCoreDumpWriter::writeEventDrivenTitle(void)
_OutputStream.writeCharacters(" received \n");
}

#if defined(J9OS_I5)

char * J9ProcessorArchitectureEnumToStr(J9ProcessorArchitecture input)
{
switch (input) {
case PROCESSOR_UNDEFINED:
return "PROCESSOR_UNDEFINED";
case PROCESSOR_S390_UNKNOWN:
return "PROCESSOR_S390_UNKNOWN";
case PROCESSOR_S390_GP6:
return "PROCESSOR_S390_GP6";
case PROCESSOR_S390_GP7:
return "PROCESSOR_S390_GP7";
case PROCESSOR_S390_GP8:
return "PROCESSOR_S390_GP8";
case PROCESSOR_S390_GP9:
return "PROCESSOR_S390_GP9";
case PROCESSOR_S390_GP10:
return "PROCESSOR_S390_GP10";
case PROCESSOR_S390_GP11:
return "PROCESSOR_S390_GP11";
case PROCESSOR_PPC_UNKNOWN:
return "PROCESSOR_PPC_UNKNOWN";
case PROCESSOR_PPC_7XX:
return "PROCESSOR_PPC_7XX";
case PROCESSOR_PPC_GP:
return "PROCESSOR_PPC_GP";
case PROCESSOR_PPC_GR:
return "PROCESSOR_PPC_GR";
case PROCESSOR_PPC_NSTAR:
return "PROCESSOR_PPC_NSTAR";
case PROCESSOR_PPC_PULSAR:
return "PROCESSOR_PPC_PULSAR";
case PROCESSOR_PPC_PWR403:
return "PROCESSOR_PPC_PWR403";
case PROCESSOR_PPC_PWR405:
return "PROCESSOR_PPC_PWR405";
case PROCESSOR_PPC_PWR440:
return "PROCESSOR_PPC_PWR440";
case PROCESSOR_PPC_PWR601:
return "PROCESSOR_PPC_PWR601";
case PROCESSOR_PPC_PWR602:
return "PROCESSOR_PPC_PWR602";
case PROCESSOR_PPC_PWR603:
return "PROCESSOR_PPC_PWR603";
case PROCESSOR_PPC_PWR604:
return "PROCESSOR_PPC_PWR604";
case PROCESSOR_PPC_PWR620:
return "PROCESSOR_PPC_PWR620";
case PROCESSOR_PPC_PWR630:
return "PROCESSOR_PPC_PWR630";
case PROCESSOR_PPC_RIOS1:
return "PROCESSOR_PPC_RIOS1";
case PROCESSOR_PPC_RIOS2:
return "PROCESSOR_PPC_RIOS2";
case PROCESSOR_PPC_P6:
return "PROCESSOR_PPC_P6";
case PROCESSOR_PPC_P7:
return "PROCESSOR_PPC_P7";
case PROCESSOR_PPC_P8:
return "PROCESSOR_PPC_P8";
case PROCESSOR_PPC_P9:
return "PROCESSOR_PPC_P9";
case PROCESSOR_X86_UNKNOWN:
return "PROCESSOR_X86_UNKNOWN";
case PROCESSOR_X86_INTELPENTIUM:
return "PROCESSOR_X86_INTELPENTIUM";
case PROCESSOR_X86_INTELP6:
return "PROCESSOR_X86_INTELP6";
case PROCESSOR_X86_INTELPENTIUM4:
return "PROCESSOR_X86_INTELPENTIUM4";
case PROCESSOR_X86_INTELCORE2:
return "PROCESSOR_X86_INTELCORE2";
case PROCESSOR_X86_INTELTULSA:
return "PROCESSOR_X86_INTELTULSA";
case PROCESSOR_X86_INTELNEHALEM:
return "PROCESSOR_X86_INTELNEHALEM";
case PROCESSOR_X86_INTELWESTMERE:
return "PROCESSOR_X86_INTELWESTMERE";
case PROCESSOR_X86_INTELSANDYBRIDGE:
return "PROCESSOR_X86_INTELSANDYBRIDGE";
case PROCESSOR_X86_INTELHASWELL:
return "PROCESSOR_X86_INTELHASWELL";
case PROCESSOR_X86_AMDK5:
return "PROCESSOR_X86_AMDK5";
case PROCESSOR_X86_AMDK6:
return "PROCESSOR_X86_AMDK6";
case PROCESSOR_X86_AMDATHLONDURON:
return "PROCESSOR_X86_AMDATHLONDURON";
case PROCESSOR_X86_AMDOPTERON:
return "PROCESSOR_X86_AMDOPTERON";
case PROCESSOR_DUMMY:
return "PROCESSOR_DUMMY";
default :
return "PROCESSOR_UNKNOWN";
}
}
#endif

/**************************************************************************************************/
/* */
/* JavaCoreDumpWriter::writeUserRequestedTitle() method implementation */
Expand Down Expand Up @@ -898,6 +997,15 @@ JavaCoreDumpWriter::writeProcessorSection(void)
_OutputStream.writeInteger(numberOfCpus, "%i");
_OutputStream.writeCharacters("\n");

#if defined(J9OS_I5)
J9ProcessorDesc desc;
memset(&desc, 0, sizeof(J9ProcessorDesc));
(void)j9sysinfo_get_processor_description(&desc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should handle the return value, not cast it away

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searched all codes in eclipse/openj9. Seems most of the case doesn't handle the return value.

_OutputStream.writeCharacters("3XHCPUVERS Version : ");
_OutputStream.writeCharacters(J9ProcessorArchitectureEnumToStr(desc.physicalProcessor));
_OutputStream.writeCharacters("\n");
#endif

/* Write the NUMA support description */
_OutputStream.writeCharacters("3XHNUMASUP ");
if (j9port_control(J9PORT_CTLDATA_VMEM_NUMA_IN_USE, 0)) {
Expand Down