Commit 77c1e3e
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 code regression.
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 df06b0f commit 77c1e3e
2 files changed
Lines changed: 17 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
121 | 119 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 120 | + | |
| 121 | + | |
126 | 122 | | |
127 | | - | |
| 123 | + | |
128 | 124 | | |
129 | | - | |
130 | | - | |
| 125 | + | |
131 | 126 | | |
132 | 127 | | |
133 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
24 | 22 | | |
25 | | - | |
26 | | - | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 26 | + | |
32 | 27 | | |
33 | 28 | | |
34 | | - | |
| 29 | + | |
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
| |||
0 commit comments