update trace.md

This commit is contained in:
hengyunabc 2020-12-08 15:30:41 +08:00
parent 6a3d9fac33
commit 58f3f2a3ce
2 changed files with 6 additions and 3 deletions

View File

@ -59,6 +59,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 28 ms.
`---[0.03752ms] demo.MathGame:primeFactors() #24 [throws Exception]
```
> The `#24` in the result indicates that in the run function, the `primeFactors()` function was called on line `24` of the source file.
#### Trace times limit
@ -145,7 +146,7 @@ Trace -E com.test.ClassA|org.test.ClassB method1|method2|method3
> Supported since version 3.3.0.
Open terminal 1, trace the `run` method, and you can see the printout `listenerId: 1` .
Open terminal 1, trace the `run` method in the above demo, and you can see the printout `listenerId: 1` .
```bash
[arthas@59161]$ trace demo.MathGame run

View File

@ -63,6 +63,8 @@ Affect(class-cnt:1 , method-cnt:1) cost in 28 ms.
`---[0.03752ms] demo.MathGame:primeFactors() #24 [throws Exception]
```
> 结果里的 `#24`表示在run函数里在源文件的第`24`行调用了`primeFactors()`函数。
#### trace次数限制
如果方法调用的次数很多,那么可以用`-n`参数指定捕捉结果的次数。比如下面的例子里,捕捉到一次调用就退出命令。
@ -147,10 +149,10 @@ trace -E com.test.ClassA|org.test.ClassB method1|method2|method3
### 动态trace
3.3.0 版本后支持。
> 3.3.0 版本后支持。
打开终端1trace `run`函数,可以看到打印出 `listenerId: 1`
打开终端1trace上面demo里的`run`函数,可以看到打印出 `listenerId: 1`
```bash
[arthas@59161]$ trace demo.MathGame run