Class AbstractPerfAsmProfiler
java.lang.Object
org.openjdk.jmh.profile.AbstractPerfAsmProfiler
- All Implemented Interfaces:
ExternalProfiler, Profiler
- Direct Known Subclasses:
DTraceAsmProfiler, LinuxPerfAsmProfiler, WinPerfAsmProfiler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class(package private) static class(package private) static classprotected static class(package private) static class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final booleanprivate final booleanprotected final TempFileprivate final booleanprivate final intprivate final intprivate final booleanprotected final TempFileprotected final TempFileprivate final booleanprivate final intprivate final doubleprivate final intprivate final intprivate final booleanprivate final Stringprivate final Stringprivate final booleanprivate final Stringprivate final Stringprivate final booleanprivate final Stringprivate final Stringprotected final joptsimple.OptionSetprivate final booleanprivate final booleanprivate final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPerfAsmProfiler(String initLine, String... events) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddInterval(List<Interval> intervals, long begAddr, long lastAddr, AbstractPerfAsmProfiler.Assembly asms) addJVMOptions(BenchmarkParams params) Add JVM these options to the run.protected abstract voidaddMyOptions(joptsimple.OptionParser parser) 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.figureHotIntervals(SortedSet<Long> addrs, AbstractPerfAsmProfiler.Assembly asms) private List<AbstractPerfAsmProfiler.Region> private booleanmaybeAddress(String str) private longparseAddress(String address) protected abstract voidParse profiler events from binary to text form.protected abstract StringGet perf binary data extension (optional).private voidprivate voidprintDottedLine(PrintWriter pw, String header) private static voidprintLine(PrintWriter pw, AbstractPerfAsmProfiler.PerfEvents events, String event, long count) private TextResultprivate AbstractPerfAsmProfiler.AssemblyreadAssembly(File stdOut) protected abstract AbstractPerfAsmProfiler.PerfEventsreadEvents(double skipMs, double lenMs) Read parsed events.private Collection<Collection<String>> splitAssembly(File stdOut) stripEventNames(List<String> src) Some profilers strip modifiers from event names.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ExternalProfiler
addJVMInvokeOptionsMethods inherited from interface Profiler
getDescription
-
Field Details
-
requestedEventNames
-
regionRateThreshold
private final double regionRateThreshold -
regionShowTop
private final int regionShowTop -
regionTooBigThreshold
private final int regionTooBigThreshold -
printMargin
private final int printMargin -
mergeMargin
private final int mergeMargin -
mergeMethods
private final boolean mergeMethods -
delayMsec
private final int delayMsec -
lengthMsec
private final int lengthMsec -
skipAssembly
private final boolean skipAssembly -
skipInterpreter
private final boolean skipInterpreter -
skipVMStubs
private final boolean skipVMStubs -
savePerfOutput
private final boolean savePerfOutput -
savePerfOutputTo
-
savePerfOutputToFile
-
savePerfBin
private final boolean savePerfBin -
savePerfBinTo
-
savePerfBinFile
-
saveLog
private final boolean saveLog -
saveLogTo
-
saveLogToFile
-
printCompilationInfo
private final boolean printCompilationInfo -
intelSyntax
private final boolean intelSyntax -
hsLog
-
perfBinData
-
perfParsedData
-
set
protected final joptsimple.OptionSet set -
drawIntraJumps
private final boolean drawIntraJumps -
drawInterJumps
private final boolean drawInterJumps
-
-
Constructor Details
-
AbstractPerfAsmProfiler
- Throws:
ProfilerException
-
-
Method Details
-
addMyOptions
protected abstract void addMyOptions(joptsimple.OptionParser parser) -
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
-
parseEvents
protected abstract void parseEvents()Parse profiler events from binary to text form. -
readEvents
Read parsed events.- Parameters:
skipMs- Milliseconds to skip.lenMs- Milliseconds to capture after skip- Returns:
- Events.
-
stripEventNames
-
perfBinaryExtension
Get perf binary data extension (optional).- Returns:
- Extension.
-
processAssembly
-
printLine
private static void printLine(PrintWriter pw, AbstractPerfAsmProfiler.PerfEvents events, String event, long count) -
printDottedLine
-
printDottedLine
-
makeRegions
private List<AbstractPerfAsmProfiler.Region> makeRegions(AbstractPerfAsmProfiler.Assembly asms, AbstractPerfAsmProfiler.PerfEvents events) -
figureHotIntervals
private List<Interval> figureHotIntervals(SortedSet<Long> addrs, AbstractPerfAsmProfiler.Assembly asms) -
addInterval
private void addInterval(List<Interval> intervals, long begAddr, long lastAddr, AbstractPerfAsmProfiler.Assembly asms) -
splitAssembly
-
readAssembly
-
maybeAddress
-
parseAddress
-