|
14 | 14 | * straight to it. Measures the signal-delivery baseline. |
15 | 15 | * FAST_PATH — our classifier is installed on top; prev handler has |
16 | 16 | * an empty sa_mask (common case). forwardForeignSignal |
17 | | - * short-circuits pthread_sigmask. |
| 17 | + * skips rt_sigprocmask syscalls. |
18 | 18 | * SLOW_PATH — prev handler has a non-empty sa_mask AND |
19 | 19 | * DDPROF_FORWARD_APPLY_SIGMASK=1 is set (opt-in). |
20 | 20 | * forwardForeignSignal applies SIG_BLOCK / SIG_SETMASK |
21 | 21 | * (two syscalls). |
22 | 22 | * |
23 | 23 | * The delta between BASELINE and FAST_PATH is the overhead per foreign |
24 | 24 | * signal when sa_mask chaining is disabled (the default). The delta between |
25 | | - * FAST_PATH and SLOW_PATH is the cost of the two pthread_sigmask calls. |
| 25 | + * FAST_PATH and SLOW_PATH is the cost of the two rt_sigprocmask syscalls. |
26 | 26 | * |
27 | 27 | * The benchmark runs only when the env var BENCH_SIGNAL_ORIGIN is set, so |
28 | 28 | * normal CI does not pay for it. |
@@ -61,7 +61,7 @@ int setupForeignHandler(int signo, bool with_mask, struct sigaction* saved_out) |
61 | 61 | sigemptyset(&sa.sa_mask); |
62 | 62 | if (with_mask) { |
63 | 63 | // Populate with a few signals to force forwardForeignSignal onto the |
64 | | - // slow path (non-empty sa_mask → pthread_sigmask block + restore). |
| 64 | + // slow path (non-empty sa_mask → rt_sigprocmask block + restore). |
65 | 65 | sigaddset(&sa.sa_mask, SIGUSR2); |
66 | 66 | sigaddset(&sa.sa_mask, SIGALRM); |
67 | 67 | sigaddset(&sa.sa_mask, SIGCHLD); |
@@ -220,7 +220,7 @@ TEST_F(SignalOriginBench, SlowPath_ClassifierPlusMaskedForward) { |
220 | 220 | // Slow-path chain is opt-in behind DDPROF_FORWARD_APPLY_SIGMASK. |
221 | 221 | enableSigmaskChain(); |
222 | 222 | // Install a "foreign" handler with a non-empty sa_mask so |
223 | | - // forwardForeignSignal has to call pthread_sigmask twice. |
| 223 | + // forwardForeignSignal has to invoke two rt_sigprocmask syscalls. |
224 | 224 | ASSERT_EQ(0, setupForeignHandler(kBenchSignal, /*with_mask=*/true, &saved_action)); |
225 | 225 |
|
226 | 226 | OS::installSignalHandler(kBenchSignal, classifierHandler); |
@@ -343,7 +343,7 @@ TEST_F(SignalOriginBench, Pure_ForwardFastPath) { |
343 | 343 |
|
344 | 344 | TEST_F(SignalOriginBench, Pure_ForwardSlowPath) { |
345 | 345 | enableSigmaskChain(); |
346 | | - // Non-empty mask → pthread_sigmask twice per call. |
| 346 | + // Non-empty mask → rt_sigprocmask twice per call. |
347 | 347 | ASSERT_EQ(0, setupForeignHandler(kPureBenchSignal, /*with_mask=*/true, &saved_action)); |
348 | 348 | OS::installSignalHandler(kPureBenchSignal, classifierHandler); |
349 | 349 |
|
|
0 commit comments