Commit 14f61d5
committed
mctpd: timerfd based timers
Replace all sd-event timers with timerfd-like interfaces for
testability.
On release builds, those uses real timerfds.
On test builds, those are backed by MockClocks. autojump_clock is
ultilized to skip through all the Trio time related wait, reducing test
time.
Because we still have real timeouts (D-Bus call to mctpd subprocess,
mctpd SO_RCVTIMEO wait, ...), autojump_threshold (how much to wait
before skipping Trio timeouts) is set to a reasonable value to take that
into account.
Tested: Only tested with tests. Real timerfd backend is entirely
untested.
Signed-off-by: Khang D Nguyen <[email protected]>1 parent 9c68dab commit 14f61d5
File tree
8 files changed
+232
-22
lines changed- src
- tests
- mctpenv
8 files changed
+232
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
60 | 114 | | |
61 | 115 | | |
62 | 116 | | |
| |||
74 | 128 | | |
75 | 129 | | |
76 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
77 | 136 | | |
78 | 137 | | |
79 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3079 | 3079 | | |
3080 | 3080 | | |
3081 | 3081 | | |
3082 | | - | |
| 3082 | + | |
3083 | 3083 | | |
3084 | 3084 | | |
3085 | 3085 | | |
3086 | 3086 | | |
3087 | 3087 | | |
| 3088 | + | |
3088 | 3089 | | |
3089 | 3090 | | |
3090 | 3091 | | |
| |||
3099 | 3100 | | |
3100 | 3101 | | |
3101 | 3102 | | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
3102 | 3109 | | |
3103 | 3110 | | |
3104 | 3111 | | |
| |||
3194 | 3201 | | |
3195 | 3202 | | |
3196 | 3203 | | |
3197 | | - | |
3198 | | - | |
| 3204 | + | |
3199 | 3205 | | |
3200 | 3206 | | |
3201 | 3207 | | |
| |||
3217 | 3223 | | |
3218 | 3224 | | |
3219 | 3225 | | |
| 3226 | + | |
3220 | 3227 | | |
3221 | 3228 | | |
3222 | 3229 | | |
3223 | 3230 | | |
3224 | 3231 | | |
| 3232 | + | |
3225 | 3233 | | |
3226 | 3234 | | |
3227 | 3235 | | |
| |||
3230 | 3238 | | |
3231 | 3239 | | |
3232 | 3240 | | |
3233 | | - | |
3234 | | - | |
3235 | | - | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
3236 | 3262 | | |
3237 | 3263 | | |
3238 | 3264 | | |
3239 | 3265 | | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
3240 | 3273 | | |
3241 | 3274 | | |
3242 | 3275 | | |
| |||
3253 | 3286 | | |
3254 | 3287 | | |
3255 | 3288 | | |
3256 | | - | |
3257 | | - | |
3258 | | - | |
3259 | | - | |
3260 | | - | |
3261 | | - | |
| 3289 | + | |
| 3290 | + | |
3262 | 3291 | | |
3263 | 3292 | | |
3264 | 3293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | | - | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | | - | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
230 | 282 | | |
231 | 283 | | |
232 | 284 | | |
| |||
244 | 296 | | |
245 | 297 | | |
246 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
247 | 304 | | |
248 | 305 | | |
249 | 306 | | |
| |||
0 commit comments