@@ -439,6 +439,12 @@ struct YoungGenerationConfigurationEntry {
439439 U_64 newRatio;
440440};
441441
442+ struct GCTLABConfigurationEntry {
443+ BOOLEAN usesTLABs;
444+ U_64 minTLABSize;
445+ U_64 tlabRefillWasteLimit;
446+ };
447+
442448struct VirtualizationInformationEntry {
443449 const char *name;
444450};
@@ -474,6 +480,7 @@ struct JFRConstantEvents {
474480 OSInformationEntry OSInfoEntry;
475481 GCHeapConfigurationEntry GCHeapConfigEntry;
476482 YoungGenerationConfigurationEntry YoungGenConfigEntry;
483+ GCTLABConfigurationEntry GCTLABConfigEntry;
477484};
478485
479486class VM_JFRConstantPoolTypes {
@@ -579,6 +586,7 @@ class VM_JFRConstantPoolTypes {
579586 bool _shouldWriteModuleRequire;
580587 bool _shouldWriteModuleExport;
581588 bool _shouldWriteClassLoaderStatistics;
589+ bool _shouldWriteGCTLABConfigurationEvent;
582590
583591 /* Processing buffers */
584592 StackFrame *_currentStackFrameBuffer;
@@ -1314,6 +1322,11 @@ class VM_JFRConstantPoolTypes {
13141322 return _shouldWriteYoungGenerationConfigurationEvent;
13151323 }
13161324
1325+ bool shouldWriteGCTLABConfigurationEvent ()
1326+ {
1327+ return _shouldWriteGCTLABConfigurationEvent;
1328+ }
1329+
13171330 bool shouldWritePhysicalMemory ()
13181331 {
13191332 return _shouldWritePhysicalMemory;
@@ -1474,6 +1487,9 @@ class VM_JFRConstantPoolTypes {
14741487 case J9JFR_EVENT_TYPE_THREAD_ALLOCATION_STATISTICS :
14751488 addThreadAllocationStatistics ((J9JFRThreadAllocationStatistics *)event);
14761489 break ;
1490+ case J9JFR_EVENT_TYPE_GC_TLAB_CONFIGURATION :
1491+ _shouldWriteGCTLABConfigurationEvent = true ;
1492+ break ;
14771493 default :
14781494 Assert_VM_unreachable ();
14791495 break ;
@@ -1569,6 +1585,7 @@ class VM_JFRConstantPoolTypes {
15691585 initializeOSInformation (vm, result);
15701586 initializeGCHeapConfigurationEvent (vm);
15711587 initializeYoungGenerationConfigurationEvent (vm);
1588+ initializeGCTLABConfigurationEvent (vm);
15721589 }
15731590
15741591 /* *
@@ -1828,6 +1845,26 @@ class VM_JFRConstantPoolTypes {
18281845 }
18291846 }
18301847
1848+ /* *
1849+ * Initialize GCTLABConfigurationEntry
1850+ *
1851+ * @param vm[in] the J9JavaVM
1852+ */
1853+ static void initializeGCTLABConfigurationEvent (J9JavaVM *vm)
1854+ {
1855+ J9MemoryManagerFunctions *mmFuncs = vm->memoryManagerFunctions ;
1856+ GCTLABConfigurationEntry *tlabConfiguration = &(getJFRConstantEvents (vm)->GCTLABConfigEntry );
1857+
1858+ tlabConfiguration->usesTLABs = mmFuncs->j9gc_is_tlab_enabled (vm);
1859+ tlabConfiguration->minTLABSize = mmFuncs->j9gc_get_tlh_minimum_size (vm);
1860+ /* The closest OMR equivalent to tlabRefillWasteLimit is the
1861+ * initial value of abandonSize in TLHAllocationSupport::refresh(), which
1862+ * evaluates to max(tlhMinimumSize, tlhInitialSize / 2) on a fresh thread.
1863+ * We report tlhInitialSize / 2 as it dominates once refreshSize >= tlhInitialSize.
1864+ */
1865+ tlabConfiguration->tlabRefillWasteLimit = mmFuncs->j9gc_get_tlh_initial_size (vm) / 2 ;
1866+ }
1867+
18311868 static uintptr_t recordSystemProcessEvent (uintptr_t pid, const char *commandLine, void *userData)
18321869 {
18331870 VM_JFRConstantPoolTypes *constantPoolTypes = reinterpret_cast <VM_JFRConstantPoolTypes *>(userData);
@@ -2246,6 +2283,7 @@ class VM_JFRConstantPoolTypes {
22462283 , _shouldWriteModuleRequire(false )
22472284 , _shouldWriteModuleExport(false )
22482285 , _shouldWriteClassLoaderStatistics(false )
2286+ , _shouldWriteGCTLABConfigurationEvent(false )
22492287 , _previousStackTraceEntry(NULL )
22502288 , _firstStackTraceEntry(NULL )
22512289 , _previousThreadEntry(NULL )
0 commit comments