4

I have installed jProfiler in my Linux machine and I am saving the data into .jps file. I am then loading this file into jProfiler UI in my local machine.

Here is my config file:

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <nextId id="104" />
  <generalSettings setupHasRun="false">
    <recordingProfiles>
      <recordingProfile  id="10" name="CPU recording">
            <actionKey id="cpu"/>
      </recordingProfile>
    </recordingProfiles>
  </generalSettings>
  <templates>
    <template id="50" name="Instrumentation, all features supported" startFrozen="false" recordCPUOnStartup="false" vmCannotExit="false" instrumentationType="1" samplingNoFilters="false" lineNumbers="false" samplingFrequency="5" timeType="1" disableCPUProfiling="false" recordAllocOnStartup="true" recordArrayAlloc="true" enableTriggersOnStartup="true" allocTreeRecordingType="1" disableMonitorContentions="false" componentDetection="true" chronoHeap="false" autoUpdatePeriodLong="5" autoUpdatePeriodShort="2" allUrls="false" payloadCap="50" eventCap="20000" showSystemThreads="false" utilConcurrentHandling="true" libraryDebugParameters="" exceptionalCap="5" exceptionalTimeType="4" autoTuneInstrumentation="true" autoTuneMaxAverage="100" autoTuneMinPerMille="10" samplingPayloadCallStacks="true" description="This is JProfiler's fully featured mode. In this setting, call stack information is accurate, but CPU overhead and distortion of measured call times may be high, depending on your filter settings. You should define inclusive filters for your own packages." system="true" />
    <template id="51" name="Sampling for CPU profiling, some features not supported" startFrozen="false" recordCPUOnStartup="false" vmCannotExit="false" instrumentationType="3" samplingNoFilters="false" lineNumbers="false" samplingFrequency="5" timeType="1" disableCPUProfiling="false" recordAllocOnStartup="true" recordArrayAlloc="true" enableTriggersOnStartup="true" allocTreeRecordingType="1" disableMonitorContentions="false" componentDetection="true" chronoHeap="false" autoUpdatePeriodLong="5" autoUpdatePeriodShort="2" allUrls="false" payloadCap="50" eventCap="20000" showSystemThreads="false" utilConcurrentHandling="true" libraryDebugParameters="" exceptionalCap="5" exceptionalTimeType="4" autoTuneInstrumentation="true" autoTuneMaxAverage="100" autoTuneMinPerMille="10" samplingPayloadCallStacks="true" description="This template is particularly suitable for CPU profiling and for memory profiling when accurate allocation information is not important. Sampling has a very low overhead and does not distort measured call tines. Some views, like the method statistics are no available. JEE payloads cannot be annotated in the call tree, but payload hotspots without backtraces are available." system="true" />
  </templates>
  <sessions>
    <session id="80" templateId="50" name="Animated Bezier Curve Demo" type="1" isStartupWorkingDirectory="true" mainClass="bezier.BezierAnim">
      <filters>
        <filter type="inclusive" name="com." />
      </filters>
      <exceptionalMethods/>
      <classPath>
        <classPathEntry path="demo/bezier/classes" />
      </classPath>
      <sourcePath>
        <sourcePathEntry path="demo/bezier/src" />
      </sourcePath>
      <probes>
        <probe name="com.jprofiler.agent.probe.interceptor.TrackingInterceptor" enabled="true" startProbeRecording="false" events="false" annotatePayloads="false">
          <id value="3" />
        </probe>
      </probes>
    </session>

The problem which I am facing is that I am not able to get any details regarding method statistics under the CPU views tab in jProfiler UI.

But I am able to get other fields in Telemetrics.

The version in use: JProfiler 9.1 and I have used sample config.xml to start with my test. DO i need to make any changed in my config file to get the method level statistics in my .jps file

Nilanka Manoj
  • 3,527
  • 4
  • 17
  • 48
Amandeep Singh
  • 297
  • 4
  • 19

1 Answers1

4

Method statistics is recorded separately, because the overhead is too high to always be recorded together with CPU data.

When the session is live, go the method statistics view and enabled recording. For offline profiling, there is a trigger action that starts method statistics recording.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • Hi, can you please provide an example to add trigger code in the config.xml file. – Amandeep Singh Nov 21 '15 at 06:06
  • You have to configure the trigger in the GUI, the config file format is not intended to be written manually. For more information see http://resources.ej-technologies.com/jprofiler/help/doc/helptopics/config/triggers.html – Ingo Kegel Nov 21 '15 at 08:06
  • Hi, I created a new session and added the triggers in GUI for methods. But where to get the config file for the new session? so that i can place it in my machine and use this session id while profiling – Amandeep Singh Nov 21 '15 at 11:46
  • Use Session->Export session settings – Ingo Kegel Nov 21 '15 at 11:47
  • Thanks Ingo, While choosing for method level triggering, Option 2 asks to Specify methods. What should i specify if i want to profile all the methods and also having very long list of methods. Can i just leave it blank in that case?so that it profiles all the available methods? – Amandeep Singh Nov 21 '15 at 16:10
  • The methods in a method trigger are not the methods that you want to profile, but the methods that trigger the associated actions. Don't use a method trigger, use a "JVM startup" trigger and add a "Start recording" action to it. – Ingo Kegel Nov 21 '15 at 16:57