Rate This Document
Findability
Accuracy
Completeness
Readability

Monitoring and Analyzing Java Applications

Command Function

Diagnoses Java applications in monitoring and analysis modes.

Syntax

  • Monitoring Mode

    Monitoring events that occur in Java processes in real time:

    1
    devkit diag jvm-jitter [-h | --help] {-a monitor | --action monitor} {-e EVENT | --event EVENT} [-c | --config] {-p PID | --pid PID}
    
  • Analysis mode

    Analyzing the process information based on the collected JDK Flight Recorder (JFR) file:

    1
    devkit diag jvm-jitter [-h | --help] {-a report | --action report} {-e EVENT | --event EVENT} {-f INPUT_FILE | --file INPUT_FILE} [-o OUTPUT_PATH | --output OUTPUT_PATH]
    

Parameter Description

Table 1 Common parameters

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-a/--action

monitor/report

Working mode of the JVM Jitter Detector. This parameter is mandatory.

  • monitor: monitoring mode.
  • report: analysis mode.

-e/--event

jit.deoptimization/codecache.full

Name of the event to be monitored or analyzed. The event can be a JIT de-optimization event or a code cache statistical event. This parameter is mandatory.

If different events are specified in the command line and configuration file, the event specified in the command line prevails.

Table 2 Monitoring mode parameters

Parameter

Option

Description

-p/--pid

PID

ID of the Java process to be monitored. This parameter is mandatory.

-c/--config

kunpeng_devkit.cfg

Configuration file. The tool provides a template configuration file in the config/kunpeng_devkit.cfg directory. This parameter is optional.

Table 3 Analysis mode parameters

Parameter

Option

Description

-f/--file

-

JFR file to be analyzed. This parameter is mandatory.

-o/--output

-

Path to the generated flame graphs for JFR de-optimization events. The default path is /diag/data in the tool directory. This parameter is optional.

If the tool directory is /home/DevKit-CLI-xx.xx.xx-Linux-Kunpeng, the reference path to the configuration file is /home/DevKit-CLI-xx.xx.xx-Linux-Kunpeng/diag/config/kunpeng_devkit.cfg.

The verification file can be used to check whether the .cfg file content is correct. The verification file path is /home/DevKit-CLI-xx.xx.xx-Linux-Kunpeng/diag/config/kunpeng_devkit.xsd.

Table 4 Parameters in the configuration file

Parameter

Description

enabled

Indicates whether to collect the specified event.

period

Collection interval. The default value is 100 ms for JIT events and 1000 ms for code cache events. Use a space between the number and unit. The unit is millisecond (ms), second (s), minute (m), hour (h), or day (d).

duration

Collection duration. The default value is 20 ms for JIT events and 100 ms for code cache events. Use a space between the number and unit. The unit is millisecond (ms), second (s), minute (m), hour (h), or day (d).

jitTraceThreshold

Threshold for triggering fine-grained JIT event collection. The default value is 0.1 (percentage of JIT events to all events). The value must be greater than 0.

jitCollectDuration

Sampling duration for each fine-grained JIT event collection. The default value is 1000 ms.

jitOutputPath

Path to the JFR files generated by JIT event collection. It can be a file directory or a full path to a file whose name ends with .jfr.

computeMode

Method for calculating the collection threshold. The default value is addCount. The options are as follows:

  • deoptimizationCount: counts only the number of incremental de-optimizations.
  • compileCount: counts the number of incremental de-optimizations and the number of compilations.
  • addCount: calculates the number of incremental de-optimizations and the number of incremental compilations.

CompilerInlining

Adds method inlining event collection. The default value is false.

Compilation

Adds compilation event collection. The default value is false.

CompilationFailure

Adds compilation failure event collection. The default value is false.

CompilerConfiguration

Adds compilation configuration event collection. The default value is false.

CompilerPhase

Adds compilation phase event collection. The default value is false.

JITRestart

Adds restart event collection. The default value is false.

codeCacheTraceThreshold

Threshold for triggering fine-grained code cache event collection. The default value is 0.35 (percentage of code cache events to all events). The value ranges from 0 to 1.

codeCacheAlarmThreshold

Threshold for triggering code cache event alarms. The default value is 0.75 (percentage of code cache events to all events). The value ranges from 0 to 1.