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 diff --git a/README.md b/README.md index afb5befc6..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 @@ -526,9 +527,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. diff --git a/README_CN.md b/README_CN.md index 2e2e0254f..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) ### 洐生项目 @@ -516,10 +517,10 @@ 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在这方面做的优秀工作。 -* [compiler](https://github.com/skalogs/SkaETL/tree/master/compiler) Arthas里的内存编绎器代码来源 +* [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 命令. 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 347a35171..9cc1903de 100755 --- a/agent/src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java +++ b/agent/src/main/java/com/taobao/arthas/agent3/AgentBootstrap.java @@ -77,7 +77,7 @@ public class AgentBootstrap { Class spyClass = null; if (parent != null) { try { - parent.loadClass("java.arthas.SpyAPI"); + spyClass =parent.loadClass("java.arthas.SpyAPI"); } catch (Throwable e) { // ignore } 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; 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; } 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..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 don't have appender, default false. + * include the loggers 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; } 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; diff --git a/pom.xml b/pom.xml index 9398209a5..4913746d1 100644 --- a/pom.xml +++ b/pom.xml @@ -231,6 +231,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 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/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) 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)命令结合使用。 diff --git a/static/mogu.jpg b/static/mogu.jpg new file mode 100644 index 000000000..19ab49348 Binary files /dev/null and b/static/mogu.jpg differ