mirror of https://github.com/alibaba/arthas.git
update doc
parent
711c3fe925
commit
5b8ade6f24
@ -0,0 +1,114 @@
|
||||
stack
|
||||
=====
|
||||
|
||||
Print out the full call stack trace containing the current method.
|
||||
|
||||
Most of the time, we know the method being invoked but not always we know **HOW being invoked**; `stack` can be a great help to locate the *source* for you.
|
||||
|
||||
### Parameters
|
||||
|
||||
|Name|Specification|
|
||||
|---:|:---|
|
||||
|*class-pattern*|pattern for the class name|
|
||||
|*method-pattern*|pattern for the method name|
|
||||
|*condition-express*|condition expression|
|
||||
|[E]|turn on regx matching while the default is wildcards matching|
|
||||
|`[n:]`|calling times|
|
||||
|
||||
F.Y.I
|
||||
1. any valid OGNL expression as `"{params,returnObj}"` supported;
|
||||
2. filter by time cost as `trace *StringUtils isBlank '$cost>100'`; calling stack with only time cost higher than `100ms` will be printed.
|
||||
|
||||
Attention:
|
||||
1. `$cost` can be used in `watch/stack/trace`;
|
||||
2. using `#cost` in Arthas 3.0 instead of `$cost`.
|
||||
|
||||
|
||||
Advanced:
|
||||
* [Critical fields in expression](advice-class.md)
|
||||
* [Special usage](https://github.com/alibaba/arthas/issues/71)
|
||||
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
The quoting rules: if there are quotes within the expression, use another type of quotes to quote the whole expression.
|
||||
|
||||
```
|
||||
$ stack com.alibaba.sample.petstore.dal.dao.ProductDao getProductById 'params[0]=="K9-BD-01"'
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 51 ms.
|
||||
thread_name="http-bio-8080-exec-4" thread_id=0x4a;is_daemon=true;priority=5;
|
||||
@com.alibaba.sample.petstore.dal.dao.ibatis.IbatisProductDao.getProductById()
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList.execute(ItemList.java:50)
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList$$FastClassByCGLIB$$40b2f45f.invoke(<generated>:-1)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.DataBindingAdapter.executeAndReturn(DataBindingAdapter.java:41)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.performScreenModule(PerformScreenValve.java:111)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.invoke(PerformScreenValve.java:74)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:73)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
......
|
||||
|
||||
thread_name="http-bio-8080-exec-2" thread_id=0x48;is_daemon=true;priority=5;
|
||||
@com.alibaba.sample.petstore.dal.dao.ibatis.IbatisProductDao.getProductById()
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList.execute(ItemList.java:50)
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList$$FastClassByCGLIB$$40b2f45f.invoke(<generated>:-1)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.DataBindingAdapter.executeAndReturn(DataBindingAdapter.java:41)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.performScreenModule(PerformScreenValve.java:111)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.invoke(PerformScreenValve.java:74)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:73)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.ChooseValve.invoke(ChooseValve.java:98)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
......
|
||||
```
|
||||
|
||||
Filtering by time cost:
|
||||
|
||||
```
|
||||
$ stack com.alibaba.sample.petstore.web.store.module.screen.ItemList execute #cost>30
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 123 ms.
|
||||
stack com.alibaba.sample.petstore.web.store.module.screen.ItemList execute #cost>30
|
||||
thread_name=http-nio-8080-exec-10;id=31;is_daemon=true;priority=5;TCCL=com.taobao.pandora.boot.embedded.tomcat.TomcatEmbeddedWebappClassLoader
|
||||
@com.alibaba.sample.petstore.web.store.module.screen.ItemList.execute()
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList$$FastClassByCGLIB$$40b2f45f.invoke(<generated>:-1)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.DataBindingAdapter.executeAndReturn(DataBindingAdapter.java:41)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.performScreenModule(PerformScreenValve.java:111)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.invoke(PerformScreenValve.java:74)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:73)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.ChooseValve.invoke(ChooseValve.java:98)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.LoopValve.invokeBody(LoopValve.java:105)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.LoopValve.invoke(LoopValve.java:83)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PageAuthorizationValve.invoke(PageAuthorizationValve.java:105)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.CheckCsrfTokenValve.invoke(CheckCsrfTokenValve.java:123)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.AnalyzeURLValve.invoke(AnalyzeURLValve.java:126)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.SetLoggingContextValve.invoke(SetLoggingContextValve.java:66)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PrepareForTurbineValve.invoke(PrepareForTurbineValve.java:52)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.webx.impl.WebxControllerImpl.service(WebxControllerImpl.java:43)
|
||||
at com.alibaba.citrus.webx.impl.WebxRootControllerImpl.handleRequest(WebxRootControllerImpl.java:53)
|
||||
at com.alibaba.citrus.webx.support.AbstractWebxRootController.service(AbstractWebxRootController.java:165)
|
||||
.........
|
||||
```
|
@ -0,0 +1,194 @@
|
||||
tt
|
||||
==
|
||||
|
||||
Check the parameters, return values and exceptions of the methods at different times.
|
||||
|
||||
`watch` is a powerful command but due to its feasibility and complexity, it's quite hard to locate the issue effectively.
|
||||
|
||||
In such difficulties, `tt` comes into play.
|
||||
|
||||
With the help of `tt` (abbreviated from *TimeTunnel*), you can check the contexts of the methods at different times.
|
||||
|
||||
### Usage
|
||||
|
||||
Let's record the whole calling contexts:
|
||||
|
||||
```java
|
||||
$ tt -t -n 3 *Test print
|
||||
Press Ctrl+D or Ctrl+X to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 115 ms.
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| INDEX | TIMESTAMP | COST(ms) | IS-RET | IS-EXP | OBJECT | CLASS | METHOD |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1007 | 2015-07-26 12:23:21 | 138 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1008 | 2015-07-26 12:23:22 | 143 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1009 | 2015-07-26 12:23:23 | 130 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
$
|
||||
```
|
||||
|
||||
#### F.Y.I
|
||||
|
||||
- `-t`
|
||||
|
||||
record the calling context of the method `*Test.print`
|
||||
|
||||
- `-n 3`
|
||||
|
||||
limit the number of the records (avoid overflow for too many records; with `-n` option, Arthas can automatically stop recording once the records reach the limit)
|
||||
|
||||
#### Property
|
||||
|
||||
|Name|Specification|
|
||||
|---|---|
|
||||
|INDEX|the index for each call based on time|
|
||||
|TIMESTAMP|time to invoke the method|
|
||||
|COST(ms)|time cost of the method call|
|
||||
|IS-RET|end with normal return|
|
||||
|IS-EXP|end with exceptions|
|
||||
|OBJECT|`hashCode()` of the object invoking the method|
|
||||
|CLASS|class name of the object invoking the method|
|
||||
|METHOD|method being invoked|
|
||||
|
||||
#### Condition expression
|
||||
|
||||
Tips:
|
||||
1. `tt -t *Test print params[0].length==1` with different amount of parameters;
|
||||
2. `tt -t *Test print 'params[1] instanceof Integer'` with different types of parameters;
|
||||
3. `tt -t *Test print params[0].mobile=="13989838402"` with specified parameter.
|
||||
|
||||
Advanced:
|
||||
* [Critical fields in expression](advice-class.md)
|
||||
* [Special usage](https://github.com/alibaba/arthas/issues/71)
|
||||
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
|
||||
|
||||
|
||||
### Searching for records
|
||||
|
||||
#### A specified time range
|
||||
|
||||
```
|
||||
$ tt -l
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| INDEX | TIMESTAMP | COST(ms) | IS-RET | IS-EXP | OBJECT | CLASS | METHOD |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1000 | 2015-07-26 01:16:27 | 130 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1001 | 2015-07-26 01:16:27 | 0 | false | true | 0x42cc13a0 | GaOgnlUtilsTest | printAddress |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1002 | 2015-07-26 01:16:28 | 119 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1003 | 2015-07-26 01:16:28 | 0 | false | true | 0x42cc13a0 | GaOgnlUtilsTest | printAddress |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1004 | 2015-07-26 12:21:56 | 130 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1005 | 2015-07-26 12:21:57 | 138 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1006 | 2015-07-26 12:21:58 | 130 | true | false | 0x42cc13a0 | GaOgnlUtilsTest | print |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
Affect(row-cnt:7) cost in 2 ms.
|
||||
$
|
||||
```
|
||||
|
||||
#### A specified method
|
||||
|
||||
```
|
||||
$ tt -s method.name=="printAddress"
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| INDEX | TIMESTAMP | COST(ms) | IS-RET | IS-EXP | OBJECT | CLASS | METHOD |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1001 | 2015-07-26 01:16:27 | 0 | false | true | 0x42cc13a0 | GaOgnlUtilsTest | printAddress |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
| 1003 | 2015-07-26 01:16:28 | 0 | false | true | 0x42cc13a0 | GaOgnlUtilsTest | printAddress |
|
||||
+----------+----------------------+------------+----------+----------+-----------------+--------------------------------+--------------------------------+
|
||||
Affect(row-cnt:2) cost in 55 ms.
|
||||
$
|
||||
```
|
||||
|
||||
Advanced:
|
||||
* [Critical fields in expression](advice-class.md)
|
||||
|
||||
### Check context of the call
|
||||
|
||||
Using `tt -i <index>` to check a specific record.
|
||||
|
||||
```
|
||||
$
|
||||
$ tt -i 1003
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| INDEX | 1003 |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| GMT-CREATE | 2015-07-26 01:16:28 |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| COST(ms) | 0 |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| OBJECT | 0x42cc13a0 |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| CLASS | GaOgnlUtilsTest |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| METHOD | printAddress |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| IS-RETURN | false |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| IS-EXCEPTION | true |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| PARAMETERS[0] | Address@53448f87 |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
| THROW-EXCEPTION | java.lang.RuntimeException: test |
|
||||
| | at GaOgnlUtilsTest.printAddress(Unknown Source) |
|
||||
| | at GaOgnlUtilsTest.<init>(Unknown Source) |
|
||||
| | at GaOgnlUtilsTest.main(Unknown Source) |
|
||||
+-----------------+------------------------------------------------------------------------------------------------------+
|
||||
Affect(row-cnt:1) cost in 1 ms.
|
||||
$
|
||||
```
|
||||
|
||||
### Re-produce
|
||||
|
||||
Since Arthas stores the context of the call, you can even re-produce the method calling after some modifications with extra option `-p`.
|
||||
|
||||
```
|
||||
$ tt -i 1003 -p
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| RE-INDEX | 1003 |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| GMT-REPLAY | 2015-07-26 17:29:51 |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| OBJECT | 0x42cc13a0 |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| CLASS | GaOgnlUtilsTest |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| METHOD | printAddress |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| PARAMETERS[0] | Address@53448f87 |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| IS-RETURN | false |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| IS-EXCEPTION | true |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
| THROW-EXCEPTION | java.lang.RuntimeException: test |
|
||||
| | at GaOgnlUtilsTest.printAddress(GaOgnlUtilsTest.java:78) |
|
||||
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) |
|
||||
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) |
|
||||
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) |
|
||||
| | at java.lang.reflect.Method.invoke(Method.java:483) |
|
||||
| | at com.github.ompc.Arthas.util.GaMethod.invoke(GaMethod.java:81) |
|
||||
| | at com.github.ompc.Arthas.command.TimeTunnelCommand$6.action(TimeTunnelCommand.java:592) |
|
||||
| | at com.github.ompc.Arthas.server.DefaultCommandHandler.execute(DefaultCommandHandler.java:175) |
|
||||
| | at com.github.ompc.Arthas.server.DefaultCommandHandler.executeCommand(DefaultCommandHandler.java:83) |
|
||||
| | at com.github.ompc.Arthas.server.GaServer$4.run(GaServer.java:329) |
|
||||
| | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) |
|
||||
| | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) |
|
||||
| | at java.lang.Thread.run(Thread.java:745) |
|
||||
+-----------------+---------------------------------------------------------------------------------------------------------+
|
||||
replay time fragment[1003] success.
|
||||
Affect(row-cnt:1) cost in 3 ms.
|
||||
$
|
||||
```
|
||||
|
||||
F.Y.I
|
||||
1. the calling stack is little different using Arthas now instead of the original method;
|
||||
2. **Loss** of the thread local variables will be a fact since there is no way for Arthas to record the thread local info.
|
||||
3. **Potential** modifications of objects can happen since only a reference will be recorded by Arthas while later process might modify objects without Arthas's watch.
|
@ -0,0 +1,300 @@
|
||||
watch
|
||||
=====
|
||||
|
||||
Monitor the methods in data aspect including `return value`, `exceptions` and `parameters`.
|
||||
|
||||
With the help of [OGNL](https://en.wikipedia.org/wiki/OGNL), you can easily check the details of the variables.
|
||||
|
||||
### Parameters & Options
|
||||
|
||||
There are four different usage scenarios for `watch` command, which makes it the most complicated command in Arthas.
|
||||
|
||||
|Name|Specification|
|
||||
|---:|:---|
|
||||
|*class-pattern*|pattern for the class name|
|
||||
|*method-pattern*|pattern for the method name|
|
||||
|*express*|expression to monitor|
|
||||
|*condition-express*|condition expression|
|
||||
|[b]|before invoking|
|
||||
|[e]|encountering exceptions|
|
||||
|[s]|returned normally|
|
||||
|[f]|returned normally and abnormally|
|
||||
|[E]|turn on regx matching while the default is wildcards matching|
|
||||
|[x:]|the depth to print the specified property with default value: 1|
|
||||
|
||||
F.Y.I
|
||||
1. any valid OGNL expression as `"{params,returnObj}"` supported
|
||||
2. there are four *watching* points: `-b`, `-e`, `-s` and `-f` (the first three are off in default while `-f` on);
|
||||
3. at the *watching* point, Arthas will use the `expression` to calculate the values and print them out;
|
||||
4. `in-parameters` and `out-parameters` are different since they can be modified; `params` stands for `in-parameters` in `-b`while `out-parameters` in other *watching* points;
|
||||
5. there is no `return value` and `exceptions` when using `-b`.
|
||||
|
||||
|
||||
Advanced:
|
||||
* [Critical fields in expression](advice-class.md)
|
||||
* [Special usage](https://github.com/alibaba/arthas/issues/71)
|
||||
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
|
||||
|
||||
### Usage
|
||||
|
||||
A demo:
|
||||
|
||||
```java
|
||||
public void execute() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("a");
|
||||
list.add("b");
|
||||
|
||||
List<String> list2 = new ArrayList<String>();
|
||||
list2.add("c");
|
||||
list2.add("d");
|
||||
|
||||
int len = add(list, list2);
|
||||
}
|
||||
|
||||
private static int add(List<String> list, List<String> list2) {
|
||||
list.addAll(list2);
|
||||
return list.size();
|
||||
}
|
||||
```
|
||||
#### Check the `out-parameters`and `return value`
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 2
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 44 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@ArrayList[isEmpty=false;size=4],
|
||||
@ArrayList[isEmpty=false;size=2],
|
||||
],
|
||||
|
||||
@Integer[4],
|
||||
]
|
||||
```
|
||||
|
||||
#### Check `in-parameters`
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 2 -b
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 48 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@ArrayList[isEmpty=false;size=2],
|
||||
@ArrayList[isEmpty=false;size=2],
|
||||
],
|
||||
|
||||
null,
|
||||
]
|
||||
```
|
||||
|
||||
Compared to the previous *check*:
|
||||
1. size of `params[0]` is `2` instead of `4`;
|
||||
2. `return value` is `null` since it's `-b`.
|
||||
|
||||
|
||||
#### Check *before* and *after* at the same time
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 2 -b -s
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 59 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@ArrayList[isEmpty=false;size=2],
|
||||
@ArrayList[isEmpty=false;size=2],
|
||||
],
|
||||
|
||||
null,
|
||||
]
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@ArrayList[isEmpty=false;size=4],
|
||||
@ArrayList[isEmpty=false;size=2],
|
||||
],
|
||||
|
||||
@Integer[4],
|
||||
]
|
||||
```
|
||||
|
||||
F.Y.I
|
||||
1. the first block of output is the *before watching* point;
|
||||
2. the order of the output determined by the *watching* order itself (nothing to do with the order of the options `-b -s`).
|
||||
|
||||
#### Using `-x` to check more details
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 3
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 59 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@ArrayList[
|
||||
@String[a],
|
||||
|
||||
@String[b],
|
||||
|
||||
@String[c],
|
||||
|
||||
@String[d],
|
||||
],
|
||||
@ArrayList[
|
||||
@String[c],
|
||||
|
||||
@String[d],
|
||||
],
|
||||
],
|
||||
|
||||
@Integer[4],
|
||||
]
|
||||
```
|
||||
|
||||
#### Using condition expressions to locate specific call
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.biz.impl.UserManagerImpl testAdd "{params, returnObj}" "params[0].equals('aaa')" -x 2
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 29 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@String[aaa],
|
||||
@String[bbb],
|
||||
],
|
||||
|
||||
@Integer[6],
|
||||
]
|
||||
```
|
||||
|
||||
#### Check `exceptions`
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.biz.impl.UserManagerImpl testAdd "{params, throwExp}" -e -x 2
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 29 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@String[aaa],
|
||||
@String[bbb],
|
||||
],
|
||||
|
||||
java.lang.NullPointerException
|
||||
at com.alibaba.sample.petstore.biz.impl.UserManagerImpl.testAdd(UserManagerImpl.java:75)
|
||||
at com.alibaba.sample.petstore.biz.impl.UserManagerImpl.register(UserManagerImpl.java:60)
|
||||
at com.alibaba.sample.petstore.web.user.module.action.RegisterAction.doRegister(RegisterAction.java:45)
|
||||
at com.alibaba.sample.petstore.web.user.module.action.RegisterAction$$FastClassByCGLIB$$ad5428f1.invoke(<generated>)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.AbstractModuleEventAdapter.executeAndReturn(AbstractModuleEventAdapter.java:100)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.AbstractModuleEventAdapter.execute(AbstractModuleEventAdapter.java:58)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:63)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.ChooseValve.invoke(ChooseValve.java:98)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.LoopValve.invokeBody(LoopValve.java:105)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.LoopValve.invoke(LoopValve.java:83)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PageAuthorizationValve.invoke(PageAuthorizationValve.java:105)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.CheckCsrfTokenValve.invoke(CheckCsrfTokenValve.java:123)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.AnalyzeURLValve.invoke(AnalyzeURLValve.java:126)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.SetLoggingContextValve.invoke(SetLoggingContextValve.java:66)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PrepareForTurbineValve.invoke(PrepareForTurbineValve.java:52)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.webx.impl.WebxControllerImpl.service(WebxControllerImpl.java:43)
|
||||
at com.alibaba.citrus.webx.impl.WebxRootControllerImpl.handleRequest(WebxRootControllerImpl.java:53)
|
||||
at com.alibaba.citrus.webx.support.AbstractWebxRootController.service(AbstractWebxRootController.java:165)
|
||||
at com.alibaba.citrus.webx.servlet.WebxFrameworkFilter.doFilter(WebxFrameworkFilter.java:152)
|
||||
at com.alibaba.citrus.webx.servlet.FilterBean.doFilter(FilterBean.java:148)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
||||
at com.alibaba.citrus.webx.servlet.SetLoggingContextFilter.doFilter(SetLoggingContextFilter.java:61)
|
||||
at com.alibaba.citrus.webx.servlet.FilterBean.doFilter(FilterBean.java:148)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
||||
at com.taobao.tomcat.valves.ContextLoadFilterValve.invoke(ContextLoadFilterValve.java:152)
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:429)
|
||||
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
|
||||
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1760)
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1719)
|
||||
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
|
||||
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
||||
at java.lang.Thread.run(Thread.java:745),
|
||||
]
|
||||
```
|
||||
|
||||
#### Filter based on time cost
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" #cost>200 -x 3
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 59 ms.
|
||||
@ArrayList[
|
||||
@Object[][
|
||||
@ArrayList[
|
||||
@String[a],
|
||||
|
||||
@String[b],
|
||||
|
||||
@String[c],
|
||||
|
||||
@String[d],
|
||||
],
|
||||
@ArrayList[
|
||||
@String[c],
|
||||
|
||||
@String[d],
|
||||
],
|
||||
],
|
||||
|
||||
@Integer[4],
|
||||
]
|
||||
```
|
||||
|
||||
F.Y.I
|
||||
`#cost>200` (`ms`) filter out all invokings that take less than `200ms`.
|
||||
|
||||
|
||||
#### Check the global properties of the target object
|
||||
|
||||
`target` stands for the current object.
|
||||
|
||||
```
|
||||
$ watch com.taobao.container.web.arthas.rest.MyAppsController myFavoriteApps 'target'
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 128 ms.
|
||||
ts=2017-10-31 18:45:55;result=@MyAppsController[
|
||||
myFavAppsMapper=@$Proxy131[org.apache.ibatis.binding.MapperProxy@563e97f3],
|
||||
getAppNameAndIdByEmpId=@$Proxy135[HardCodedTarget(type=GetAppNameAndIdByEmpId, url=http://hello.com)],
|
||||
enableWebConsoleAppsMapper=@$Proxy132[org.apache.ibatis.binding.MapperProxy@7d51e4a8],
|
||||
]
|
||||
```
|
||||
|
||||
`target.field_name` stands for a global property of the current object.
|
||||
|
||||
```
|
||||
$ watch com.taobao.container.web.arthas.rest.MyAppsController myFavoriteApps 'target.myFavAppsMapper'
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 126 ms.
|
||||
ts=2017-10-31 18:46:17;result=@$Proxy131[
|
||||
m1=@Method[public boolean java.lang.Object.equals(java.lang.Object)],
|
||||
m2=@Method[public java.lang.String java.lang.Object.toString()],
|
||||
m5=@Method[public abstract java.util.List com.taobao.container.dal.arthas.mapper.MyFavAppsMapper.listFavApps(java.util.Map)],
|
||||
m3=@Method[public abstract int com.taobao.container.dal.arthas.mapper.MyFavAppsMapper.delete(java.lang.String,java.lang.String,java.lang.String)],
|
||||
m4=@Method[public abstract long com.taobao.container.dal.arthas.mapper.MyFavAppsMapper.insert(com.taobao.container.dal.arthas.domain.MyFavAppsDO)],
|
||||
m0=@Method[public native int java.lang.Object.hashCode()],
|
||||
]
|
||||
```
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,419 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>stack — Arthas 3.0.5-SNAPSHOT documentation</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/overrides.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="tt" href="tt.html" />
|
||||
<link rel="prev" title="trace" href="trace.html" />
|
||||
<script src="_static/center_page.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search">
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Arthas
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="version">
|
||||
3.0.5-SNAPSHOT
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="install-detail.html">Installation</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="quick-start.html">Quick start</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="advanced-use.html">Advanced usage</a></li>
|
||||
<li class="toctree-l1 current"><a class="reference internal" href="commands.html">Commands</a><ul class="current">
|
||||
<li class="toctree-l2"><a class="reference internal" href="dashboard.html">dashboard</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="thread.html">thread</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="jvm.html">jvm</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sysprop.html">sysprop</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="getstatic.html">getstatic</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sc.html">sc</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sm.html">sm</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="dump.html">dump</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="jad.html">jad</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="classloader.html">classloader</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="redefine.html">redefine</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="monitor.html">monitor</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="watch.html">watch</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="trace.html">trace</a></li>
|
||||
<li class="toctree-l2 current"><a class="current reference internal" href="#">stack</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#parameters">Parameters</a><ul>
|
||||
<li class="toctree-l4"><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/en/advice-class.md">Critical fields in expression</a></li>
|
||||
<li class="toctree-l4"><a class="reference external" href="https://github.com/alibaba/arthas/issues/71">Special usage</a></li>
|
||||
<li class="toctree-l4"><a class="reference external" href="https://commons.apache.org/proper/commons-ognl/language-guide.html">OGNL official guide</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#usage">Usage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="tt.html">tt</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="options.html">options</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="commands.html#arthas-basic-commands">Arthas Basic Commands</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Auser-case">User cases</a></li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/en/release-notes.md">Release Notes</a></li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered">Questions and answers</a></li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas">Fork me at GitHub</a></li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md">CONTRIBUTING</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Arthas</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="index.html">Docs</a> »</li>
|
||||
|
||||
<li><a href="commands.html">Commands List</a> »</li>
|
||||
|
||||
<li>stack</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/alibaba/arthas/blob/master/site/src/site/sphinx/stack.md" class="fa fa-github"> Edit on GitHub</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="stack">
|
||||
<span id="stack"></span><h1>stack<a class="headerlink" href="#stack" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Print out the full call stack trace containing the current method.</p>
|
||||
<p>Most of the time, we know the method being invoked but not always we know <strong>HOW being invoked</strong>; <code class="docutils literal notranslate"><span class="pre">stack</span></code> can be a great help to locate the <em>source</em> for you.</p>
|
||||
<div class="section" id="parameters">
|
||||
<span id="parameters"></span><h2>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h2>
|
||||
<table border="1" class="docutils">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="right">Name</th>
|
||||
<th align="left">Specification</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="right"><em>class-pattern</em></td>
|
||||
<td align="left">pattern for the class name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><em>method-pattern</em></td>
|
||||
<td align="left">pattern for the method name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><em>condition-express</em></td>
|
||||
<td align="left">condition expression</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">[E]</td>
|
||||
<td align="left">turn on regx matching while the default is wildcards matching</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><code>[n:]</code></td>
|
||||
<td align="left">calling times</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><p>F.Y.I</p>
|
||||
<ol class="simple">
|
||||
<li>any valid OGNL expression as <code class="docutils literal notranslate"><span class="pre">"{params,returnObj}"</span></code> supported;</li>
|
||||
<li>filter by time cost as <code class="docutils literal notranslate"><span class="pre">trace</span> <span class="pre">*StringUtils</span> <span class="pre">isBlank</span> <span class="pre">'$cost>100'</span></code>; calling stack with only time cost higher than <code class="docutils literal notranslate"><span class="pre">100ms</span></code> will be printed.</li>
|
||||
</ol>
|
||||
<p>Attention:</p>
|
||||
<ol class="simple">
|
||||
<li><code class="docutils literal notranslate"><span class="pre">$cost</span></code> can be used in <code class="docutils literal notranslate"><span class="pre">watch/stack/trace</span></code>;</li>
|
||||
<li>using <code class="docutils literal notranslate"><span class="pre">#cost</span></code> in Arthas 3.0 instead of <code class="docutils literal notranslate"><span class="pre">$cost</span></code>.</li>
|
||||
</ol>
|
||||
<p>Advanced:</p>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/en/advice-class.md">Critical fields in expression</a></li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues/71">Special usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference external" href="https://commons.apache.org/proper/commons-ognl/language-guide.html">OGNL official guide</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<span id="usage"></span><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The quoting rules: if there are quotes within the expression, use another type of quotes to quote the whole expression.</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ stack com.alibaba.sample.petstore.dal.dao.ProductDao getProductById 'params[0]=="K9-BD-01"'
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 51 ms.
|
||||
thread_name="http-bio-8080-exec-4" thread_id=0x4a;is_daemon=true;priority=5;
|
||||
@com.alibaba.sample.petstore.dal.dao.ibatis.IbatisProductDao.getProductById()
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList.execute(ItemList.java:50)
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList$$FastClassByCGLIB$$40b2f45f.invoke(<generated>:-1)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.DataBindingAdapter.executeAndReturn(DataBindingAdapter.java:41)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.performScreenModule(PerformScreenValve.java:111)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.invoke(PerformScreenValve.java:74)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:73)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
......
|
||||
|
||||
thread_name="http-bio-8080-exec-2" thread_id=0x48;is_daemon=true;priority=5;
|
||||
@com.alibaba.sample.petstore.dal.dao.ibatis.IbatisProductDao.getProductById()
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList.execute(ItemList.java:50)
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList$$FastClassByCGLIB$$40b2f45f.invoke(<generated>:-1)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.DataBindingAdapter.executeAndReturn(DataBindingAdapter.java:41)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.performScreenModule(PerformScreenValve.java:111)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.invoke(PerformScreenValve.java:74)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:73)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.ChooseValve.invoke(ChooseValve.java:98)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
......
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Filtering by time cost:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ stack com.alibaba.sample.petstore.web.store.module.screen.ItemList execute #cost>30
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 123 ms.
|
||||
stack com.alibaba.sample.petstore.web.store.module.screen.ItemList execute #cost>30
|
||||
thread_name=http-nio-8080-exec-10;id=31;is_daemon=true;priority=5;TCCL=com.taobao.pandora.boot.embedded.tomcat.TomcatEmbeddedWebappClassLoader
|
||||
@com.alibaba.sample.petstore.web.store.module.screen.ItemList.execute()
|
||||
at com.alibaba.sample.petstore.web.store.module.screen.ItemList$$FastClassByCGLIB$$40b2f45f.invoke(<generated>:-1)
|
||||
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.MethodInvoker.invoke(MethodInvoker.java:70)
|
||||
at com.alibaba.citrus.service.moduleloader.impl.adapter.DataBindingAdapter.executeAndReturn(DataBindingAdapter.java:41)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.performScreenModule(PerformScreenValve.java:111)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformScreenValve.invoke(PerformScreenValve.java:74)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PerformActionValve.invoke(PerformActionValve.java:73)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.ChooseValve.invoke(ChooseValve.java:98)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.LoopValve.invokeBody(LoopValve.java:105)
|
||||
at com.alibaba.citrus.service.pipeline.impl.valve.LoopValve.invoke(LoopValve.java:83)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PageAuthorizationValve.invoke(PageAuthorizationValve.java:105)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.CheckCsrfTokenValve.invoke(CheckCsrfTokenValve.java:123)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.AnalyzeURLValve.invoke(AnalyzeURLValve.java:126)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.SetLoggingContextValve.invoke(SetLoggingContextValve.java:66)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.turbine.pipeline.valve.PrepareForTurbineValve.invoke(PrepareForTurbineValve.java:52)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invokeNext(PipelineImpl.java:157)
|
||||
at com.alibaba.citrus.service.pipeline.impl.PipelineImpl$PipelineContextImpl.invoke(PipelineImpl.java:210)
|
||||
at com.alibaba.citrus.webx.impl.WebxControllerImpl.service(WebxControllerImpl.java:43)
|
||||
at com.alibaba.citrus.webx.impl.WebxRootControllerImpl.handleRequest(WebxRootControllerImpl.java:53)
|
||||
at com.alibaba.citrus.webx.support.AbstractWebxRootController.service(AbstractWebxRootController.java:165)
|
||||
.........
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="tt.html" class="btn btn-neutral float-right" title="tt" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="trace.html" class="btn btn-neutral" title="trace" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Alibaba Middleware Group, and contributors.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'3.0.5-SNAPSHOT',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
<div class="github-fork-ribbon-wrapper right">
|
||||
<div class="github-fork-ribbon">
|
||||
<a href="https://github.com/alibaba/arthas">Fork me at GitHub</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="_static/add_badges.js"></script>
|
||||
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue