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

More JFR events support #20040

Merged
merged 1 commit into from
Sep 13, 2024
Merged

More JFR events support #20040

merged 1 commit into from
Sep 13, 2024

Conversation

thallium
Copy link
Contributor

Add support for:

  • PhysicalMemory
  • CPUInformation
  • OSInformation
  • VirtualizationInformation

@thallium
Copy link
Contributor Author

@tajila requesting your review

@thallium
Copy link
Contributor Author

Example output:

jdk.PhysicalMemory {
  startTime = 10:28:53.773 (1732-05-13)
  totalSize = 15.6 GB
  usedSize = 13.0 GB
}

jdk.CPUInformation {
  startTime = 10:28:53.773 (1732-05-13)
  cpu = "amd64"
  description = "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clfsh mmx fxsr sse sse2 ss sse3 pclmulqdq vmx ssse3 fma cmpxchg16b pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline aesni xsave osxsave avx f16c rdrand null ia32_tsc_adjust sgx hle avx2 fdp_excptn_only bmi2 ermsb invpcid rtm rdt_m adx smap avx512_ifma null"
  sockets = 1
  cores = 8
  hwThreads = 8
}

jdk.VirtualizationInformation {
  startTime = 10:28:53.773 (1732-05-13)
  name = "KVM"
}

jdk.OSInformation {
  startTime = 10:28:53.773 (1732-05-13)
  osVersion = "6.8.0-38-generic"
}

@tajila
Copy link
Contributor

tajila commented Aug 22, 2024

whats the output compared to the RI?

@thallium
Copy link
Contributor Author

RI's output:

jdk.PhysicalMemory {
  startTime = 08:54:26.752 (2024-08-22)
  totalSize = 15.6 GB
  usedSize = 1.7 GB
}

jdk.CPUInformation {
  startTime = 08:54:26.751 (2024-08-22)
  cpu = "Intel  SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64"
  description = "Brand: Intel Core Processor (Broadwell, IBRS), Vendor: GenuineIntel
Family:  (0x6), Model:  (0x3d), Stepping: 0x2
Ext. family: 0x0, Ext. model: 0x3, Type: 0x0, Signature: 0x000306d2
Features: ebx: 0x05000800, ecx: 0xfffa3223, edx: 0x0f8bfbff
Ext. features: eax: 0x000306d2, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800
Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Mach
ine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov
Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD e
xtensions, Streaming SIMD extensions 2, Self-Snoop, Streaming SIMD Extensions 3, PCLMULQDQ, Virtual Machine Extensions, Supplemental Streaming SIMD Extensions 3, Fused Mu
ltiply-Add, CMPXCHG16B, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instruction, TSC-Deadline, AESN
I, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture"
  sockets = 8
  cores = 8
  hwThreads = 8
}

jdk.VirtualizationInformation {
  startTime = 08:54:26.751 (2024-08-22)
  name = "KVM virtualization"
}

jdk.OSInformation {
  startTime = 08:54:26.751 (2024-08-22)
  osVersion = "DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"
uname: Linux 6.8.0-38-generic #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun  7 15:25:01 UTC 2024 x86_64
libc: glibc 2.39 NPTL 2.39
"
}

@thallium
Copy link
Contributor Author

Split JFRContstantEvent initialization into two phases: memory allocation and information initialization, so that if memory allocation failed JFR procedure could fail promptly.

runtime/vm/JFRChunkWriter.hpp Outdated Show resolved Hide resolved
runtime/vm/JFRConstantPoolTypes.hpp Outdated Show resolved Hide resolved
runtime/vm/JFRConstantPoolTypes.hpp Show resolved Hide resolved
runtime/vm/JFRChunkWriter.cpp Show resolved Hide resolved
runtime/vm/JFRChunkWriter.hpp Show resolved Hide resolved
runtime/vm/JFRConstantPoolTypes.hpp Outdated Show resolved Hide resolved
runtime/vm/JFRConstantPoolTypes.hpp Outdated Show resolved Hide resolved
runtime/vm/JFRConstantPoolTypes.hpp Outdated Show resolved Hide resolved
runtime/vm/JFRConstantPoolTypes.hpp Show resolved Hide resolved
@thallium
Copy link
Contributor Author

