File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
visualvm/jfr/src/org/graalvm/visualvm/jfr/impl Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,16 @@ public void run() {
91
91
if (dumpJFR != null ) {
92
92
new Finder (dumpJFR , DUMP_LONG_NAME ) {
93
93
@ Override
94
- public void found (Application application ) {
95
- boolean stop = stopJFR != null && stopJFR .length == 1 && stopJFR [0 ].equals (dumpJFR [0 ]);
96
- JFRSnapshotSupport .takeJfrDump (application , stop , true );
94
+ public void found (final Application application ) {
95
+ VisualVM .getInstance ().runTask (new Runnable () {
96
+ public void run () {
97
+ if (JFRSnapshotSupport .supportsJfrDump (application )) {
98
+ boolean stop = stopJFR != null && stopJFR .length == 1 && stopJFR [0 ].equals (dumpJFR [0 ]);
99
+ if (stop && !JFRSnapshotSupport .supportsJfrStop (application )) stop = false ;
100
+ JFRSnapshotSupport .takeJfrDump (application , stop , true );
101
+ }
102
+ }
103
+ });
97
104
}
98
105
}.find ();
99
106
return ;
@@ -102,8 +109,14 @@ public void found(Application application) {
102
109
if (stopJFR != null ) {
103
110
new Finder (stopJFR , STOP_LONG_NAME ) {
104
111
@ Override
105
- public void found (Application application ) {
106
- JFRSnapshotSupport .jfrStopRecording (application );
112
+ public void found (final Application application ) {
113
+ VisualVM .getInstance ().runTask (new Runnable () {
114
+ public void run () {
115
+ if (JFRSnapshotSupport .supportsJfrStop (application )) {
116
+ JFRSnapshotSupport .jfrStopRecording (application );
117
+ }
118
+ }
119
+ });
107
120
}
108
121
}.find ();
109
122
}
You can’t perform that action at this time.
0 commit comments