Skip to content

Commit db6ed1a

Browse files
Copilotjbachorik
andauthored
Update signalOrigin_bench comments to rt_sigprocmask wording
Agent-Logs-Url: https://github.com/DataDog/java-profiler/sessions/2b6d2309-a095-40d2-a5d0-76657df2b3ef Co-authored-by: jbachorik <738413+jbachorik@users.noreply.github.com>
1 parent 310bfb0 commit db6ed1a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

ddprof-lib/src/test/cpp/signalOrigin_bench.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* straight to it. Measures the signal-delivery baseline.
1515
* FAST_PATH — our classifier is installed on top; prev handler has
1616
* an empty sa_mask (common case). forwardForeignSignal
17-
* short-circuits pthread_sigmask.
17+
* skips rt_sigprocmask syscalls.
1818
* SLOW_PATH — prev handler has a non-empty sa_mask AND
1919
* DDPROF_FORWARD_APPLY_SIGMASK=1 is set (opt-in).
2020
* forwardForeignSignal applies SIG_BLOCK / SIG_SETMASK
2121
* (two syscalls).
2222
*
2323
* The delta between BASELINE and FAST_PATH is the overhead per foreign
2424
* 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.
2626
*
2727
* The benchmark runs only when the env var BENCH_SIGNAL_ORIGIN is set, so
2828
* normal CI does not pay for it.
@@ -61,7 +61,7 @@ int setupForeignHandler(int signo, bool with_mask, struct sigaction* saved_out)
6161
sigemptyset(&sa.sa_mask);
6262
if (with_mask) {
6363
// 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).
6565
sigaddset(&sa.sa_mask, SIGUSR2);
6666
sigaddset(&sa.sa_mask, SIGALRM);
6767
sigaddset(&sa.sa_mask, SIGCHLD);
@@ -220,7 +220,7 @@ TEST_F(SignalOriginBench, SlowPath_ClassifierPlusMaskedForward) {
220220
// Slow-path chain is opt-in behind DDPROF_FORWARD_APPLY_SIGMASK.
221221
enableSigmaskChain();
222222
// 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.
224224
ASSERT_EQ(0, setupForeignHandler(kBenchSignal, /*with_mask=*/true, &saved_action));
225225

226226
OS::installSignalHandler(kBenchSignal, classifierHandler);
@@ -343,7 +343,7 @@ TEST_F(SignalOriginBench, Pure_ForwardFastPath) {
343343

344344
TEST_F(SignalOriginBench, Pure_ForwardSlowPath) {
345345
enableSigmaskChain();
346-
// Non-empty mask → pthread_sigmask twice per call.
346+
// Non-empty mask → rt_sigprocmask twice per call.
347347
ASSERT_EQ(0, setupForeignHandler(kPureBenchSignal, /*with_mask=*/true, &saved_action));
348348
OS::installSignalHandler(kPureBenchSignal, classifierHandler);
349349

0 commit comments

Comments
 (0)