From 6994e4528606b043fc9d672c7dc667cecf8fb003 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 20 Sep 2023 10:36:29 +0800 Subject: [PATCH 1/4] update faq.md --- site/docs/doc/faq.md | 5 +++++ site/docs/en/doc/faq.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/site/docs/doc/faq.md b/site/docs/doc/faq.md index 920056dd11..fd01e02cc3 100644 --- a/site/docs/doc/faq.md +++ b/site/docs/doc/faq.md @@ -100,6 +100,11 @@ ognl '@java.lang.System@out.println("Hello \u4e2d\u6587")' 可以。下载全量包解压即可,参考: [下载](download.md)。 +### Arthas 怎么使用指定版本,不使用自动升级版本 + +1. 启动 `as.sh`/`arthas-boot.jar`时,可以用 `--use-version` 参数指定。 +2. 下载全量包,解压后,`cd`到arthas目录启动,这种情况会使用当前目录下的版本。 + ### Attach docker/k8s 里的 pid 为 1 的进程失败 参考: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416](https://github.com/alibaba/arthas/issues/362#issuecomment-448185416) diff --git a/site/docs/en/doc/faq.md b/site/docs/en/doc/faq.md index 8f6bb9ab80..cb4c084aa6 100644 --- a/site/docs/en/doc/faq.md +++ b/site/docs/en/doc/faq.md @@ -100,6 +100,11 @@ Reference: [https://github.com/alibaba/arthas/issues/2165](https://github.com/al Yes. Just download the full size package and unzip it, refer to: [Download](download.md). +### How to use the specified version of Arthas without using the automatic upgrade version? + +1. When starting `as.sh`/`arthas-boot.jar`, you can specify it with the `--use-version` parameter. +2. Download the full package, unzip it, and cd to the arthas directory to start. In this case, the version in the current directory will be used. + ### Attach the process with pid 1 in docker/k8s failed Reference: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416](https://github.com/alibaba/arthas/issues/362#issuecomment-448185416) From 4340d4df73d4a76a4ef98dca6902c87ce91c6dd9 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 20 Sep 2023 11:09:21 +0800 Subject: [PATCH 2/4] update faq.md --- site/docs/doc/faq.md | 8 ++++++++ site/docs/en/doc/faq.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/site/docs/doc/faq.md b/site/docs/doc/faq.md index fd01e02cc3..a1989b4755 100644 --- a/site/docs/doc/faq.md +++ b/site/docs/doc/faq.md @@ -114,3 +114,11 @@ ognl '@java.lang.System@out.println("Hello \u4e2d\u6587")' 比如启动的 `as.sh/arthas-boot.jar` 版本是 3.5._ 的,但是连接上之后,打印的 arthas 版本是 3.4._ 的。 可能是之前使用旧版本的 arthas 诊断过目标进程。可以先执行`stop`停止掉旧版本的 arthas,再重新使用新版本 attach。 + + +### 在ognl表达式中获取到 spring bean cglib 对象,但是 field 是 null + +参考: + +* [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802) +* [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424) diff --git a/site/docs/en/doc/faq.md b/site/docs/en/doc/faq.md index cb4c084aa6..cbb4adc672 100644 --- a/site/docs/en/doc/faq.md +++ b/site/docs/en/doc/faq.md @@ -114,3 +114,11 @@ Reference: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416] For example, the started version of `as.sh/arthas-boot.jar` is 3.5._, but after connecting, the printed arthas version is 3.4._. It may be that the target process has been diagnosed with the old version of arthas before. You can execute `stop` to stop the old version of arthas, and then reuse the new version to attach. + + +### The spring bean cglib object is obtained in the ognl expression, but the field is null + +Reference: + +* [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802) +* [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424) \ No newline at end of file From 93d8f5c2f1c0abac671df1f47fda7995180c34c1 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 20 Sep 2023 03:12:08 +0000 Subject: [PATCH 3/4] Prettified Code! --- site/docs/doc/faq.md | 5 ++--- site/docs/en/doc/faq.md | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/site/docs/doc/faq.md b/site/docs/doc/faq.md index a1989b4755..c9778b2e43 100644 --- a/site/docs/doc/faq.md +++ b/site/docs/doc/faq.md @@ -115,10 +115,9 @@ ognl '@java.lang.System@out.println("Hello \u4e2d\u6587")' 可能是之前使用旧版本的 arthas 诊断过目标进程。可以先执行`stop`停止掉旧版本的 arthas,再重新使用新版本 attach。 - ### 在ognl表达式中获取到 spring bean cglib 对象,但是 field 是 null 参考: -* [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802) -* [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424) +- [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802) +- [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424) diff --git a/site/docs/en/doc/faq.md b/site/docs/en/doc/faq.md index cbb4adc672..45c1ae2d0a 100644 --- a/site/docs/en/doc/faq.md +++ b/site/docs/en/doc/faq.md @@ -115,10 +115,9 @@ For example, the started version of `as.sh/arthas-boot.jar` is 3.5._, but after It may be that the target process has been diagnosed with the old version of arthas before. You can execute `stop` to stop the old version of arthas, and then reuse the new version to attach. - ### The spring bean cglib object is obtained in the ognl expression, but the field is null Reference: -* [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802) -* [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424) \ No newline at end of file +- [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802) +- [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424) From c3c40076fcabe614f2b689082e2362e346d7e77b Mon Sep 17 00:00:00 2001 From: tianshuang Date: Sat, 16 Sep 2023 00:09:47 +0800 Subject: [PATCH 4/4] Make thread id uniformly displayed in decimal format --- .../java/com/taobao/arthas/core/command/view/TraceView.java | 4 ++-- .../src/main/java/com/taobao/arthas/core/util/ThreadUtil.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/view/TraceView.java b/core/src/main/java/com/taobao/arthas/core/command/view/TraceView.java index 65e92ad3e7..89fa45a524 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/view/TraceView.java +++ b/core/src/main/java/com/taobao/arthas/core/command/view/TraceView.java @@ -89,10 +89,10 @@ private void renderNode(StringBuilder sb, TraceNode node, Ansi highlighted) { //render thread info ThreadNode threadNode = (ThreadNode) node; //ts=2020-04-29 10:34:00;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@18b4aac2 - sb.append(format("ts=%s;thread_name=%s;id=%s;is_daemon=%s;priority=%d;TCCL=%s", + sb.append(format("ts=%s;thread_name=%s;id=%d;is_daemon=%s;priority=%d;TCCL=%s", DateUtils.formatDate(threadNode.getTimestamp()), threadNode.getThreadName(), - Long.toHexString(threadNode.getThreadId()), + threadNode.getThreadId(), threadNode.isDaemon(), threadNode.getPriority(), threadNode.getClassloader())); diff --git a/core/src/main/java/com/taobao/arthas/core/util/ThreadUtil.java b/core/src/main/java/com/taobao/arthas/core/util/ThreadUtil.java index 1a8746de75..b709857cb7 100644 --- a/core/src/main/java/com/taobao/arthas/core/util/ThreadUtil.java +++ b/core/src/main/java/com/taobao/arthas/core/util/ThreadUtil.java @@ -399,7 +399,7 @@ private static int findTheSpyAPIDepth(StackTraceElement[] stackTraceElementArray public static StackModel getThreadStackModel(ClassLoader loader, Thread currentThread) { StackModel stackModel = new StackModel(); stackModel.setThreadName(currentThread.getName()); - stackModel.setThreadId(Long.toHexString(currentThread.getId())); + stackModel.setThreadId(Long.toString(currentThread.getId())); stackModel.setDaemon(currentThread.isDaemon()); stackModel.setPriority(currentThread.getPriority()); stackModel.setClassloader(getTCCL(currentThread));