Commit df06b0f
committed
latency-test, latency-histogram: warn when rtapi_app lacks RT privileges
When a run-in-place build is used without 'sudo make setuid' (or
'sudo make setcap'), rtapi_app runs unprivileged: realtime threads get
neither SCHED_FIFO scheduling nor locked memory. The resulting latency
readings are wildly inflated and do not reflect the real hardware, which
is easy to mistake for a hardware or kernel problem.
Add a check in both tools that, for a non-root user, locates rtapi_app
and verifies it is either setuid root or carries the cap_sys_nice file
capability. If neither holds, print a warning that the numbers may be
skewed and point at the missing setuid/setcap step. The check stays
silent when run as root or when rtapi_app cannot be located.
Closes #40441 parent 4415063 commit df06b0f
2 files changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
114 | 139 | | |
115 | 140 | | |
116 | 141 | | |
| |||
944 | 969 | | |
945 | 970 | | |
946 | 971 | | |
| 972 | + | |
947 | 973 | | |
948 | 974 | | |
949 | 975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
19 | 44 | | |
20 | 45 | | |
21 | 46 | | |
| |||
170 | 195 | | |
171 | 196 | | |
172 | 197 | | |
| 198 | + | |
| 199 | + | |
173 | 200 | | |
0 commit comments