Package org.openjdk.jmh.profile
Class LinuxPerfProfiler
java.lang.Object
org.openjdk.jmh.profile.LinuxPerfProfiler
- All Implemented Interfaces:
ExternalProfiler,Profiler
-
Constructor Summary
Constructors -
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.booleanIf target VM communicates with profiler with standard error, this method can be used to shun the output to console.booleanIf target VM communicates with profiler with standard output, this method can be used to shun the output to console.voidbeforeTrial(BenchmarkParams params) Run this code before starting the trial.Human-readable one-line description of the profiler.
-
Constructor Details
-
LinuxPerfProfiler
- Throws:
ProfilerException
-
-
Method Details
-
addJVMInvokeOptions
Description copied from interface:ExternalProfilerPrepend JVM invocation with these commands.- Specified by:
addJVMInvokeOptionsin interfaceExternalProfiler- Parameters:
params- benchmark parameters used for current launch- Returns:
- commands to prepend for JVM launch
-
addJVMOptions
Description copied from interface:ExternalProfilerAdd JVM these options to the run.- Specified by:
addJVMOptionsin interfaceExternalProfiler- Parameters:
params- benchmark parameters used for current launch- Returns:
- options to add to JVM launch
-
beforeTrial
Description copied from interface:ExternalProfilerRun this code before starting the trial. This method will execute before starting the benchmark JVM.- Specified by:
beforeTrialin interfaceExternalProfiler- Parameters:
params- benchmark parameters used for current launch
-
afterTrial
public Collection<? extends Result> afterTrial(BenchmarkResult br, long pid, File stdOut, File stdErr) Description copied from interface:ExternalProfilerRun this code after the trial is done. This method will execute after benchmark JVM had stopped.- Specified by:
afterTrialin interfaceExternalProfiler- 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
public boolean allowPrintOut()Description copied from interface:ExternalProfilerIf 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.- Specified by:
allowPrintOutin interfaceExternalProfiler- Returns:
- returns true, if profiler allows harness to print out the standard output
-
allowPrintErr
public boolean allowPrintErr()Description copied from interface:ExternalProfilerIf 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.- Specified by:
allowPrintErrin interfaceExternalProfiler- Returns:
- returns true, if profiler allows harness to print out the standard errpr
-
getDescription
Description copied from interface:ProfilerHuman-readable one-line description of the profiler.- Specified by:
getDescriptionin interfaceProfiler- Returns:
- description
-