diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java index 2ef0db2383e..7a0de8166ec 100755 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java @@ -65,6 +65,14 @@ public class ThreadCommand extends AnnotatedCommand { } } + private boolean hideInternalThreads; + + @Option(longName = "hide-internal", shortName = "hi", flag = true) + @Description("Hide internal threads") + public void setHideInternalThreads(final boolean hideInternalThreads) { + this.hideInternalThreads = hideInternalThreads; + } + @Argument(index = 0, required = false, argName = "id") @Description("Show thread stack") public void setId(long id) { @@ -143,7 +151,7 @@ private ExitStatus processAllThreads(CommandProcess process) { stateCountMap.put(threadState, count + 1); } - boolean includeInternalThreads = true; + boolean includeInternalThreads = !this.hideInternalThreads; Collection resultThreads = new ArrayList(); if (!StringUtils.isEmpty(this.state)) { this.state = this.state.toUpperCase();