pix_get_context_switches
View a thread's scheduling history to see when it moved on or off a core and the wait reason, distinguishing blocked threads from CPU-bound ones.
Instructions
One thread's scheduling history: every time it came on or off a core, and why.
A row where from_thread_id is this thread is the thread losing the core, and from_thread_wait_reason says what for. That is the column that separates a thread that is slow because it is computing from one that is slow because it is blocked - a distinction a sample count cannot make, since a blocked thread simply produces fewer samples and looks idle.
Wait reasons are the Windows KWAIT_REASON values: 0 is Executive, 1 FreePage, 5 Suspended, 6 UserRequest, 7 WrExecutive, 13 WrQueue, 31 WrDispatchInt.
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": {
"capture_id": "<capture_id>",
"thread_id": "<thread_id>"
},
"name": "pix_get_context_switches"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| end_time | No | ||
| thread_id | Yes | ||
| capture_id | Yes | ||
| start_time | No | ||
| cursor_position | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||