|
4 | 4 |
|
5 | 5 | ```bash |
6 | 6 | uname -r # Kernel 5.8+ required |
7 | | -ps -T -p <PID> | grep tokio # Verify Tokio workers exist |
| 7 | +ps -T -p <PID> # List all threads (look for worker pool) |
8 | 8 | readlink -f /proc/<PID>/exe # Get actual binary path |
9 | 9 | ``` |
10 | 10 |
|
@@ -51,12 +51,42 @@ Then rebuild your application. The Debug % should rise to 80-100%. |
51 | 51 | sudo ./hud my-app |
52 | 52 | ``` |
53 | 53 |
|
| 54 | +## Workers: 0 |
| 55 | + |
| 56 | +If hud prints `workers: 0`, it couldn't find Tokio worker threads. No events will be captured. |
| 57 | + |
| 58 | +**Step 1: Check what threads exist** |
| 59 | +```bash |
| 60 | +ps -T -p <PID> |
| 61 | +``` |
| 62 | + |
| 63 | +Default Tokio threads are named `tokio-runtime-w`. Custom runtimes using `thread_name("my-pool")` produce `my-pool-0`, `my-pool-1`, etc. |
| 64 | + |
| 65 | +**Step 2: hud auto-detects custom names** |
| 66 | + |
| 67 | +In most cases, hud finds the right threads automatically — it looks for the largest group of threads matching `{name}-{N}` patterns. If the output shows `workers: 0` despite threads being visible in `ps`, auto-detection may have picked the wrong group. |
| 68 | + |
| 69 | +**Step 3: Override with --workers** |
| 70 | +```bash |
| 71 | +sudo hud my-app --workers my-pool |
| 72 | +``` |
| 73 | + |
| 74 | +Pass the prefix that matches your worker threads (everything before the `-N` suffix). |
| 75 | + |
| 76 | +**Step 4: Debug with RUST_LOG** |
| 77 | +```bash |
| 78 | +RUST_LOG=warn sudo hud my-app |
| 79 | +``` |
| 80 | + |
| 81 | +This shows which threads were found and suggests the right `--workers` prefix. |
| 82 | + |
54 | 83 | ## No Events Captured |
55 | 84 |
|
56 | | -1. **Not Tokio:** Check for workers: `ps -T -p <PID> | grep tokio-runtime-w` |
57 | | -2. **Custom thread names:** Worker threads are auto-detected, but if detection fails, pass `--workers <prefix>` explicitly (e.g. `--workers my-worker`). Run with `RUST_LOG=warn` to see which threads were found and what prefix to use |
58 | | -3. **Idle app:** Generate load |
59 | | -4. **Multiple matches:** Use explicit PID: `hud --pid <PID>` |
| 85 | +If `workers: N` looks correct but you still see zero events: |
| 86 | + |
| 87 | +1. **Idle app:** Generate load — hud only captures events when workers are active |
| 88 | +2. **Multiple matches:** Use explicit PID: `hud --pid <PID>` |
| 89 | +3. **Threshold too high:** Try `--threshold 1` to catch shorter blocks |
60 | 90 |
|
61 | 91 | ## eBPF Build Failures |
62 | 92 |
|
|
0 commit comments