Package org.openjdk.jmh.profile
Interface ExternalProfiler
- All Superinterfaces:
Profiler
- All Known Implementing Classes:
AbstractPerfAsmProfiler
,AsyncProfiler
,DTraceAsmProfiler
,JavaFlightRecorderProfiler
,LinuxPerfAsmProfiler
,LinuxPerfC2CProfiler
,LinuxPerfNormProfiler
,LinuxPerfProfiler
,SafepointsProfiler
,WinPerfAsmProfiler
External profiler: profilers to be run outside of JVM.
External profilers usually call external tools to get the performance data. It is futile to query any internal JVM facilities in external profiler Java code, because it may not be executed in the benchmarked VM at all.
-
Method Summary
Modifier and TypeMethodDescriptionaddJVMInvokeOptions
(BenchmarkParams params) Prepend JVM invocation with these commands.addJVMOptions
(BenchmarkParams params) Add JVM these options to the run.Collection
<? extends Result> afterTrial
(BenchmarkResult br, long pid, File stdOut, File stdErr) Run this code after the trial is done.boolean
If target VM communicates with profiler with standard error, this method can be used to shun the output to console.boolean
If target VM communicates with profiler with standard output, this method can be used to shun the output to console.void
beforeTrial
(BenchmarkParams benchmarkParams) Run this code before starting the trial.Methods inherited from interface org.openjdk.jmh.profile.Profiler
getDescription
-
Method Details
-
addJVMInvokeOptions
Prepend JVM invocation with these commands.- Parameters:
params
- benchmark parameters used for current launch- Returns:
- commands to prepend for JVM launch
-
addJVMOptions
Add JVM these options to the run.- Parameters:
params
- benchmark parameters used for current launch- Returns:
- options to add to JVM launch
-
beforeTrial
Run this code before starting the trial. This method will execute before starting the benchmark JVM.- Parameters:
benchmarkParams
- benchmark parameters used for current launch
-
afterTrial
Run this code after the trial is done. This method will execute after benchmark JVM had stopped.- Parameters:
br
- benchmark result that was the result of the trialpid
- pid that the forked JVM hadstdOut
- file containing the standard output from the benchmark JVMstdErr
- file containing the standard error from the benchmark JVM- Returns:
- profiler results
-
allowPrintOut
boolean allowPrintOut()If target VM communicates with profiler with standard output, this method can be used to shun the output to console. Profiler is responsible for consuming the standard output and printing the relevant data from there.- Returns:
- returns true, if profiler allows harness to print out the standard output
-
allowPrintErr
boolean allowPrintErr()If target VM communicates with profiler with standard error, this method can be used to shun the output to console. Profiler is responsible for consuming the standard error and printing the relevant data from there.- Returns:
- returns true, if profiler allows harness to print out the standard errpr
-