Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions .github/workflows/prof_correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
export DD_PROFILING_EXCEPTION_MESSAGE_ENABLED=1
php -v
php -d extension=target/profiler-release/libdatadog_php_profiling.so --ri datadog-profiling
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "io"; do
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "io" "allocation_time_combined"; do
mkdir -p profiling/tests/correctness/"$test_case"/
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
php -d extension="${PWD}/target/profiler-release/libdatadog_php_profiling.so" "profiling/tests/correctness/${test_case}.php"
Expand All @@ -98,7 +98,7 @@ jobs:
export DD_PROFILING_EXCEPTION_MESSAGE_ENABLED=1
php -v
php -d extension=target/profiler-release/libdatadog_php_profiling.so --ri datadog-profiling
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "io"; do
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "io" "allocation_time_combined"; do
mkdir -p profiling/tests/correctness/"$test_case"/
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
php -d extension=$PWD/target/profiler-release/libdatadog_php_profiling.so profiling/tests/correctness/"$test_case".php
Expand All @@ -113,26 +113,6 @@ jobs:
USE_ZEND_ALLOC=0 php -d extension=$PWD/target/profiler-release/libdatadog_php_profiling.so profiling/tests/correctness/allocations.php
unset DD_PROFILING_ALLOCATION_SAMPLING_DISTANCE

- name: Run allocation_time_combined test (PHP 8.4+)
if: fromJSON(matrix.php-version) >= 8.4
run: |
export DD_PROFILING_LOG_LEVEL=trace
export DD_PROFILING_EXPERIMENTAL_FEATURES_ENABLED=1
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE=1
export DD_PROFILING_EXCEPTION_MESSAGE_ENABLED=1
php -v
php -d extension=target/profiler-release/libdatadog_php_profiling.so --ri datadog-profiling
mkdir -p profiling/tests/correctness/allocation_time_combined/
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/allocation_time_combined/test.pprof
export DD_PROFILING_ALLOCATION_ENABLED=yes
export DD_PROFILING_ALLOCATION_SAMPLING_DISTANCE=1
export DD_PROFILING_WALL_TIME_ENABLED=yes
export DD_PROFILING_EXPERIMENTAL_CPU_TIME_ENABLED=no
export DD_PROFILING_ENDPOINT_COLLECTION_ENABLED=no
export EXECUTION_TIME=5
php -d extension=$PWD/target/profiler-release/libdatadog_php_profiling.so profiling/tests/correctness/allocation_time_combined.php
unset DD_PROFILING_ALLOCATION_ENABLED DD_PROFILING_ALLOCATION_SAMPLING_DISTANCE DD_PROFILING_WALL_TIME_ENABLED DD_PROFILING_EXPERIMENTAL_CPU_TIME_ENABLED DD_PROFILING_ENDPOINT_COLLECTION_ENABLED EXECUTION_TIME

- name: Run ZTS tests
if: matrix.phpts == 'zts'
run: |
Expand Down Expand Up @@ -185,7 +165,6 @@ jobs:
pprof_path: profiling/tests/correctness/timeline/

- name: Check profiler correctness for allocation_time_combined
if: fromJSON(matrix.php-version) >= 8.4
uses: Datadog/prof-correctness/analyze@main
with:
expected_json: profiling/tests/correctness/allocation_time_combined.json
Expand Down
8 changes: 4 additions & 4 deletions profiling/tests/correctness/allocation_time_combined.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
{
"regular_expression": "<?php;main;standard\\|str_replace$",
"percent": 66,
"error_margin": 1
"error_margin": 3
},
{
"regular_expression": "<?php;main;standard\\|str_repeat$",
"percent": 33,
"error_margin": 1
Comment thread
morrisonlevi marked this conversation as resolved.
"error_margin": 3
}
]
},
Expand All @@ -37,8 +37,8 @@
"stack-content": [
{
"regular_expression": "<?php;main;standard\\|str_replace$",
"percent": 51,
"error_margin": 50
"percent": 70,
"error_margin": 30
Comment on lines +40 to +41
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This stack is for wall-time. The idea here is that str_replace will use enough CPU that the allocation time spent is negligible, and the replace operation will dominate it.

The variability comes from whether it's piggy-backing on the allocation interrupt (for frameless versions, where we don't get an interrupt on the frameless call) or on older versions without it, we get an interrupt, and it's more accurate.

}
]
}
Expand Down
Loading