profile_process
Identify what inside a CPU-heavy process consumes processor time. Samples run for 1-30 seconds and return the top functions, modules, threads, and hottest call path as shares of samples. Windows, as administrator.
Instructions
Samples where a process spends its processor time, for a few seconds (1 to 30, default 5): the system's own profiler records what each processor runs a thousand times a second, with the call stack, and the samples of this process are summed. Returns the functions taking the most time (their own time, and with the functions they call, as shares of the samples), the modules, the threads, and the hottest call path from the outermost call in. Use it when a process uses much CPU and the question is what in it does; get_thread_stacks gives one moment's stacks instead. Windows only, as administrator. The process is not opened: the kernel walks its stacks, and names come from the symbols on this PC (the modules' PDB files) or their exports; code without either is named by its module. It runs a kernel trace for the time asked, which costs some CPU while it runs.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "profile_process"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | The process to sample. | |
| top | No | How many functions and modules to list, the most time first (1 to 100, default 25). | |
| seconds | No | How long to sample, in seconds (1 to 30, default 5). |