Skip to content

Commit 4d3c8bb

Browse files
prevent usage of jfrsync for non java apps & only allow it for jfr output mode
1 parent 2a4f329 commit 4d3c8bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/profiler.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,14 @@ Error Profiler::start(Arguments& args, bool reset) {
12001200
return Error("mixed feature is only allowed with VMStructs stack walking");
12011201
}
12021202

1203+
if (args._jfr_sync && args._output != OUTPUT_JFR) {
1204+
return Error("jfrsync is only supported with jfr output");
1205+
}
1206+
1207+
if (args._jfr_sync && !VM::loaded()) {
1208+
return Error("jfrsync is not supported with non-Java processes");
1209+
}
1210+
12031211
// Kernel symbols are useful only for perf_events without --all-user
12041212
updateSymbols(_engine == &perf_events && !args._alluser);
12051213

0 commit comments

Comments
 (0)