@tajila your comments have been addressed

@thallium
Copy link
Contributor Author

thallium commented Aug 29, 2024

Added "Entry" suffix to two constant pool entry structs so the naming stays consistent.

@tajila
Copy link
Contributor

tajila commented Sep 4, 2024

For OS version name, you can get more data by looking up the flllwing system properties: os.name, os.version and
os.arch

@thallium
Copy link
Contributor Author

thallium commented Sep 5, 2024

Changed OS version name to be the concatenation of os.name, os.version and os.arch. For some reason os.version is not available by the time of initialization so using j9sysinfo_get_OS_version instead.

Add support for:
- PhysicalMemory
- CPUInformation
- OSInformation
- VirtualizationInformation

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

tajila commented Sep 9, 2024

@thallium can you please build this on windows with the flag turned on

@tajila
Copy link
Contributor

tajila commented Sep 9, 2024

jenkins test sanity xlinux jdk17

@thallium
Copy link
Contributor Author

thallium commented Sep 9, 2024

@tajila https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK21_x86-64_windows_Personal/306/ build finished, only failed at cleaning workspace.

@tajila
Copy link
Contributor

tajila commented Sep 10, 2024

I noticed these errors in the build

17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(453): error C2220: the following warning is treated as an error
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(453): warning C4244: '=': conversion from 'UDATA' to 'I_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(459): warning C4244: '=': conversion from 'UDATA' to 'I_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(730): warning C4244: '+=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(857): warning C4244: '=': conversion from 'uintptr_t' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(862): warning C4244: '=': conversion from 'uintptr_t' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(223): warning C4477: 'sprintf' : format string '%lX' requires an argument of type 'unsigned long', but variadic argument 2 has type 'UDATA'
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(223): note: consider using '%llX' in the format string
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(223): note: consider using '%IX' in the format string
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(223): note: consider using '%I64X' in the format string
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(382): warning C4244: 'argument': conversion from '__int64' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(413): warning C4244: 'argument': conversion from '__int64' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(438): warning C4244: 'argument': conversion from '__int64' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRChunkWriter.hpp(469): warning C4244: 'argument': conversion from '__int64' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(453): error C2220: the following warning is treated as an error
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(453): warning C4244: '=': conversion from 'UDATA' to 'I_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(459): warning C4244: '=': conversion from 'UDATA' to 'I_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(730): warning C4244: '+=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(857): warning C4244: '=': conversion from 'uintptr_t' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.hpp(862): warning C4244: '=': conversion from 'uintptr_t' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.cpp(501): warning C4244: '=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.cpp(941): warning C4244: '=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.cpp(973): warning C4244: '=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.cpp(998): warning C4244: '=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  c:\users\jenkins\workspace\build_jdk21_x86-64_windows_personal\openj9\runtime\vm\JFRConstantPoolTypes.cpp(1028): warning C4244: '=': conversion from 'UDATA' to 'U_32', possible loss of data
17:03:22  make[6]: *** [runtime/vm/CMakeFiles/j9vm.dir/build.make:1506: runtime/vm/CMakeFiles/j9vm.dir/jfr.cpp.obj] Error 2
17:03:22  make[6]: *** Waiting for unfinished jobs....

@thallium
Copy link
Contributor Author

I noticed these errors in the build

My bad, do we intend to fix these currently?

@tajila
Copy link
Contributor

tajila commented Sep 10, 2024

My bad, do we intend to fix these currently?

Yes please fix them, they are mostly issues with type conversions

@thallium
Copy link
Contributor Author

#20158 Opened a PR to fix existing conversion issues.

@tajila tajila merged commit 0c6cdfd into eclipse-openj9:master Sep 13, 2024
5 checks passed
#if !defined(JFRCONSTANTPOOLTYPES_HPP_)
#define JFRCONSTANTPOOLTYPES_HPP_

#include "j9cfg.h"
#include "j9hypervisor.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

This leads to compile failures with UMA, which should be fixed by #20164.

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.

3 participants