From 7414b8e0ec81d7835da9b42d74fa6ed30e17c846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=90=89?= <983433479@qq.com> Date: Fri, 17 Apr 2020 11:23:10 +0800 Subject: [PATCH 01/13] update doc (#1117) --- site/src/site/sphinx/async.md | 3 ++- site/src/site/sphinx/en/async.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/site/src/site/sphinx/async.md b/site/src/site/sphinx/async.md index aaa0a3267..e5e86c4be 100644 --- a/site/src/site/sphinx/async.md +++ b/site/src/site/sphinx/async.md @@ -62,4 +62,5 @@ cache location : /Users/gehui/logs/arthas-cache/28198/2 ## 7. 其他 * 最多同时支持8个命令使用重定向将结果写日志 -* 请勿同时开启过多的后台异步命令,以免对目标JVM性能造成影响 \ No newline at end of file +* 请勿同时开启过多的后台异步命令,以免对目标JVM性能造成影响 +* 如果不想停止arthas,继续执行后台任务,可以执行 `quit` 退出arthas控制台(`stop` 会停止arthas 服务) diff --git a/site/src/site/sphinx/en/async.md b/site/src/site/sphinx/en/async.md index bfb3341a2..c95850b08 100644 --- a/site/src/site/sphinx/en/async.md +++ b/site/src/site/sphinx/en/async.md @@ -78,3 +78,4 @@ If you want to stop background job, just `kill `. * Support up to 8 commands at the same time to redirect the output to the log files. * Do not open too many background jobs at the same time to avoid negative performance effect to the target JVM. +* If you do not want to stop the Arthas service and continue to perform background tasks, you can exit the Arthas console by executing `quit` command (`stop` command will stop the Arthas service) From 9209ebd3c92832500a6ba5e32a286d240f1e7ae7 Mon Sep 17 00:00:00 2001 From: penguin-wwy <940375606@qq.com> Date: Mon, 20 Apr 2020 15:42:33 +0800 Subject: [PATCH 02/13] exit redunant loop (#1123) --- core/src/main/java/com/taobao/arthas/core/Arthas.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/com/taobao/arthas/core/Arthas.java b/core/src/main/java/com/taobao/arthas/core/Arthas.java index 5bf013529..45f15d7d6 100644 --- a/core/src/main/java/com/taobao/arthas/core/Arthas.java +++ b/core/src/main/java/com/taobao/arthas/core/Arthas.java @@ -75,6 +75,7 @@ public class Arthas { String pid = descriptor.id(); if (pid.equals(Long.toString(configure.getJavaPid()))) { virtualMachineDescriptor = descriptor; + break; } } VirtualMachine virtualMachine = null; From a03259c67865e4a43706a7eea9348db4e6efe401 Mon Sep 17 00:00:00 2001 From: penguin-wwy <940375606@qq.com> Date: Mon, 20 Apr 2020 20:00:17 +0800 Subject: [PATCH 03/13] fix ZH doc (#1127) --- README_CN.md | 2 +- site/src/site/sphinx/advanced-use.md | 2 +- site/src/site/sphinx/jad.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README_CN.md b/README_CN.md index 2e2e0254f..6899a4b8b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -519,7 +519,7 @@ OK * [termd](https://github.com/termd/termd): Arthas的命令行实现基于termd开发,是一款优秀的命令行程序开发框架,感谢termd提供了优秀的框架。 * [crash](https://github.com/crashub/crash): Arthas的文本渲染功能基于crash中的文本渲染功能开发,可以从[这里](https://github.com/crashub/crash/tree/1.3.2/shell)看到源码,感谢crash在这方面所做的优秀工作。 * [cli](https://github.com/eclipse-vertx/vert.x/tree/master/src/main/java/io/vertx/core/cli): Arthas的命令行界面基于vert.x提供的cli库进行开发,感谢vert.x在这方面做的优秀工作。 -* [compiler](https://github.com/skalogs/SkaETL/tree/master/compiler) Arthas里的内存编绎器代码来源 +* [compiler](https://github.com/skalogs/SkaETL/tree/master/compiler) Arthas里的内存编译器代码来源 * [Apache Commons Net](https://commons.apache.org/proper/commons-net/) Arthas里的Telnet Client代码来源 * [async-profiler](https://github.com/jvm-profiling-tools/async-profiler) Arthas's profiler 命令. diff --git a/site/src/site/sphinx/advanced-use.md b/site/src/site/sphinx/advanced-use.md index 5767acec9..969fe8f55 100644 --- a/site/src/site/sphinx/advanced-use.md +++ b/site/src/site/sphinx/advanced-use.md @@ -41,7 +41,7 @@ * [sc](sc.md)——查看JVM已加载的类信息 * [sm](sm.md)——查看已加载类的方法信息 * [jad](jad.md)——反编译指定已加载类的源码 -* [mc](mc.md)——内存编绎器,内存编绎`.java`文件为`.class`文件 +* [mc](mc.md)——内存编译器,内存编译`.java`文件为`.class`文件 * [redefine](redefine.md)——加载外部的`.class`文件,redefine到JVM里 * [dump](dump.md)——dump 已加载类的 byte code 到特定目录 * [classloader](classloader.md)——查看classloader的继承树,urls,类加载信息,使用classloader去getResource diff --git a/site/src/site/sphinx/jad.md b/site/src/site/sphinx/jad.md index b98985f01..c78ff184c 100644 --- a/site/src/site/sphinx/jad.md +++ b/site/src/site/sphinx/jad.md @@ -52,7 +52,7 @@ CharSequence { ... ``` -#### 反编绎时只显示源代码 +#### 反编译时只显示源代码 默认情况下,反编译结果里会带有`ClassLoader`信息,通过`--source-only`选项,可以只打印源代码。方便和[mc](mc.md)/[redefine](redefine.md)命令结合使用。 From 342313c5bb131e7f0f1967f01217cf8f86289b72 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 22 Apr 2020 10:26:59 +0800 Subject: [PATCH 04/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index afb5befc6..12695b8e7 100644 --- a/README.md +++ b/README.md @@ -526,9 +526,9 @@ This project exists thanks to all the people who contribute. #### Projects * [greys-anatomy](https://github.com/oldmanpushcart/greys-anatomy): The Arthas code base has derived from Greys, we thank for the excellent work done by Greys. -* [termd](https://github.com/termd/termd): Arthas's terminal implementation is based on termd, an open source library for writing terminal applications in Java. +* [termd](https://github.com/alibaba/termd): Arthas's terminal implementation is based on termd, an open source library for writing terminal applications in Java. * [crash](https://github.com/crashub/crash): Arthas's text based user interface rendering is based on codes extracted from [here](https://github.com/crashub/crash/tree/1.3.2/shell) -* [cli](https://github.com/eclipse-vertx/vert.x/tree/master/src/main/java/io/vertx/core/cli): Arthas's command line interface implementation is based on cli, open sourced by vert.x +* [cli](https://github.com/alibaba/cli): Arthas's command line interface implementation is based on cli, open sourced by vert.x * [compiler](https://github.com/skalogs/SkaETL/tree/master/compiler) Arthas's memory compiler. * [Apache Commons Net](https://commons.apache.org/proper/commons-net/) Arthas's telnet client. * [async-profiler](https://github.com/jvm-profiling-tools/async-profiler) Arthas's profiler command. From 839fda45cd11ab92511c2545841822e9d41dd8cb Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 22 Apr 2020 10:27:39 +0800 Subject: [PATCH 05/13] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 6899a4b8b..265311191 100644 --- a/README_CN.md +++ b/README_CN.md @@ -516,9 +516,9 @@ OK #### Projects * [greys-anatomy](https://github.com/oldmanpushcart/greys-anatomy): Arthas代码基于Greys二次开发而来,非常感谢Greys之前所有的工作,以及Greys原作者对Arthas提出的意见和建议! -* [termd](https://github.com/termd/termd): Arthas的命令行实现基于termd开发,是一款优秀的命令行程序开发框架,感谢termd提供了优秀的框架。 +* [termd](https://github.com/alibaba/termd): Arthas的命令行实现基于termd开发,是一款优秀的命令行程序开发框架,感谢termd提供了优秀的框架。 * [crash](https://github.com/crashub/crash): Arthas的文本渲染功能基于crash中的文本渲染功能开发,可以从[这里](https://github.com/crashub/crash/tree/1.3.2/shell)看到源码,感谢crash在这方面所做的优秀工作。 -* [cli](https://github.com/eclipse-vertx/vert.x/tree/master/src/main/java/io/vertx/core/cli): Arthas的命令行界面基于vert.x提供的cli库进行开发,感谢vert.x在这方面做的优秀工作。 +* [cli](https://github.com/alibaba/cli): Arthas的命令行界面基于vert.x提供的cli库进行开发,感谢vert.x在这方面做的优秀工作。 * [compiler](https://github.com/skalogs/SkaETL/tree/master/compiler) Arthas里的内存编译器代码来源 * [Apache Commons Net](https://commons.apache.org/proper/commons-net/) Arthas里的Telnet Client代码来源 * [async-profiler](https://github.com/jvm-profiling-tools/async-profiler) Arthas's profiler 命令. From 6b26a09a609f49e98307a1547594a5a3f706987f Mon Sep 17 00:00:00 2001 From: qxo <49526356@qq.com> Date: Wed, 22 Apr 2020 10:37:46 +0800 Subject: [PATCH 06/13] chore(.gitignore): add ignore pom.xml.versionsBackup (#1129) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 150063712..1f74907d3 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ site/src/site/sphinx/en/_build **/__pycache__ dependency-reduced-pom.xml +pom.xml.versionsBackup From 968996856885dc23099e488b17301a6d1f0700f3 Mon Sep 17 00:00:00 2001 From: qxo <49526356@qq.com> Date: Wed, 22 Apr 2020 11:09:54 +0800 Subject: [PATCH 07/13] Set default value for the express argument of the watch command (#1122) --- .../taobao/arthas/core/command/monitor200/WatchCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/WatchCommand.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/WatchCommand.java index 351075b9b..785894d81 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/WatchCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/WatchCommand.java @@ -10,6 +10,7 @@ import com.taobao.arthas.core.shell.command.CommandProcess; import com.taobao.arthas.core.util.SearchUtils; import com.taobao.arthas.core.util.matcher.Matcher; import com.taobao.middleware.cli.annotations.Argument; +import com.taobao.middleware.cli.annotations.DefaultValue; import com.taobao.middleware.cli.annotations.Description; import com.taobao.middleware.cli.annotations.Name; import com.taobao.middleware.cli.annotations.Option; @@ -54,7 +55,8 @@ public class WatchCommand extends EnhancerCommand { this.methodPattern = methodPattern; } - @Argument(index = 2, argName = "express") + @Argument(index = 2, argName = "express", required = false) + @DefaultValue("{params, target, returnObj}") @Description("the content you want to watch, written by ognl.\n" + Constants.EXPRESS_EXAMPLES) public void setExpress(String express) { this.express = express; From 0238b73186a0d8b1f6b5d22a3d761923b132bc8a Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 22 Apr 2020 15:00:25 +0800 Subject: [PATCH 08/13] Add git commit information in the jar package. close #1132 --- pom.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pom.xml b/pom.xml index 8fed50d2d..9faeb530d 100644 --- a/pom.xml +++ b/pom.xml @@ -219,6 +219,26 @@ + + + pl.project13.maven + git-commit-id-plugin + 2.2.1 + + + + revision + + + + + false + yyyy-MM-dd'T'HH:mm:ssZ + true + ${project.build.outputDirectory}/arthas-git.properties + git.build.host + + org.apache.maven.plugins maven-jar-plugin From 80e1fdf4ba5c8c9eaa31a1fe37cf3fc1317ef94a Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Thu, 23 Apr 2020 17:50:09 +0800 Subject: [PATCH 09/13] improve history command. close #1140 --- .../taobao/arthas/core/command/basic1000/HistoryCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/basic1000/HistoryCommand.java b/core/src/main/java/com/taobao/arthas/core/command/basic1000/HistoryCommand.java index 8bf6d468d..f2c919fdd 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/basic1000/HistoryCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/basic1000/HistoryCommand.java @@ -29,7 +29,7 @@ public class HistoryCommand extends AnnotatedCommand { boolean clear = false; int n = -1; - @Option(shortName = "c", longName = "clear") + @Option(shortName = "c", longName = "clear", flag = true , acceptValue = false) @Description("clear history") public void setClear(boolean clear) { this.clear = clear; @@ -56,7 +56,7 @@ public class HistoryCommand extends AnnotatedCommand { StringBuilder sb = new StringBuilder(); int size = history.size(); - if (n < 0) { + if (n < 0 || n > size) { n = size; } From 0476c61af98f51b9815a33d83b1643c0d2f3017e Mon Sep 17 00:00:00 2001 From: senninha Date: Thu, 7 May 2020 20:46:20 +0800 Subject: [PATCH 10/13] Avoid append spy jar to BootstrapClassLoader multiple times. fix #996 (#1153) --- .../src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java b/agent/src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java index 03ff15d13..ad83b32ab 100755 --- a/agent/src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java +++ b/agent/src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java @@ -79,7 +79,7 @@ public class AgentBootstrap { Class spyClass = null; if (parent != null) { try { - parent.loadClass("java.arthas.Spy"); + spyClass = parent.loadClass("java.arthas.Spy"); } catch (Throwable e) { // ignore } From 94c3eea37382170824e079dceaf60fcb4a908e74 Mon Sep 17 00:00:00 2001 From: Bo Zhang Date: Fri, 15 May 2020 22:37:41 +0800 Subject: [PATCH 11/13] Fix grammar issue (#1176) --- .../com/taobao/arthas/core/command/logger/LoggerCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java b/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java index b0488d874..aecabe614 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java @@ -81,7 +81,7 @@ public class LoggerCommand extends AnnotatedCommand { private String level; /** - * include the logger don't have appender, default false. + * include the logger which don't have appenders, default false. */ private boolean includeNoAppender; @@ -104,7 +104,7 @@ public class LoggerCommand extends AnnotatedCommand { } @Option(longName = "include-no-appender", flag = true) - @Description("include the loggers don't have appender, default value false") + @Description("include the loggers which don't have appenders, default value false") public void setHaveAppender(boolean includeNoAppender) { this.includeNoAppender = includeNoAppender; } From 4cb6cabba6c49dca2e757308d39b141ff7c92e78 Mon Sep 17 00:00:00 2001 From: shiliyu <34638563+shiliyu@users.noreply.github.com> Date: Sat, 16 May 2020 13:02:03 +0800 Subject: [PATCH 12/13] fix grammar issue (#1177) --- .../com/taobao/arthas/core/command/logger/LoggerCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java b/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java index aecabe614..a2a1d45d9 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/logger/LoggerCommand.java @@ -81,7 +81,7 @@ public class LoggerCommand extends AnnotatedCommand { private String level; /** - * include the logger which don't have appenders, default false. + * include the loggers which don't have appenders, default false. */ private boolean includeNoAppender; From 62c5c00459b48414407f5a4ccf0227a4e0eb8119 Mon Sep 17 00:00:00 2001 From: joker-9527 <505743251@qq.com> Date: Tue, 19 May 2020 21:57:53 +0800 Subject: [PATCH 13/13] Add known user (#1099) --- README.md | 1 + README_CN.md | 1 + static/mogu.jpg | Bin 0 -> 2985 bytes 3 files changed, 2 insertions(+) create mode 100644 static/mogu.jpg diff --git a/README.md b/README.md index 12695b8e7..2f439c102 100644 --- a/README.md +++ b/README.md @@ -509,6 +509,7 @@ Welcome to register the company name in this issue: https://github.com/alibaba/a ![上海喔噻](static/shouqingba.png) ![vipkid](static/vipkid.png) ![宇中科技](static/yuzhong.png) +![蘑菇财富](static/mogu.jpg) ### Derivative Projects diff --git a/README_CN.md b/README_CN.md index 265311191..a154535b3 100644 --- a/README_CN.md +++ b/README_CN.md @@ -498,6 +498,7 @@ OK ![上海喔噻](static/shouqingba.png) ![vipkid](static/vipkid.png) ![宇中科技](static/yuzhong.png) +![蘑菇财富](static/mogu.jpg) ### 洐生项目 diff --git a/static/mogu.jpg b/static/mogu.jpg new file mode 100644 index 0000000000000000000000000000000000000000..19ab493481c21bbd9182768d4e2fdeefbb858a9d GIT binary patch literal 2985 zcmcJQcTf{r7RD1&dC~%*gail#6eB@FS_m!ho>G>sfaD<{APE7aNC$y{7*HZzDH5bZ z#DXy_ASf1!C}2cN5RoPi6n#_`6*fAv`(|hMpPilk-I+Ug=A8NNx!;^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