On Linux Platforms
We can attach the running Java application using --pid
option. AMD uProf would be able to collect the profile data and attribute
the samples to interpreted Java functions.
GUI
To launch the AMDuProf GUI, go to page.
- Click Profile an Application on the Welcome page.
- Click Profile running Process(es) on the Welcome page.
- From Select Profile Target, select
Process(es).Figure 1. Profile Target Java Process
- Select the process Id.
- From Advanced Options, select Callstack Collection and Callstack Unwind Depth.
- Click Start Profile to start the profiling.
CLI
- To profile a running Java
process
$ ./AMDuProfCLI collect --config tbp -p < java-app-launch-pid> -o /tmp/ -d <duration> - To profile running Java process with callstack
collection
$ ./AMDuProfCLI collect --config tbp –g -p < java-app-launch-pid> -o /tmp/ -d <duration> - To generate a
report:
$ ./AMDuProfCLI report --src-path <path-to-java-app-source-dir> -i <raw-data-file-path>
On Windows and FreeBSD Platforms
AMD uProf cannot attach JvmtiAgent dynamically to an already running JVM. Hence, for any JVM process profiled by attach-process mechanism, AMD uProf cannot capture any class information, unless the JvmtiAgent library is loaded during JVM process start up.
To profile an already running Java process, pass -agentpath <path-to-agent-lib>option while launching Java
application so that AMD uProf can attach to the Java PID to collect profile data
later.
For a 64-bit JVM on Windows and FreeBSD
C:\> java -agentpath:<C:\ProgramFiles\AMD\AMDuProf\bin\ProfileAgents\x64\AMDJvmtiAgent.dll> <java-app-launch-options>
Note the process id (PID) of this JVM instance.
GUI
To launch the AMDuProf GUI, go to page.
- Click Profile running Process(es) on the Welcome page.
- From Select Profile Target, select Process(es).
- Select the java process Id.
- From Advanced Options, select Callstack Collection and Callstack Unwind Depth.
- Click Start Profile to start the profiling.