Trace Agent Configuration - llmhyy/microbat GitHub Wiki
-javaagent:[path to instrumentator.jar]=[option1]=[value1],[option2]=[value20;value21;value22]
*:For option which allows multiple values, the separator semi-colon (;) is used in Windows, and colon (:) is used in MacOs/Linux.
precheck
ββRun agent in precheck mode.
ββdefault: false.
launch_class=className
ββTest class that can be launched by junit. The agent will start tracing when launch_class is executed.
entry_point=methodFullName
ββIf launch_class is undefined, option entry_point is required. Entry_point is the method at which the trace is started to build.
ββ[methodFullName]: className.[method_name|method_signature]
ββex: entry_point=com.sample.Foo.main([Ljava/lang/String;)V
java_home
ββJava home for jdk7 is required.
class_path=classpath
ββApplication classpath as a list of class directories, JAR files. Separate class path entries with the path_separator depends on Operating System: MacOs/Linux(:),Windows(;).
working_dir
ββProject folder.
dump_file_path
ββThe file path to store trace data.
tcp_port
ββIf tcp_port is defined, agent will connect to TCP port at localhost. Trace data will be written to TCP connection.
ββdefault: -1 (disable TCP option).
includes=filterExpressions
ββThe classes which are defined by filterExpressions will be included in instrumentation to collect variable runtime values.Separate expressions with the path_separator: MacOs/Linux(:),Windows(;).
ββSupported filter expressions:
βββ java.util.* : include all types and packages under java.util package.
βββ java.util.*\ : include all types only under java.util package.
βββ java.util.Arrays : include type Arrays only.
βββ java.util.Arrays* : include type Arrays and its inner types.
excludes=filterExpressions
ββThe classes which are defined by filterExpressions will be filtered when collecting trace.Separate expressions with the path_separator: MacOs/Linux(:),Windows(;).
ββSupported filter expressions:
βββ java.util.* : include all types and packages under java.util package.
βββ java.util.*\ : include all types only under java.util package.
βββ java.util.Arrays : include type Arrays only.
βββ java.util.Arrays* : include type Arrays and its inner types.
includes_file=file_path
ββAn alternative option for includes=filterExpressions. Filter expressions will be loaded from file_path.
excludes_file=file_path
ββAn alternative option for excludes=filterExpressions. Filter expressions will be loaded from file_path.
varLayer
ββSpecify the deepest layer of an object to collect variable values.
ββdefault: 2
stepLimit
ββThe max length of the trace to be collected. When the collected trace exceeds stepLimit, the agent will stop tracing.
ββdefault: -1 (no limit)
expectedSteps
ββThe agent will stop tracing when the trace size exceeds either expectedSteps or stepLimit . This option only affects in normal run mode (precheck=false).
ββdefault: -1 (no limit)
overlong_methods=methodFullNames
ββList of methods which will be over long after instrumentation. For these methods, some less important type of instructions will be discarded during instrumentation.
log=[debug|info|printProgress|error]
ββOptions to print out log. Separate log types with the path_separator: MacOs/Linux(:),Windows(;).
error: print out exception stack trace.
debug: print out useful debug info.
require_method_split
ββEnable applying method splitting function on methods which bytecode exceeds JVM limit after instrumentation.
ββdefault: false.
trace_recorder=[FILE|SQLITE3|MYSQL]
β&emsp suggest which method to store the trace file.
avoid_proxy_tostring
β&emspDurring tracing process, method toString of objects will be called when building variable value for each step, this might change the program execution. We provide option avoid_proxy_tostring to notify agent not to call toString() method on a proxy object.
ββdefault: false.
code_range
=className.methodName.startLine.endLine(;/:)className.methodName.startLine.endLine
ββDefine the range of code in application to record in trace.