@@ -59,6 +59,9 @@ public void test() throws InterruptedException {
5959 jfrCounters .put (nameAccessor .getMember (item ), countAccessor .getMember (item ).longValue ());
6060 }
6161 }
62+ int debugPrinted = 0 ;
63+ int nullTraceCount = 0 ;
64+ int emptyTraceCount = 0 ;
6265 for (IItemIterable wallclockSamples : events ) {
6366 IMemberAccessor <IQuantity , IItem > weightAccessor = WEIGHT .getAccessor (wallclockSamples .getType ());
6467 // this will become more generic in the future
@@ -69,6 +72,12 @@ public void test() throws InterruptedException {
6972 IMemberAccessor <String , IItem > stacktraceAccessor = JdkAttributes .STACK_TRACE_STRING .getAccessor (wallclockSamples .getType ());
7073 for (IItem sample : wallclockSamples ) {
7174 String stacktrace = stacktraceAccessor .getMember (sample );
75+ if (stacktrace == null ) { nullTraceCount ++; continue ; }
76+ if (stacktrace .isEmpty ()) { emptyTraceCount ++; continue ; }
77+ if (debugPrinted < 5 ) {
78+ System .out .println ("[DEBUG-TRACE-" + debugPrinted + "] " + stacktrace .substring (0 , Math .min (500 , stacktrace .length ())));
79+ debugPrinted ++;
80+ }
7281 if (!stacktrace .contains ("sleep" )) {
7382 // we don't know the context has been set for sure until the sleep has started
7483 continue ;
@@ -134,13 +143,19 @@ public void test() throws InterruptedException {
134143 System .out .printf ("Sample statistics: %d total (%d dropped, %.2f%%), weight %d total (%d dropped, %.2f%%)%n" ,
135144 totalSamplesCount , droppedSamplesCount , dropRate ,
136145 totalSamplesWeight , droppedSamplesWeight , dropWeightRate );
146+ System .out .println ("nullTraces=" + nullTraceCount + " emptyTraces=" + emptyTraceCount );
137147 // Print walkvm diagnostic counters
138148 System .out .println ("walkvm_vmthread_ok=" + jfrCounters .getOrDefault ("walkvm_vmthread_ok" , 0L )
139149 + " walkvm_no_vmthread=" + jfrCounters .getOrDefault ("walkvm_no_vmthread" , 0L )
140150 + " walkvm_thread_inaccessible=" + jfrCounters .getOrDefault ("walkvm_thread_inaccessible" , 0L )
141151 + " walkvm_anchor_null=" + jfrCounters .getOrDefault ("walkvm_anchor_null" , 0L )
142152 + " walkvm_cached_not_java=" + jfrCounters .getOrDefault ("walkvm_cached_not_java" , 0L )
143153 + " thread_entry_mark_detections=" + jfrCounters .getOrDefault ("thread_entry_mark_detections" , 0L ));
154+ System .out .println ("walkvm_hit_codeheap=" + jfrCounters .getOrDefault ("walkvm_hit_codeheap" , 0L )
155+ + " walkvm_codeh_no_vm=" + jfrCounters .getOrDefault ("walkvm_codeh_no_vm" , 0L )
156+ + " walkvm_anchor_used_inline=" + jfrCounters .getOrDefault ("walkvm_anchor_used_inline" , 0L )
157+ + " walkvm_anchor_fallback=" + jfrCounters .getOrDefault ("walkvm_anchor_fallback" , 0L )
158+ + " walkvm_depth_zero=" + jfrCounters .getOrDefault ("walkvm_depth_zero" , 0L ));
144159 }
145160 }
146161
0 commit comments