Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(prof) I/O profiling preview #3083

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

realFlowControl
Copy link
Member

@realFlowControl realFlowControl commented Feb 12, 2025

Description

This adds I/O profiling preview to the PHP profiler on Linux machines (it is only compiled for Linux, but technically this is a ELF64 feature and could work on other OS that are using ELF64 too):

  • adds DD_PROFILING_IO_ENABLED / datadog.profiling.io_enabled configuration (default false)
  • adds new sample types:
    • socket_read_time
    • socket_write_time
    • file_read_time
    • file_write_time
    • socket_read_size
    • socket_write_size
    • file_read_size
    • file_write_size

Known limitations:

  • tests, including correctness are missing
  • benchmarks are missing
  • GOT hooking code and I/O profiling code is mixed
  • mmap() is not observed
  • SQLite is not observed (probably due to missing mmap() support)

Those things will be added/handled in future PRs, also because this feature is still experimental. The sampling distances are best guess and will likely be adjusted later.

https://datadoghq.atlassian.net/browse/PROF-11288

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.74%. Comparing base (f6a7e40) to head (016d5c8).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3083      +/-   ##
============================================
+ Coverage     72.95%   74.74%   +1.79%     
  Complexity     2790     2790              
============================================
  Files           139      112      -27     
  Lines         15280    11042    -4238     
  Branches       1047        0    -1047     
============================================
- Hits          11147     8253    -2894     
+ Misses         3580     2789     -791     
+ Partials        553        0     -553     
Flag Coverage Δ
appsec-extension ?
tracer-php 74.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 27 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6a7e40...016d5c8. Read the comment docs.

@github-actions github-actions bot added the profiling Relates to the Continuous Profiler label Feb 12, 2025
@pr-commenter
Copy link

pr-commenter bot commented Feb 12, 2025

Benchmarks [ profiler ]

Benchmark execution time: 2025-02-14 10:52:33

Comparing candidate commit 016d5c8 in PR branch florian/poc-got-io-profiling with baseline commit f6a7e40 in branch master.

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

scenario:walk_stack/1

  • 🟩 wall_time [-289.108ns; -285.495ns] or [-2.341%; -2.312%]

@realFlowControl realFlowControl marked this pull request as ready for review February 12, 2025 16:34
@realFlowControl realFlowControl requested a review from a team as a code owner February 12, 2025 16:34
@realFlowControl realFlowControl force-pushed the florian/poc-got-io-profiling branch from 6244902 to 826265c Compare February 14, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
profiling Relates to the Continuous Profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants