reset
重置被Arthas增强过的类,Arthas服务端stop
时会重置所有增强过的类
命令选项
命令选项 | 描述 |
---|---|
-E, --regex | 开启正则匹配,默认为通配符匹配 |
-h, --help | 帮助 |
<class-pattern> | class文件模式匹配 |
示例
bash
# 跟踪run方法
[arthas@13728]$ trace demo.MathGame run
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 29 ms, listenerId: 6
`---ts=2023-03-30 14:21:03;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=jdk.internal.loader.ClassLoaders$AppClassLoader@6d06d69c
`---[2.6848ms] demo.MathGame:run()
`---[39.61% 1.0634ms ] demo.MathGame:primeFactors() #25 [throws Exception]
# 还原增强
[arthas@13728]$ reset
# retransform MathGame
[arthas@13728]$ retransform /tmp/demo/MathGame.class
retransform success, size: 1, classes:
demo.MathGame
[arthas@13728]$ retransform --deleteAll
# 还原retransform
[arthas@13728]$ reset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17