trace
Trace function calls in a Go program by specifying a regular expression to filter functions. Optionally set package, use eBPF, show stack traces, or attach to a specific process.
Instructions
Trace program execution
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"regexp": "<regexp>"
},
"name": "trace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regexp | Yes | Regular expression to match functions to trace | |
| pkg | No | Package to trace (defaults to .) | |
| ebpf | No | Use eBPF for tracing (experimental) | |
| stack | No | Show stack trace with given depth | |
| pid | No | Pid to attach to |