← 返回命令列表

Linux command

arthas-trace 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Trace

trace [com.example.MyClass] [myMethod]

Example

trace [com.example.MyClass] [myMethod] '#cost > 100'

Example

trace [com.example.MyClass] *

Example

trace -n [5] [com.example.MyClass] [myMethod]

说明

trace is an Arthas command that traces method execution paths and timing. It shows the call hierarchy within a method invocation, highlighting which sub-methods consume the most time. This is invaluable for identifying performance bottlenecks without adding logging or profiling instrumentation.

参数

class-pattern
Class name (supports wildcards)
method-pattern
Method name (supports wildcards)
-n _count_
Stop after count invocations
--skipJDKMethod
Skip tracing JDK methods
condition-express
OGNL condition (e.g., '#cost > 100')

FAQ

What is the arthas-trace command used for?

trace is an Arthas command that traces method execution paths and timing. It shows the call hierarchy within a method invocation, highlighting which sub-methods consume the most time. This is invaluable for identifying performance bottlenecks without adding logging or profiling instrumentation.

How do I run a basic arthas-trace example?

Run `trace [com.example.MyClass] [myMethod]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does class-pattern do in arthas-trace?

Class name (supports wildcards)