Class DTraceAsmProfiler

  • All Implemented Interfaces:
    ExternalProfiler, Profiler

    public class DTraceAsmProfiler
    extends AbstractPerfAsmProfiler
    Mac OS X perfasm profiler based on DTrace "profile-n" provider which samples program counter by timer interrupt. Due to DTrace limitations on Mac OS X target JVM cannot be run directly under DTrace control, so DTrace is run separately, all processes are sampled and irrelevant samples are filtered out in readEvents(double, double) stage. Super user privileges are required in order to run DTrace.

    If you see a lot of "[unknown]" regions in profile then you are probably hitting kernel code, kernel sampling is not yet supported.

    Since:
    18/10/2017
    • Field Detail

      • sampleFrequency

        private final long sampleFrequency
      • pid

        private volatile java.lang.String pid
      • dtraceProcess

        private volatile java.lang.Process dtraceProcess
      • optFrequency

        private joptsimple.OptionSpec<java.lang.Long> optFrequency
    • Method Detail

      • afterTrial

        public java.util.Collection<? extends Result> afterTrial​(BenchmarkResult br,
                                                                 long pid,
                                                                 java.io.File stdOut,
                                                                 java.io.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
        Overrides:
        afterTrial in class AbstractPerfAsmProfiler
        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
      • addJVMInvokeOptions

        public java.util.Collection<java.lang.String> addJVMInvokeOptions​(BenchmarkParams params)
        Description copied from interface: ExternalProfiler
        Prepend JVM invocation with these commands.
        Parameters:
        params - benchmark parameters used for current launch
        Returns:
        commands to prepend for JVM launch
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Profiler
        Human-readable one-line description of the profiler.
        Returns:
        description