Skip to content

Add JVMInformation support for JFR - #19974

Merged
tajila merged 1 commit into
eclipse-openj9:masterfrom
thallium:jvminfo
Aug 22, 2024
Merged

Add JVMInformation support for JFR#19974
tajila merged 1 commit into
eclipse-openj9:masterfrom
thallium:jvminfo

Conversation

@thallium

@thallium thallium commented Aug 7, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@thallium

thallium commented Aug 7, 2024

Copy link
Copy Markdown
Contributor Author

@tajila can you please take a look to see if I'm doing anything wrong?

Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
@tajila

tajila commented Aug 8, 2024

Copy link
Copy Markdown
Contributor

What was the JFR output ?

@thallium

thallium commented Aug 8, 2024

Copy link
Copy Markdown
Contributor Author

Example output:

jdk.JVMInformation {
  startTime = 10:38:54.670 (1732-04-28)
  jvmName = "Eclipse OpenJ9 VM"
  jvmVersion = "Eclipse OpenJ9 VM (build jvminfo-c249504ac6, JRE 21 Mac OS X aarch64-64-Bit 20240730_000000 (JIT enabled, AOT enabled))"
  jvmArguments = "-XX:+FlightRecorder --add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED"
  jvmFlags = N/A
  javaArguments = "JFRTest arggg fafda"
  jvmStartTime = 10:26:09.254 (2024-08-07)
  pid = 50925
}

Comment thread runtime/oti/j9nonbuilder.h Outdated
Comment thread runtime/vm/JFRChunkWriter.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
Comment thread runtime/vm/JFRConstantPoolTypes.hpp
Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
@thallium
thallium force-pushed the jvminfo branch 5 times, most recently from 505fc01 to e6fbbf1 Compare August 16, 2024 15:47
Comment thread runtime/vm/jfr.cpp
Comment thread runtime/vm/jfr.cpp Outdated
Comment thread runtime/vm/jfr.cpp
Comment thread runtime/vm/jfr.cpp Outdated
@thallium

Copy link
Copy Markdown
Contributor Author

Looks like the Line Ending Check failed because of something else.

Comment thread runtime/vm/jfr.cpp Outdated
jvmInformation->jvmArguments = (char *)j9mem_allocate_memory(sizeof(char) * (vmArgsLen + 1), OMRMEM_CATEGORY_VM);
char *cursor = jvmInformation->jvmArguments;

for (UDATA i = 0; i < vmArgs->nOptions; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nOptions is signed, you will get warnings when comparing signed vs unsigned

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread runtime/vm/jfr.cpp Outdated
/* Set JVM arguments by concatenating actualVMArgs */
JavaVMInitArgs *vmArgs = vm->vmArgsArray->actualVMArgs;
UDATA vmArgsLen = vmArgs->nOptions - 1;
for (UDATA i = 0; i < vmArgs->nOptions; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread runtime/vm/jfr.cpp Outdated
Comment thread runtime/vm/jfr.cpp Outdated
*
* @param vm[in] the J9JavaVM
*/
static void initializeJVMInformationEvent(J9JavaVM *vm)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

move this function to JFRConstantPoolTypes into a public static

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread runtime/vm/jfr.cpp Outdated
@tajila

tajila commented Aug 20, 2024

Copy link
Copy Markdown
Contributor

jenkins test sanity xlinux jdk17

Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
jvmInformation->jvmArguments = (char *)j9mem_allocate_memory(sizeof(char) * vmArgsLen, OMRMEM_CATEGORY_VM);
char *cursor = jvmInformation->jvmArguments;

for (I_32 i = 0; i < vmArgs->nOptions; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

one more thing, use IDATA instead

Comment thread runtime/vm/JFRConstantPoolTypes.hpp Outdated
/* Set JVM arguments by concatenating actualVMArgs */
JavaVMInitArgs *vmArgs = vm->vmArgsArray->actualVMArgs;
UDATA vmArgsLen = vmArgs->nOptions;
for (I_32 i = 0; i < vmArgs->nOptions; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here as well

Signed-off-by: Gengchen Tuo <gengchen.tuo@ibm.com>
@tajila

tajila commented Aug 21, 2024

Copy link
Copy Markdown
Contributor

jenkins Line Endings Check

@tajila

tajila commented Aug 21, 2024

Copy link
Copy Markdown
Contributor

jenkins test sanity xlinux jdk17

@tajila
tajila merged commit bbe7ad3 into eclipse-openj9:master Aug 22, 2024
@thallium
thallium deleted the jvminfo branch October 7, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants