mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-12 22:41:26 +00:00
release 3.1.7
This commit is contained in:
1 parent
1eebba149e
commit
fee7ca8219
111 files changed
+618
-333
No files matched your search
@@ -12,9 +12,66 @@ options
|
||||
| disable-sub-class | false | whether to enable matching child classes. The default value is `true`. If exact match is desire, turn off this flag|
|
||||
| debug-for-asm | false | whether to enable ASM debugging log|
|
||||
| save-result | false | whether to save execution result. All execution results will be saved to `~/logs/arthas-cache/result.log` when it's turned on|
|
||||
| job-timeout | 1d | default timeout for background jobs. Background job will be terminated once it's timed out (i.e. 1d, 2h, 3m, 25s)|
|
||||
| job-timeout | 1d | default timeout for background jobs. Background job will be terminated once it's timed out (i.e. 1d, 2h, 3m, 25s)| print-parent-fields | true | This option enables print files in parent class, default value true.|
|
||||
|
||||
### Usage
|
||||
|
||||
|
||||
### View all options
|
||||
|
||||
```bash
|
||||
$ options
|
||||
LEVEL TYPE NAME VALUE SUMMARY DESCRIPTION
|
||||
--------------------------------------------------------------------------------------------
|
||||
0 bool unsafe false Option to support This option enables to proxy function
|
||||
ean system-level class ality of JVM classes. Due to serious
|
||||
security risk a JVM crash is possibly
|
||||
be introduced. Do not activate it un
|
||||
less you are able to manage.
|
||||
1 bool dump false Option to dump the This option enables the enhanced clas
|
||||
ean enhanced classes ses to be dumped to external file for
|
||||
further de-compilation and analysis.
|
||||
1 bool batch-re-tr true Option to support This options enables to reTransform c
|
||||
ean ansform batch reTransform lasses with batch mode.
|
||||
Class
|
||||
2 bool json-format false Option to support This option enables to format object
|
||||
ean JSON format of obj output with JSON when -x option selec
|
||||
ect output ted.
|
||||
1 bool disable-sub false Option to control This option disable to include sub cl
|
||||
ean -class include sub class ass when matching class.
|
||||
when class matchin
|
||||
g
|
||||
1 bool debug-for-a false Option to print DE This option enables to print DEBUG me
|
||||
ean sm BUG message if ASM ssage of ASM for each method invocati
|
||||
is involved on.
|
||||
1 bool save-result false Option to print co This option enables to save each comm
|
||||
ean mmand's result to and's result to log file, which path
|
||||
log file is ${user.home}/logs/arthas-cache/res
|
||||
ult.log.
|
||||
2 Stri job-timeout 1d Option to job time This option setting job timeout,The u
|
||||
ng out nit can be d, h, m, s for day, hour,
|
||||
minute, second. 1d is one day in defa
|
||||
ult
|
||||
1 bool print-paren true Option to print al This option enables print files in pa
|
||||
ean t-fields l fileds in parent rent class, default value true.
|
||||
class
|
||||
```
|
||||
|
||||
|
||||
### Get special option value
|
||||
|
||||
|
||||
```
|
||||
$ options json-format
|
||||
LEVEL TYPE NAME VALUE SUMMARY DESCRIPTION
|
||||
--------------------------------------------------------------------------------------------
|
||||
2 bool json-format false Option to support This option enables to format object
|
||||
ean JSON format of obj output with JSON when -x option selec
|
||||
ect output ted.
|
||||
```
|
||||
|
||||
> By default, `json-format` is false. When set `json-format` to true, commands like `wathc`/`tt` will print result with `json` format.
|
||||
|
||||
### Set special option value
|
||||
|
||||
For example, to enable saving command execution result, input the command below:
|
||||
|
||||
|
||||
+43
-29
@@ -43,13 +43,15 @@ Start `arthas-demo` in [Quick Start](quick-start.md).
|
||||
|
||||
```bash
|
||||
$ trace demo.MathGame run
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 42 ms.
|
||||
`---ts=2018-12-04 00:44:17;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[10.611029ms] demo.MathGame:run()
|
||||
+---[0.05638ms] java.util.Random:nextInt()
|
||||
+---[10.036885ms] demo.MathGame:primeFactors()
|
||||
`---[0.170316ms] demo.MathGame:print()
|
||||
Press Q or Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 28 ms.
|
||||
`---ts=2019-12-04 00:45:08;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[0.617465ms] demo.MathGame:run()
|
||||
`---[0.078946ms] demo.MathGame:primeFactors() #24 [throws Exception]
|
||||
|
||||
`---ts=2019-12-04 00:45:09;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[1.276874ms] demo.MathGame:run()
|
||||
`---[0.03752ms] demo.MathGame:primeFactors() #24 [throws Exception]
|
||||
```
|
||||
|
||||
|
||||
@@ -60,35 +62,47 @@ If the method invoked many times, use `-n` options to specify trace times. For e
|
||||
```bash
|
||||
$ trace demo.MathGame run -n 1
|
||||
Press Q or Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 35 ms.
|
||||
`---ts=2019-11-28 15:54:28;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[0.866311ms] demo.MathGame:run()
|
||||
+---[0.044001ms] java.util.Random:nextInt() #23
|
||||
+---[0.069037ms] demo.MathGame:primeFactors() #24 [throws Exception]
|
||||
+---[0.003227ms] java.lang.StringBuilder:<init>() #28
|
||||
+---[0.006155ms] java.lang.Integer:valueOf() #28
|
||||
+---[0.071335ms] java.lang.String:format() #28
|
||||
+---[min=0.002142ms,max=0.002237ms,total=0.004379ms,count=2] java.lang.StringBuilder:append() #28
|
||||
+---[0.011072ms] java.lang.Exception:getMessage() #28
|
||||
+---[0.006048ms] java.lang.StringBuilder:toString() #28
|
||||
`---[0.084138ms] java.io.PrintStream:println() #28
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 20 ms.
|
||||
`---ts=2019-12-04 00:45:53;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[0.549379ms] demo.MathGame:run()
|
||||
+---[0.059839ms] demo.MathGame:primeFactors() #24
|
||||
`---[0.232887ms] demo.MathGame:print() #25
|
||||
|
||||
Command execution times exceed limit: 1, so command will exit. You can set it with -n option.
|
||||
```
|
||||
|
||||
#### Ignore jdk method
|
||||
#### Include jdk method
|
||||
|
||||
* `--skipJDKMethod <value> ` skip jdk method trace, default value true.
|
||||
|
||||
```bash
|
||||
$ trace -j demo.MathGame run
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 31 ms.
|
||||
`---ts=2018-12-04 01:09:14;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[5.190646ms] demo.MathGame:run()
|
||||
+---[4.465779ms] demo.MathGame:primeFactors()
|
||||
`---[0.375324ms] demo.MathGame:print()
|
||||
```
|
||||
$ trace --skipJDKMethod false demo.MathGame run
|
||||
Press Q or Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 60 ms.
|
||||
`---ts=2019-12-04 00:44:41;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[1.357742ms] demo.MathGame:run()
|
||||
+---[0.028624ms] java.util.Random:nextInt() #23
|
||||
+---[0.045534ms] demo.MathGame:primeFactors() #24 [throws Exception]
|
||||
+---[0.005372ms] java.lang.StringBuilder:<init>() #28
|
||||
+---[0.012257ms] java.lang.Integer:valueOf() #28
|
||||
+---[0.234537ms] java.lang.String:format() #28
|
||||
+---[min=0.004539ms,max=0.005778ms,total=0.010317ms,count=2] java.lang.StringBuilder:append() #28
|
||||
+---[0.013777ms] java.lang.Exception:getMessage() #28
|
||||
+---[0.004935ms] java.lang.StringBuilder:toString() #28
|
||||
`---[0.06941ms] java.io.PrintStream:println() #28
|
||||
|
||||
* `-j`: jdkMethodSkip, skip jdk method trace
|
||||
`---ts=2019-12-04 00:44:42;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@3d4eac69
|
||||
`---[3.030432ms] demo.MathGame:run()
|
||||
+---[0.010473ms] java.util.Random:nextInt() #23
|
||||
+---[0.023715ms] demo.MathGame:primeFactors() #24 [throws Exception]
|
||||
+---[0.005198ms] java.lang.StringBuilder:<init>() #28
|
||||
+---[0.006405ms] java.lang.Integer:valueOf() #28
|
||||
+---[0.178583ms] java.lang.String:format() #28
|
||||
+---[min=0.011636ms,max=0.838077ms,total=0.849713ms,count=2] java.lang.StringBuilder:append() #28
|
||||
+---[0.008747ms] java.lang.Exception:getMessage() #28
|
||||
+---[0.019768ms] java.lang.StringBuilder:toString() #28
|
||||
`---[0.076457ms] java.io.PrintStream:println() #28
|
||||
```
|
||||
|
||||
#### Filtering by cost
|
||||
|
||||
|
||||
Reference in new issue
Block a user