Skip to content

Remove profiling clock failure setting and handling - #6449

Merged
eregon merged 1 commit into
masterfrom
profiling/remove-clock-failure-setting
Oct 9, 2026
Merged

eregon merged 1 commit into
masterfrom
profiling/remove-clock-failure-setting

Conversation

@eregon

@eregon eregon commented Oct 8, 2026

Copy link
Copy Markdown
Member

These helpers read fixed system clocks supported on the target platforms: CLOCK_REALTIME, CLOCK_MONOTONIC and CLOCK_MONOTONIC_COARSE on Linux, and CLOCK_MONOTONIC_RAW and CLOCK_MONOTONIC_RAW_APPROX on macOS. They always pass a valid stack-allocated timespec to clock_gettime(), so invalid clock IDs and invalid output pointers cannot occur here. Unlike per-thread CPU clocks, these clocks cannot disappear when a thread exits, making failure handling unnecessary for these helpers.

Remove raise_on_failure_setting and its arguments from all callers, along with the zero-result checks and deferred ClockFailure exception machinery. Keep per-thread CPU clock error handling unchanged.

What does this PR do?

Motivation:

Simplicity, keeping it simple, clean.

Change log entry

Additional Notes:

How to test the change?

@eregon
eregon requested a review from a team as a code owner October 8, 2026 15:20
@eregon
eregon requested review from ivoanjo and removed request for a team October 8, 2026 15:20
@dd-octo-sts dd-octo-sts Bot added the profiling Involves Datadog profiling label Oct 8, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T15:35:58.798554Z 03646c5 Manual request
🔒 Security Review ✅ Completed 2026-10-08T15:37:30.628207Z 03646c5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 783cc1fd52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ext/datadog_profiling_native_extension/time_helpers.h Outdated
@eregon
eregon force-pushed the profiling/remove-clock-failure-setting branch from 783cc1f to 03646c5 Compare October 8, 2026 15:25
@eregon

eregon commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@eregon
eregon enabled auto-merge October 8, 2026 15:34
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 03646c5548

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 03646c5548

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 90.85% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: aeecbf2 | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-10-09 12:01:01

Comparing candidate commit aeecbf2 in PR branch profiling/remove-clock-failure-setting with baseline commit ac74293 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@ivoanjo ivoanjo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM Looks amazing, thanks for digging on this one!

It was so annoying to go all the time "uuuhhh time can fail here, how can we handle it, we're kinda in the middle of something".

I had AI friend do a "just in case" pass on linux/glibc/musl sources and it confirmed our expectations -- other than 32-bit or weird configurations (seccomp blocking time syscall) we're good!

Comment thread ext/datadog_profiling_native_extension/time_helpers.h
Comment thread ext/datadog_profiling_native_extension/collectors_thread_context.c Outdated
Comment thread ext/datadog_profiling_native_extension/collectors_thread_context.c Outdated
Comment thread ext/datadog_profiling_native_extension/time_helpers.c Outdated
Comment thread ext/datadog_profiling_native_extension/collectors_thread_context.c Outdated
Comment thread ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.c Outdated
Comment thread ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c Outdated
These helpers read fixed system clocks supported on the target platforms:
CLOCK_REALTIME, CLOCK_MONOTONIC and CLOCK_MONOTONIC_COARSE on Linux,
and CLOCK_MONOTONIC_RAW and CLOCK_MONOTONIC_RAW_APPROX on macOS.
They always pass a valid stack-allocated timespec to clock_gettime(),
so invalid clock IDs and invalid output pointers cannot occur here.
Unlike per-thread CPU clocks, these clocks cannot disappear when a thread
exits, making failure handling unnecessary for these helpers.

Remove raise_on_failure_setting and its arguments from all callers,
along with the zero-result checks and deferred ClockFailure exception
machinery. Keep per-thread CPU clock error handling unchanged.

Co-authored-by: Ivo Anjo <ivo@ivoanjo.me>
Co-authored-by: Codex (GPT-6.1-Sol) <noreply@openai.com>
@eregon
eregon force-pushed the profiling/remove-clock-failure-setting branch from 75c23b6 to aeecbf2 Compare October 9, 2026 11:34
@eregon
eregon merged commit 4357675 into master Oct 9, 2026
619 checks passed
@eregon
eregon deleted the profiling/remove-clock-failure-setting branch October 9, 2026 12:03
@dd-octo-sts dd-octo-sts Bot added this to the 2.45.0 milestone Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Involves Datadog profiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants