get_stacks
Analyze CUDA/driver call stacks to identify code paths causing operations. Returns frequent stacks with symbols, source files, and timing for performance troubleshooting.
Instructions
Get resolved call stacks for CUDA/driver operations. Returns top stacks by frequency with symbol names, source files, and timing stats. One call answers 'what code path caused this operation?' For older DBs without resolved symbols, falls back to raw IPs (hex addresses).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Source filter: 1=CUDA, 3=HOST, 4=DRIVER | |
| op | No | Operation name (e.g. cudaMalloc, cuLaunchKernel) | |
| pid | No | Process ID filter | |
| since | No | Time window (e.g. 5m, 1h). Default: all data | |
| limit | No | Max stacks returned (default 10) | |
| tsc | No | telegraphic compression (default: true) |
Implementation Reference
- The `get_stacks` method in `MCPClient` is a handler that acts as an MCP client-side wrapper to invoke the `get_stacks` MCP tool.
def get_stacks(self, since: str = "0", op: str = "") -> dict: """Get resolved call stacks (120s timeout — stack aggregation can be slow).""" args = {"since": since, "tsc": False} if op: args["op"] = op return self.call("get_stacks", args, timeout=120)