Class AbstractPerfAsmProfiler

java.lang.Object
org.openjdk.jmh.profile.AbstractPerfAsmProfiler
All Implemented Interfaces:
ExternalProfiler, Profiler
Direct Known Subclasses:
DTraceAsmProfiler, LinuxPerfAsmProfiler, WinPerfAsmProfiler

public abstract class AbstractPerfAsmProfiler extends Object implements ExternalProfiler
  • Field Details

    • requestedEventNames

      protected final List<String> 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

      private final String savePerfOutputTo
    • savePerfOutputToFile

      private final String savePerfOutputToFile
    • savePerfBin

      private final boolean savePerfBin
    • savePerfBinTo

      private final String savePerfBinTo
    • savePerfBinFile

      private final String savePerfBinFile
    • saveLog

      private final boolean saveLog
    • saveLogTo

      private final String saveLogTo
    • saveLogToFile

      private final String saveLogToFile
    • printCompilationInfo

      private final boolean printCompilationInfo
    • intelSyntax

      private final boolean intelSyntax
    • hsLog

      protected final TempFile hsLog
    • perfBinData

      protected final TempFile perfBinData
    • perfParsedData

      protected final TempFile perfParsedData
    • set

      protected final joptsimple.OptionSet set
    • drawIntraJumps

      private final boolean drawIntraJumps
    • drawInterJumps

      private final boolean drawInterJumps
  • Constructor Details

  • Method Details

    • addMyOptions

      protected abstract void addMyOptions(joptsimple.OptionParser parser)
    • addJVMOptions

      public Collection<String> addJVMOptions(BenchmarkParams params)
      Description copied from interface: ExternalProfiler
      Add JVM these options to the run.
      Specified by:
      addJVMOptions in interface ExternalProfiler
      Parameters:
      params - benchmark parameters used for current launch
      Returns:
      options to add to JVM launch
    • beforeTrial

      public void beforeTrial(BenchmarkParams params)
      Description copied from interface: ExternalProfiler
      Run this code before starting the trial. This method will execute before starting the benchmark JVM.
      Specified by:
      beforeTrial in interface ExternalProfiler
      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: ExternalProfiler
      Run this code after the trial is done. This method will execute after benchmark JVM had stopped.
      Specified by:
      afterTrial in interface ExternalProfiler
      Parameters:
      br - benchmark result that was the result of the trial
      pid - pid that the forked JVM had
      stdOut - file containing the standard output from the benchmark JVM
      stdErr - file containing the standard error from the benchmark JVM
      Returns:
      profiler results
    • allowPrintOut

      public boolean allowPrintOut()
      Description copied from interface: ExternalProfiler
      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.
      Specified by:
      allowPrintOut in interface ExternalProfiler
      Returns:
      returns true, if profiler allows harness to print out the standard output
    • allowPrintErr

      public boolean allowPrintErr()
      Description copied from interface: ExternalProfiler
      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.
      Specified by:
      allowPrintErr in interface ExternalProfiler
      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

      protected abstract AbstractPerfAsmProfiler.PerfEvents readEvents(double skipMs, double lenMs)
      Read parsed events.
      Parameters:
      skipMs - Milliseconds to skip.
      lenMs - Milliseconds to capture after skip
      Returns:
      Events.
    • stripEventNames

      protected List<String> stripEventNames(List<String> src)
      Some profilers strip modifiers from event names. To properly match the events in shared code, we need to know what those events were stripped to.
      Returns:
      stripped events
    • perfBinaryExtension

      protected abstract String perfBinaryExtension()
      Get perf binary data extension (optional).
      Returns:
      Extension.
    • processAssembly

      private TextResult processAssembly(BenchmarkResult br)
    • printLine

      private static void printLine(PrintWriter pw, AbstractPerfAsmProfiler.PerfEvents events, String event, long count)
    • printDottedLine

      private void printDottedLine(PrintWriter pw)
    • printDottedLine

      private void printDottedLine(PrintWriter pw, String header)
    • makeRegions

    • 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

      private Collection<Collection<String>> splitAssembly(File stdOut)
    • readAssembly

      private AbstractPerfAsmProfiler.Assembly readAssembly(File stdOut)
    • maybeAddress

      private boolean maybeAddress(String str)
    • parseAddress

      private long parseAddress(String address)