diff --git a/en/README.html b/en/README.html index c6b30c037..7eca1651e 100644 --- a/en/README.html +++ b/en/README.html @@ -92,7 +92,7 @@
  • Advanced usage
  • Commands
  • User cases
  • -
  • Release Notes
  • +
  • Release Notes
  • Questions and answers
  • Fork me at GitHub
  • CONTRIBUTING
  • diff --git a/en/_sources/advanced-use.md.txt b/en/_sources/advanced-use.md.txt index f00ae75e7..31d413bcc 100644 --- a/en/_sources/advanced-use.md.txt +++ b/en/_sources/advanced-use.md.txt @@ -3,40 +3,40 @@ Advanced Usage ## Basic -- help +- help - show help info - cls - clear out the current screen - session - check details of the current session -- [reset](reset.md) - reset all empowered classes +- [reset](reset.md) - reset all injected/enhanced classes - version - print the version of the Arthas attaching to the current target process - quit/exit - exit the current Arthas client without affecting other clients - shutdown - terminate the Arthas server and all clients -## JVM-related +## JVM * [dashboard](dashboard.md) - real-time dashboard for the current system * [thread](thread.md) - thread profile * [jvm](jvm.md) - JVM profile * [sysprop](sysprop.md) - check or modify JVM system properties -* **New!** [getstatic](getstatic.md) - check the static properties of some class +* **New!** [getstatic](getstatic.md) :clap: - check the static properties of classes -## class/classloader - related +## class/classloader -* [sc](sc.md) - methods' profile of the classes loaded by JVM -* [sm](sm.md) - methods' profile of the loaded classes -* [dump](dump.md) - dump out the byte code of the loaded class to specified location -* [redefine](redefine.md) - load external `*.class` files and re-define the JVM +* [sc](sc.md) - check profiles of the classes loaded by JVM +* [sm](sm.md) - check methods' profile +* [dump](dump.md) - dump out the byte code of the loaded classes to specified location +* [redefine](redefine.md) - load external `*.class` files and re-define the JVM-loaded classes * [jad](jad.md) - de-compile the specified loaded classes -* [classloader](classloader.md) - check the inheritance structure, urls, class loading info of class cloader; using classloader to getResource +* [classloader](classloader.md) - check the inheritance structure, urls, class loading info of class cloader; using classloader to get the url of the resource e.g. `java/lang/String.class` ## monitor/watch/trace - related -> **Attention**: commands here are taking advantage of `byte code injection`, which means we are using [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) to monitor and analyze the classes. So when using it for online troubleshooting, you'd better *explicitly specifically* specify the classes and also remember to remove the injected code by `shutdown` or `reset` (for specific classes). +> **Attention**: commands here are taking advantage of `byte code injection`, which means we are using [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) to monitor and analyze the classes. So when using it for online troubleshooting, you'd better *explicitly specifically* specify the classes and also remember to remove the injected code by `shutdown` or `reset`. -* [monitor](monitor.md) -* [watch](watch.md) -* [trace](trace.md) - track the call stack trace and collect the time cost for each method call -* [stack](stack.md) - print the call stack trace of the current method +* [monitor](monitor.md) - monitor the `class-pattern` & `method-pattern` matched methods' invoking traces +* [watch](watch.md) - watch/monitor methods in data aspect including `return values`, `exceptions` and `parameters` +* [trace](trace.md) - track the method calling trace along with the time cost for each call +* [stack](stack.md) - print the call stack trace of the current method in a persistent way * [tt](tt.md) - record the arguments and returned value for the methods, history included ## options @@ -48,13 +48,15 @@ Advanced Usage `pipe` is supported in Arthas, e.g. `sm org.apache.log4j.Logger | grep ` -* grep +Commands supported in `pipe`: + +* grep - filtering * plaintext - remove the color -* wc +* wc - line counting ## async in background -[async](async.md) will be a great help, when the `incident` seldom occurs and you are `[watch](watch.md)`ing it. +[async](async.md) will be a great help, when the `incident` seldom occurs and you are [`watch`](watch.md)ing it. * jobs - list all jobs @@ -63,14 +65,9 @@ Advanced Usage * bg - put the paused job to the background * tips - a) use `>` to redirect the output; b) use `&` to put the job to the background; c) disconnecting the session will not influence the job (the default life is 1 day) -## Web Console - -Using websocket to connect Arthas - -* [Web Console](web-console.md) - ## Others +* [Web Console](web-console.md) - using websocket to connect Arthas * [log the output](save-log.md) * [batch](batch-support.md) * [how to use ognl](https://github.com/alibaba/arthas/issues/11) diff --git a/en/_sources/advice-class.md.txt b/en/_sources/advice-class.md.txt new file mode 100644 index 000000000..479f93055 --- /dev/null +++ b/en/_sources/advice-class.md.txt @@ -0,0 +1,44 @@ +Critical Fields in Expressions +============================== + +There is a very fundamental class `Advice` for the expressions used in filtering, tracing or monitoring and other aspects in commands. + +```java +public class Advice { + + private final ClassLoader loader; + private final Class clazz; + private final ArthasMethod method; + private final Object target; + private final Object[] params; + private final Object returnObj; + private final Throwable throwExp; + private final boolean isBefore; + private final boolean isThrow; + private final boolean isReturn; + ... + // getter/setter +} +``` + +|Name|Specification| +|---:|:---| +|loader|class loader of the class| +|clazz|the reference of the class| +|method|the reflective reference of the method| +|target|the instance of the class| +|params|the parameters of the method, which is an array (when there is no argument in the method, it will be an empty array)| +|returnObj|the return value of the method - only when `isReturn==true`, it's a valid result but if the return value is `void` then it will be a `null`| +|throwExp|the exceptions thrown by the method invoking - only when `isThrow==true`, it's a valid thrown exception| +|isBefore|assistant checking flag used in [`before-watching` point](watch.md) and at this very moment: `isBefore==true`, `isThrow==false` and `isReturn==false` since it's before we invoke the method| +|isThrow|assistant checking flag: whether the current method invoking ends with exceptions| +|isReturn|assistant checking flag: whether the method invoking exits normally without exceptions| + +F.Y.I +1. all the *fields* mentioned in the table above can be used directly in the `expressions`; +2. if the expressions are [invalid OGNL](https://en.wikipedia.org/wiki/OGNL), the command will be cancelled automatically with hints to correct the expressions; +3. [typical use cases](https://github.com/alibaba/arthas/issues/71); +4. [OGNL official usage guide](https://commons.apache.org/proper/commons-ognl/language-guide.html). + + + diff --git a/en/_sources/batch-support.md.txt b/en/_sources/batch-support.md.txt new file mode 100644 index 000000000..1095985b1 --- /dev/null +++ b/en/_sources/batch-support.md.txt @@ -0,0 +1,39 @@ +Batch Processing +================ + +With the help of `Batch Processing`, you can run several commands in one line and get the results. + +### Usage + +#### Step-1: Create the script + +Creating a `test.as` script suffixed with `as` here for consistency (actually any suffix is acceptable). + +``` +➜ arthas git:(develop) cat /var/tmp/test.as +help +dashboard -b -n 1 +session +thread +sc -d org.apache.commons.lang.StringUtils +``` + +Attention: +* each command takes each independent line; +* `dashboard` command should include `-b` to turn on batch mode and `-n` to ensure the script ends; +* commands as `watch/tt/trace/monitor/stack` should include `-n` option to ensure the script ends; +* [asynchronous](async.md) can also be used as `watch c.t.X test returnObj > &`; + +#### Step-2: Run the script + +Using `-b` to turn on script mode, and `-f` to run it and you can also *redirect* the output as: + +```sh +./as.sh -b -f /var/tmp/test.as 56328 > test.out +``` + +#### Step-3: Check the outputs + +```sh +cat test.out +``` diff --git a/en/_sources/classloader.md.txt b/en/_sources/classloader.md.txt index bfa14936a..913f9d4de 100644 --- a/en/_sources/classloader.md.txt +++ b/en/_sources/classloader.md.txt @@ -9,17 +9,17 @@ It can be a great help for `ResourceNotFoundException` when you can use command |Name|Specification| |---:|:---| -|[l]|count based on the class loader instance| -|[t]|print all the inheritance structure of the class loaders| +|[l]|list all class loader instances based on thread count| +|[t]|print the inheritance structure of the class loaders| |[a]|list all the classes loaded by all the class loaders (use it with great caution since the output can be huge)| -|`[c:]`|get the hashcode of the class loader| -|`[c: r:]`|using class loader to search resource| +|[c:]|get the hashcode of the class loader| +|[c: r:]|using class loader to search resource| ### Usage -* categorised by class loader +* Categorised by class loader -```s +```sh $ classloader name numberOfInstances loadedCountTotal com.taobao.pandora.service.loader.ModuleClassLoader 29 11659 @@ -100,7 +100,7 @@ $ classloader -t | | +-sun.reflect.DelegatingClassLoader@73f44f24 ``` -* Check the real urls of `URLClassLoader` +* Check URL of the class loader ```shell $ classloader -c 5ffe9775 diff --git a/en/_sources/commands.md.txt b/en/_sources/commands.md.txt index f103f7b14..d5c1e664d 100644 --- a/en/_sources/commands.md.txt +++ b/en/_sources/commands.md.txt @@ -1,6 +1,19 @@ -Commands List +All Commands ============= +### Basic + +* help - check the assistant info for the command +* cls - clear out the current screen area +* session - check the current session profile +* [reset](reset.md) - clear the injected code from the classes (B.T.W when Arthas server closed, all the injected will also be cleared) +* version - the version of the working Arthas +* quit - exit the current Arthas client without affecting other clients +* shutdown - terminate the Arthas server and all clients +* [keymap](keymap.md) - shortcuts for Arthas and also you can define your own + + +### Advanced * [dashboard](dashboard.md) * [thread](thread.md) * [jvm](jvm.md) @@ -25,13 +38,3 @@ Commands List * [options](options.md) -### Arthas Basic Commands - -* help - check the assistant info for the command -* cls - clear out the current screen area -* session - check the current session profile -* [reset](reset.md) - clear the injected code from the classes (B.T.W when Arthas server closed, all the injected will also be cleared) -* version - the version of the working Arthas -* quit - exit the current Arthas client without affecting other clients -* shutdown - terminate the Arthas server and all clients -* [keymap](keymap.md) - shortcuts for Arthas and also you can define your own diff --git a/en/_sources/dump.md.txt b/en/_sources/dump.md.txt index ac3089c59..c0e157f23 100644 --- a/en/_sources/dump.md.txt +++ b/en/_sources/dump.md.txt @@ -8,13 +8,13 @@ Dump the bytecode the loaded classes to a specified directory. |Name|Specification| |---:|:---| |*class-pattern*|pattern for the class name| -|`[c:]`|hashcode of the class loader that loaded the class| -|[E]|turn on regx matching while the default is wildcards matching| +|[c:]|hashcode of the [class loader](classloader.md) that loaded the class| +|[E]|turn on regex matching while the default is wildcard matching| ### Usage -```shell -$ dump -E org\.apache\.commons\.lang\.StringUtils +```bash +$ dump org.apache.commons.lang.StringUtils HASHCODE CLASSLOADER LOCATION 29505d69 +-tddl-client's ModuleClassLoader /Users/zhuyong/middleware/taobao-tomcat/output/build/bin/classdump/com.taobao.pandora .service.loader.ModuleClassLoader-29505d69/org.apache.commons.lang.StringUtils.class diff --git a/en/_sources/index.md.txt b/en/_sources/index.md.txt index 173020577..b604a9131 100644 --- a/en/_sources/index.md.txt +++ b/en/_sources/index.md.txt @@ -36,7 +36,7 @@ Arthas is born to solve these issues. You can trouble-shoot your production issu Contents -------- -English version is on the way, if you would like to contribute, please leave a message [here](https://github.com/alibaba/arthas/issues/51) +English version has just been finished. If you would like to make it better, please check [here](https://github.com/alibaba/arthas/issues/51) and submit your PM. * [Installation](install-detail.md) * [Quick start](quick-start.md) diff --git a/en/_sources/jad.md.txt b/en/_sources/jad.md.txt index 31c146015..6aa6fc6af 100644 --- a/en/_sources/jad.md.txt +++ b/en/_sources/jad.md.txt @@ -6,22 +6,22 @@ De-compile specified loaded classes. `jad` helps to *de-compile* the byte code in JVM to the source code to assist you to better understand the logic behind. F.Y.I -* the de-compiled code will be grammatically highlighted for readability in Arthas Console; -* you have to understand there might be some trivial grammar errors but it won't affect the logic understanding. +* the de-compiled code will be grammatically highlighted for readability in Arthas console; +* there might be some trivial grammar errors but it won't affect the logic understanding. ### Options |Name|Specification| |---:|:---| |*class-pattern*|pattern for the class name| -|`[c:]`|hashcode of the class loader that loaded the class| -|[E]|turn on regx matching while the default is wildcards matching| +|[c:]|hashcode of the class loader that loaded the class| +|[E]|turn on regex matching while the default is wildcard matching| ### Usage When several class loaders loaded the same class: 1. `jad` to get the hashcode of the class loader; -2. `jad -c ` to get the de-compiled class loaded by the class loader. +2. `jad -c ` to get the de-compiled class loaded by the specified class loader. ```java $ jad org.apache.log4j.Logger @@ -156,3 +156,7 @@ private Map directMetrics(String ip, String[] metrics) { Affect(row-cnt:1) cost in 1508 ms. ``` + +F.Y.I + +Inner class is not yet supported, you can just check the *outer* class to further check the inner class. diff --git a/en/_sources/jvm.md.txt b/en/_sources/jvm.md.txt index 25fe20325..b787281b7 100644 --- a/en/_sources/jvm.md.txt +++ b/en/_sources/jvm.md.txt @@ -84,8 +84,14 @@ $ jvm THREAD COUNT 16 DAEMON-COUNT 10 - LIVE-COUNT 18 + PEAK-COUNT 18 STARTED-COUNT 19 + DEADLOCK-COUNT 0 + + FILE-DESCRIPTOR + + MAX-FILE-DESCRIPTOR-COUNT 10240 + OPEN-FILE-DESCRIPTOR-COUNT 648 Affect cost in 2 ms. ``` @@ -93,5 +99,12 @@ Affect cost in 2 ms. * COUNT: the count of active threads * DAEMON-COUNT: the count of active daemon threads -* LIVE-COUNT: the maximum count of the live threads since JVM starts +* PEAK-COUNT: the maximum count of the live threads since JVM starts * STARTED-COUNT: the total count of the created threads since JVM starts +* DEADLOCK-COUNT: the count of deadlock threads + + +### fileDescriptor-related + +* MAX-FILE-DESCRIPTOR-COUNT:the count of max file descriptor JVM process can open +* OPEN-FILE-DESCRIPTOR-COUNT:the current count of file descriptor JVM process open \ No newline at end of file diff --git a/en/_sources/manual-install.md.txt b/en/_sources/manual-install.md.txt new file mode 100644 index 000000000..a755d4ef1 --- /dev/null +++ b/en/_sources/manual-install.md.txt @@ -0,0 +1,31 @@ +Manual Installation +=================== + +### Download + +Latest `bin.zip `: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://search.maven.org/classic/#search%7Cga%7C1%7Cg%3A%22com.taobao.arthas%22%20AND%20a%3A%22arthas-packaging%22) + + +If the downloading is rather clumsy, try to download from the [repository in AliYun](https://maven.aliyun.com/); the downloading URL template is (remember to fill up the version `3.x.x` template to your needs) + +`https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/3.x.x/arthas-packaging-3.x.x-bin.zip` +### Unzip + +```bash +unzip arthas-packaging-bin.zip +``` + +### Install + +```bash +sudo su admin +rm -rf /home/admin/.arthas/lib/* # remove all the leftover of the old outdated Arthas +cd arthas +./install-local.sh # switch the user based on the owner of the target Java process. +``` + +### Start + +```bash +./as.sh # make sure the old Arthas has been shut down (using command shutdown); +``` diff --git a/en/_sources/monitor.md.txt b/en/_sources/monitor.md.txt index 37dbc1551..d77b4b64f 100644 --- a/en/_sources/monitor.md.txt +++ b/en/_sources/monitor.md.txt @@ -1,14 +1,14 @@ monitor ======= -Monitor the `class-pattern` & `method-pattern` matched methods invoking traces. +Monitor methods calling stack traces. F.Y.I -1. `monitor` is a persistent command, it never returns until `Ctrl+C` to manually stop it. -2. the server runs the tasks in the background; -3. injected code will become invalid automatically once the tasks being terminated; -4. in theory, Arthas commands will not change any original behaviors. +1. `monitor` is a persistent command, it never returns until you press `Ctrl+C` to manually stop it; +2. the server runs the jobs in the background; +3. injected monitoring code will become invalid automatically once the monitoring jobs being terminated; +4. in theory, Arthas will not change any original behaviors but if it does, please do not hesitate to start an [issue](https://github.com/alibaba/arthas/issues). ### Properties monitored @@ -29,8 +29,8 @@ F.Y.I |---:|:---| |*class-pattern*|pattern for the class name| |*method-pattern*|pattern for the method name| -|[E]|turn on regx matching while the default is wildcards matching| -|`[c:]`|cycle of output with default value: `120 s`| +|[E]|turn on regex matching while the default is wildcard matching| +|[c:]|cycle of output with default value: `60 s`| ### Usage diff --git a/en/_sources/options.md.txt b/en/_sources/options.md.txt index e22472d48..51bd2efb2 100644 --- a/en/_sources/options.md.txt +++ b/en/_sources/options.md.txt @@ -1,22 +1,22 @@ options === -> Global options +### Global options -| Name | Default Value | Description | -| ------------------ | ----- | ---------------------------------------- | -| unsafe | false | Enable support for system-level class enhancement; JVM might crash, if you turn on this switch (please use with great caution!) | -| dump | false | Enable support for dumping enhanced class to external file,if turned on,class file will be dumped to`/${application dir}/arthas-class-dump/`,please see console for specific location | +|Name| Default Value | Description | +| ------------------------- | ----- | ---------------------------------------- | +| unsafe | false | Enable system-level class enhancement; JVM might crash, if you turn it on (use with great caution :exclamation:) | +| dump | false | Enable support for dumping enhanced class to external files; if turned on, class file will be dumped to`/${application dir}/arthas-class-dump/`,please check console output for specific location | | batch-re-transform | true | re-transform matched classes in batch | | json-format | false | Enable output in JSON format | -| disable-sub-class | false | Disabling child class matching,by default child class will be matched during matching target class,if you wish exact matching,you can turn this off | -| debug-for-asm | false | Print ASM related debug message | -| save-result | false | Enable saving logs for task results,when turn to true, all command results will be saved to `/home/admin/logs/arthas/arthas.log` | -| job-timeout | 1d | Default time-out time for back-stage tasks,if exceed this time,task will be stopped;i.e. 1d, 2h, 3m, 25s,representing day、hour、minute、second | +| disable-sub-class | false | Disabling child class matching: by default child class will be matched while matching target class; if you wish exact matching, you should turn it off | +| debug-for-asm | false | Print ASM-related debug message | +| save-result | false | Enable saving logs for task results: when true, all command results will be saved to `/home/admin/logs/arthas/arthas.log` | +| job-timeout | 1d | Default timeout for background jobs: jobs will be stopped once timed out (i.e. 1d, 2h, 3m, 25s)| ### Usage -For example,if you wish to save logs for command results, you can use following command: +Saving logs for command outputs, you can: ``` $ options save-result true diff --git a/en/_sources/quick-start.md.txt b/en/_sources/quick-start.md.txt index 6c75ac463..19fa32248 100644 --- a/en/_sources/quick-start.md.txt +++ b/en/_sources/quick-start.md.txt @@ -56,8 +56,7 @@ public class Demo { sudo -u admin -EH ./as.sh ``` -2. For more details of the booting script, please refer to [starting arthas](start-arthas.md). - +2. For more details of the booting script, please refer to [Start Arthas](start-arthas.md). 3. If you cannot *attach* the target process, please check the logs under `~/logs/arthas` for troubleshooting. 4. Selecting the target process as: @@ -90,8 +89,8 @@ public class Demo { version: 3.0.1-RC-SNAPSHOT pid: 13560 timestamp: 1536656867894 - '`'`'`'`'`'`'`'`'` - ' + + $ ``` ### Windows @@ -152,7 +151,7 @@ ts=2018-09-10 17:53:14;result=@Integer[624] ts=2018-09-10 17:53:15;result=@Integer[625] ``` -[more advanced functions](advanced-use.md) +[more advanced usages](advanced-use.md) ## 5. Exit Arthas diff --git a/en/_sources/redefine.md.txt b/en/_sources/redefine.md.txt index 4ce2af248..fdb2c6a85 100644 --- a/en/_sources/redefine.md.txt +++ b/en/_sources/redefine.md.txt @@ -1,14 +1,14 @@ redefine ======== -Load the external `*.class` files and *re-define* the JVM-loaded classes. +Load the external `*.class` files to **re-define** the JVM-loaded classes. Reference: [Instrumentation#redefineClasses](https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/Instrumentation.html#redefineClasses-java.lang.instrument.ClassDefinition...-) F.Y.I 1. Re-defined classes cannot be restores any more; -2. Re-definition can fail (like adding a new field); for more information, please refer to JDK documentation +2. Re-definition can fail (like adding a new field/method); for more information, please refer to JDK documentation ### Options @@ -21,6 +21,6 @@ F.Y.I ### Usage ``` - redefine -p /tmp/Test.class - redefine -c 327a647b -p /tmp/Test.class /tmp/Test\$Inner.class +redefine -p /tmp/Test.class +redefine -c 327a647b -p /tmp/Test.class /tmp/Test$Inner.class ``` diff --git a/en/_sources/release-notes.md.txt b/en/_sources/release-notes.md.txt new file mode 100644 index 000000000..fffdecd9d --- /dev/null +++ b/en/_sources/release-notes.md.txt @@ -0,0 +1,123 @@ +Release Notes +============= + +### :tada: :tada: [v3.0.4](https://github.com/alibaba/arthas/milestone/1?closed=1) :exclamation: + +v2017-11-03 +---- + +* [improvement] add [`getstatic`](getstatic.md) +* [bug] fix Arthas class loader logs loading issues +* [improvement] introduce [OGNL](https://en.wikipedia.org/wiki/OGNL) to customize `classloader` to invoke static methods +* [improvement] optimise `termd` uppercase output performance +* [improvement] `classloader` compile in class loader category by default +* [bug] fix `wc` counting issue +* [improvement] disable certain JDK classes e.g. `Classloader`, `Method`, `Integer` and the lik +* [improvement] quit directly when encountering incorrect [OGNL](https://en.wikipedia.org/wiki/OGNL) expression +* [bug] fix `pipe` issues +* [improvement] optimize command re-direct features using asynchronous log +* [improvement] [`trace`](trace.md) can filter JDK method calls + +v2017-09-22 +---- + +* [improvement] improve the error message when starting agent and server fails +* [bug] fix some asynchronous issues + +v2017-09-11 +---- + +* [improvement] [`async`](async.md) supported +* [improvement] optimize [`jad`](jad.md) support JDK 8 and inner class +* [bug] fix Chinese encoding issues + +v2017-05-11 +---- + +* [improvement] [`tt`](tt.md) investigating/recording level one to avoid too much performance overhea +* [bug] fix Chinese characters can not be presented issue + +v2017-05-12 +---- + +* Arthas 3.0 release :confetti_ball: + +v2016-12-09 +---- + +* [feature] [`as.sh`](https://github.com/alibaba/arthas/blob/master/bin/as.sh) support `-h` to print help info +* [bug] [#121] fix leftover temp files causing Arthas cannot start issue +* [bug] [#123] fix `attach/shutdown` repeatedly causing Arthas classloader leakage issue +* [improvement] make the help info more readable +* [bug] [#126] fix the documents links issues +* [bug] [#122] fix the [`classloader`](classloader.md) filtering out `sun.reflect.DelegatingClassLoader` issue +* [bug] [#129] fix [`classloader`](classloader.md) presenting structure issues +* [improvement] [#125] make the Arthas log output more readable +* [improvement] [#96] [`sc`](sc.md) and more commands are supporting format as `com/taobao/xxx/TestClass` +* [bug] [#124] fix the negative values of [`trace`](trace.md) +* [improvement] [#128] the output of [`tt`](tt.md) will auto-expand now +* [bug] [#130] providing more meaningful error messages when port conflicts +* [bug] [#98] fix Arthas starting issue: when updating/downloading failed, Arthas will fail to start +* [bug] [#139] fix agent attaching fails under some scenarios issues +* [improvement] [#156] delay `jd-core-java` initialization to avoid Arthas starting failure +* [bug] avoid thread names duplicate issue +* [improvement] [#150] filtering by total time cost in [`trace`](trace.md) +* [bug] fix [`sc`](sc.md) `NPE` issue when searching `SystemClassloader` +* [bug] [#180] fix attach fails issues: attaching succeed at the first time, delete the Arthas installer, re-compile and package => attaching fails + + +v2016-06-07 +---- + +* [bug] fix NPE when loading `spy` as resource +* [improvement] locating the blocking thread +* [improvement] print out thread in name order +* [improvement] specify the refreshing interval when checking topN busiest threads + +v2016-04-08 +---- + +* [feature] specify refreshing interval and execution times in [`dashboard`](dashboard.md) +* [feature] log the command execution result +* [feature] speed up the booting and attaching while the first attaching is even quicker by 100% than before +* [feature] batch supported; script supported +* [feature] interactive mode used in Arthas +* [feature] inheritance relation included in class searching; global option `disable-sub-class` can be used to turn it off +* [feature] colorful and plain text modes both supported +* [improvement] merge `exit` and `quit` commands +* [improvement] help info enclosed with wiki links +* [improvement] optimize [`watch`](watch.md) using flow for better UX +* [improvement] add examples to [`thread`](thread.md) +* [improvement] auto-completion ignores character case +* [improvement] make the UI more beautiful/friendly +* [bug] fix [`trace`](trace.md) printing too much encountering loop issues +* [bug] fix [`trace`](trace.md) node twisting issues when method throwing exceptions +* [bug] fix injected/enhanced `BootstrapClassLoader` cannot locate `spy` issues + +v2016-03-07 +---- + +* [feature] checking the topN thread and related stack traces +* [bug] fix Arthas starting failure in OpenJdk issues (requiring to reinstall [as.sh](https://github.com/alibaba/arthas/blob/master/bin/as.sh)) +* [improvement] optimize UX + + +v2016-01-18 +---- + +* [improvement] optimise [`jad`](jad.md); dump memory byte array in real time; using `jd-core-java` to de-compile; line number presented; +* [bug] fix checking/re-producing issues when [`tt`](tt.md) is watching thread-context related methods invoking + +v2016-01-08 +---- + +* [bug] jad NPE +* [bug] watch/monitor NPE +* [bug] wrong escaping issues +* [bug] wrong statistics +* [bug] [`sc`](sc.md) checking internal structure issues + +v2015-12-29 +--- + +* Arthas 2.0 Beta :boom:! diff --git a/en/_sources/save-log.md.txt b/en/_sources/save-log.md.txt new file mode 100644 index 000000000..cb4ba4c25 --- /dev/null +++ b/en/_sources/save-log.md.txt @@ -0,0 +1,37 @@ +Log command outputs +=================== + +Log command outputs for later analysis, turned off by default. + +To turn it on, using [options](options.md) as: + +```sh +$ options save-result true + NAME BEFORE-VALUE AFTER-VALUE +---------------------------------------- + save-result false true +Affect(row-cnt:1) cost in 3 ms. +``` + +F.Y.I + +1. logging file lies in: `{user.home}/logs/arthas-cache/result.log`; +2. remember to clean up the file to save disk space. + +### Asynchronous log + + :notes: :notes: +With the latest Arthas, you can log the outputs asynchronously in the background: + +```sh +$ trace Test t >> & +job id : 2 +cache location : /Users/zhuyong/logs/arthas-cache/28198/2 +``` + +F.Y.I + +1. `quit/exit` or `Ctrl+C` will not affect the asynchronous jobs :sparkles:; +2. default timeout for the background job is 1 day (you can set it via [options](options.md)); +3. outputs will be save to the `cache location` now (no matter what `save-result` is - not `~/logs/arthas-cache/result.log` any more). + diff --git a/en/_sources/sc.md.txt b/en/_sources/sc.md.txt index 23eb6af1d..6aaabebdc 100644 --- a/en/_sources/sc.md.txt +++ b/en/_sources/sc.md.txt @@ -3,7 +3,7 @@ sc Check the profiles of the loaded classes. -Abbreviated from “Search-Class”; with the help of this command, you can search out all the loaded classes in JVM. Supported options are: `[d]`、`[E]`、`[f]` and `[x:]`. +Abbreviated from *Search-Class*; with the help of this command, you can search out all the loaded classes in JVM. Supported options are: `[d]`、`[E]`、`[f]` and `[x:]`. Options ------- @@ -16,12 +16,12 @@ Options |*method-pattern*|pattern for the method name| |[d]|print the details of the current class including the source file, class declaration, the class loaders and the like.
    F.Y.I if a class is loaded by several class loaders, then the class will be printed several times| |[E]|turn on regx matching while the default is wildcards matching| -|[f]|print the fields info of the current class, which should be used along with `-d`| +|[f]|print the fields info of the current class, which ***must*** be used with `-d`| |[x:]|the depth to print the static fields, whose default is `0` - directly invoke the `toString()`| Tip: 1. *class-patten* supports full qualified class name (e.g. com.taobao.test.AAA and com/taobao/test/AAA) -2. `sc` turned on the `sub-class` matching in default mode, if you do want to hide the `sub-class` please just turn it off via `options disable-sub-class true`. +2. `sc` turned on the `sub-class` matching in default mode; if you do want to hide `sub-class`, you can just turn it off with [options](options.md) as `options disable-sub-class true`. ### Usage diff --git a/en/_sources/sm.md.txt b/en/_sources/sm.md.txt index 3f0496cee..062a32018 100644 --- a/en/_sources/sm.md.txt +++ b/en/_sources/sm.md.txt @@ -3,7 +3,7 @@ sm Check the method profile of the loaded classes; -Abbreviated from “Search-Method”, with which you can search out all methods profiles of the loaded classes. +Abbreviated from *Search-Method*, with which you can check all methods profiles of the loaded classes. F.Y.I `sm` only shows the methods declared in the current class; methods declared in ancestors will not be presented. @@ -15,7 +15,7 @@ F.Y.I |*class-pattern*|pattern for class name| |*method-pattern*|pattern for method name| |[d]|print the details of the method| -|[E]|turn the regex matching on while the default mode is wildcards matching| +|[E]|turn on regex matching while the default mode is wildcard matching| ### Usage diff --git a/en/_sources/stack.md.txt b/en/_sources/stack.md.txt index bfc5243a2..6b373341d 100644 --- a/en/_sources/stack.md.txt +++ b/en/_sources/stack.md.txt @@ -11,16 +11,16 @@ Most of the time, we know the method being invoked but not always we know **HOW |---:|:---| |*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| +|*condition-expression*|condition expression| +|[E]|turn on regex matching while the default is wildcard 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. +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`; +1. `#cost` can be used in `watch/stack/trace`; 2. using `#cost` in Arthas 3.0 instead of `$cost`. @@ -32,7 +32,7 @@ Advanced: ### Usage -The quoting rules: if there are quotes within the expression, use another type of quotes to quote the whole expression. +The quoting rules: if there are quotes within the expression, use another type of quotes to quote the whole expression (single `''` or double `""` quotes). ``` $ stack com.alibaba.sample.petstore.dal.dao.ProductDao getProductById 'params[0]=="K9-BD-01"' @@ -68,7 +68,7 @@ thread_name="http-bio-8080-exec-2" thread_id=0x48;is_daemon=true;priority=5; 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: @@ -110,5 +110,5 @@ thread_name=http-nio-8080-exec-10;id=31;is_daemon=true;priority=5;TCCL=com.taoba 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) -......... +... ``` diff --git a/en/_sources/trace.md.txt b/en/_sources/trace.md.txt index cb25cd2f6..6f94628f7 100644 --- a/en/_sources/trace.md.txt +++ b/en/_sources/trace.md.txt @@ -1,7 +1,7 @@ trace ===== -Track the `class-pattern` & `method-pattern` matched method calling trace and print the time cost in each call. +Track methods calling stack trace and print the time cost in each call. ### Parameters @@ -11,19 +11,18 @@ Track the `class-pattern` & `method-pattern` matched method calling trace and pr |*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| -|`#cost`|time cost| +|[n:]|calling times| +|#cost|time cost| 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. +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`; +1. `#cost` can be used in `watch/stack/trace`; 2. using `#cost` in Arthas 3.0 instead of `$cost`. 3. `trace` can help to locate the performance lurking issue but only `level-one` method invoking considered. - Advanced: * [Critical fields in expression](advice-class.md) * [Special usage](https://github.com/alibaba/arthas/issues/71) @@ -101,8 +100,8 @@ trace com.alibaba.sample.petstore.web.store.module.screen.ItemList execute #cost Only the calling trace of the time cost higher than `4ms`presented now. F.Y.I -1. just like JProfile and the like commercial software, you can `trace` down the specified method calling in Arthas; +1. like JProfile and other similar commercial software, you can `trace` down the specified method calling stack with time cost in Arthas; 2. there will be some overhead using `trace` but not much; -3. the time cost is an instructive clue for troubleshooting, which means it's not that accurate ignoring the cost it itself causes; the deeper or more the call is, the accuracy is becoming worse; +3. the time cost is an instructive clue for troubleshooting, which means it's not that accurate ignoring the cost it itself causes; the deeper or more the call is, the worse accuracy the time cost will be; 4. `[0,0,0ms,11]xxx:yyy() [throws Exception]`,the same method calling aggregated into one line here while `throws Exception` indicates there is an exception. diff --git a/en/_sources/tt.md.txt b/en/_sources/tt.md.txt index f1cca71f8..b0a134d73 100644 --- a/en/_sources/tt.md.txt +++ b/en/_sources/tt.md.txt @@ -1,13 +1,13 @@ tt == -Check the parameters, return values and exceptions of the methods at different times. +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. +With the help of `tt` (*TimeTunnel*), you can check the contexts of the methods at different times in execution history. ### Usage @@ -37,7 +37,7 @@ Let's record the whole calling contexts: - `-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) + 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 specified limit) #### Property @@ -46,8 +46,8 @@ Let's record the whole calling contexts: |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| +|IS-RET|whether method exits with normal return| +|IS-EXP|whether method failed with exceptions| |OBJECT|`hashCode()` of the object invoking the method| |CLASS|class name of the object invoking the method| |METHOD|method being invoked| @@ -55,7 +55,7 @@ Let's record the whole calling contexts: #### Condition expression Tips: -1. `tt -t *Test print params[0].length==1` with different amount of parameters; +1. `tt -t *Test print params[0].length==1` with different amounts 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. @@ -67,7 +67,7 @@ Advanced: ### Searching for records -#### A specified time range +#### All the recorded ``` $ tt -l @@ -147,7 +147,7 @@ $ ### 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`. +Since Arthas stores the context of the call, you can even *replay* the method calling afterwards with extra option `-p` to re-produce the issue for advanced troubleshooting. ``` $ tt -i 1003 -p @@ -189,6 +189,6 @@ $ ``` 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. +1. the calling stack is little different using Arthas now unlike the original; +2. **Loss** of the thread local variables will be a undeniable fact since there is no way for Arthas to record the thread local info (*If you find one, please share with us in [issues tracker](https://github.com/alibaba/arthas/issues)*). +3. **Potential** modifications of objects can happen since only a reference will be recorded while later operations might modify objects without Arthas's watch. diff --git a/en/_sources/watch.md.txt b/en/_sources/watch.md.txt index c6bc990f5..97150a34c 100644 --- a/en/_sources/watch.md.txt +++ b/en/_sources/watch.md.txt @@ -1,38 +1,38 @@ watch ===== -Monitor the methods in data aspect including `return value`, `exceptions` and `parameters`. +Monitor methods in data aspect including `return values`, `exceptions` and `parameters`. -With the help of [OGNL](https://en.wikipedia.org/wiki/OGNL), you can easily check the details of the variables. +With the help of [OGNL](https://en.wikipedia.org/wiki/OGNL), you can easily check the details of variables when methods being invoked. ### Parameters & Options -There are four different usage scenarios for `watch` command, which makes it the most complicated command in Arthas. +There are four different scenarios for `watch` command, which makes it rather complicated. |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| +|*expression*|expression to monitor| +|*condition-expression*|condition expression to filter| +|[b]|before method being invoked| +|[e]|when method encountering exceptions| +|[s]|when method exits normally| +|[f]|when method exits (either succeed or fail with exceptions)| +|[E]|turn on regex matching while the default is wildcard 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`. +3. at the *watching* point, Arthas will use the *expression* to evaluate the variables and print them out; +4. `in parameters` and `out parameters` are different since they can be modified within the invoked methods; `params` stands for `in parameters` in `-b`while `out parameters` in other *watching* points; +5. there are no `return values` and `exceptions` when using `-b`. Advanced: -* [Critical fields in expression](advice-class.md) -* [Special usage](https://github.com/alibaba/arthas/issues/71) +* [Critical fields in *expression*](advice-class.md) +* [Special usages](https://github.com/alibaba/arthas/issues/71) * [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html) ### Usage @@ -57,7 +57,7 @@ A demo: return list.size(); } ``` -#### Check the `out-parameters`and `return value` +#### Check the `out parameters` and `return value` ```shell $ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 2 @@ -73,7 +73,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 44 ms. ] ``` -#### Check `in-parameters` +#### Check `in parameters` ```shell $ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 2 -b @@ -89,7 +89,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 48 ms. ] ``` -Compared to the previous *check*: +Compared to the previous *check*, there are two differences: 1. size of `params[0]` is `2` instead of `4`; 2. `return value` is `null` since it's `-b`. @@ -122,7 +122,7 @@ 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 +#### Use `-x` to check more details ```shell $ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 3 @@ -150,7 +150,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 59 ms. ] ``` -#### Using condition expressions to locate specific call +#### Use condition expressions to locate specific call ```shell $ watch com.alibaba.sample.petstore.biz.impl.UserManagerImpl testAdd "{params, returnObj}" "params[0].equals('aaa')" -x 2 diff --git a/en/advanced-use.html b/en/advanced-use.html index e715161c6..6bc4075d0 100644 --- a/en/advanced-use.html +++ b/en/advanced-use.html @@ -31,7 +31,7 @@ - + @@ -93,27 +93,18 @@
  • Quick start
  • Advanced usage
  • Commands
  • User cases
  • -
  • Release Notes
  • +
  • Release Notes
  • Questions and answers
  • Fork me at GitHub
  • CONTRIBUTING
  • @@ -188,45 +179,45 @@

    Basic

      -
    • help
    • +
    • help - show help info
    • cls - clear out the current screen
    • session - check details of the current session
    • -
    • reset - reset all empowered classes
    • +
    • reset - reset all injected/enhanced classes
    • version - print the version of the Arthas attaching to the current target process
    • quit/exit - exit the current Arthas client without affecting other clients
    • shutdown - terminate the Arthas server and all clients
    -