trace_method
Build a call tree for any Java method from a JFR recording. Shows who calls the method and the call paths, helping diagnose performance bottlenecks.
Instructions
Builds a call tree for a specific method from a .jfr file. Filters ExecutionSample events to find stack traces containing the given class and method, then aggregates call paths. Use when you want to see who calls a particular method and from where. Limitation: JFR sampling (~10 ms) may miss very fast methods.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filepath | No | Path to .jfr file. Shortcuts: 'new_profile' (current, default) or 'old_profile' (previous). Or full path e.g. recordings/new_profile.jfr. | new_profile |
| className | Yes | Fully qualified class name (e.g. com.example.MyService) or a substring to match. Used to filter stack frames. | |
| methodName | Yes | Method name to search for (e.g. processRequest). Matches the method in the stack trace. | |
| events | No | Optional list of JFR event types to parse. Default: jdk.ExecutionSample. Advanced users can specify other event types. | |
| topN | No | Maximum number of call paths (branches) to return in the call tree. Default: 10. |