Skip to content

Commit 319db5a

Browse files
committed
Revert "test(profiling): provide test stub for zend_generator_check_placeholder_frame"
This reverts commit ea7bb074999dbcde5a8f78d3c673383818641719.
1 parent c83e161 commit 319db5a

3 files changed

Lines changed: 6 additions & 26 deletions

File tree

profiling/src/bindings/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,6 @@ extern "C" {
365365
func: &zend_function,
366366
) -> Option<&mut [usize; 2]>;
367367

368-
/// mock for testing; passthrough stub for zend_generator_check_placeholder_frame
369-
/// so `cargo test` builds don't need PHP's Zend symbols at link time.
370-
#[cfg(feature = "stack_walking_tests")]
371-
pub fn ddog_test_zend_generator_check_placeholder_frame(
372-
ptr: *mut zend_execute_data,
373-
) -> *mut zend_execute_data;
374-
375368
/// Returns the PHP_VERSION_ID of the engine at run-time, not the version
376369
/// the extension was built against at compile-time.
377370
pub fn ddog_php_prof_php_version_id() -> u32;

profiling/src/php_ffi.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,6 @@ uintptr_t *ddog_php_prof_function_run_time_cache(zend_function const *func) {
383383
}
384384

385385
#if CFG_STACK_WALKING_TESTS
386-
zend_execute_data *ddog_test_zend_generator_check_placeholder_frame(zend_execute_data *ptr) {
387-
// Tests do not construct real generator placeholder frames; pass through.
388-
return ptr;
389-
}
390-
391386
uintptr_t *ddog_test_php_prof_function_run_time_cache(zend_function const *func) {
392387
#if CFG_RUN_TIME_CACHE
393388
if (_ignore_run_time_cache) return NULL;

profiling/src/profiling/stack_walking.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,6 @@ mod detail {
300300
top_execute_data: *mut zend_execute_data,
301301
string_set: &mut StringSet,
302302
) -> Result<Backtrace, CollectStackSampleError> {
303-
#[cfg(feature = "stack_walking_tests")]
304-
use crate::bindings::ddog_test_zend_generator_check_placeholder_frame as zend_generator_check_placeholder_frame;
305-
#[cfg(not(feature = "stack_walking_tests"))]
306-
use crate::bindings::zend_generator_check_placeholder_frame;
307-
308303
let max_depth = 512;
309304
let mut samples = Vec::new();
310305
let mut execute_data_ptr = top_execute_data;
@@ -317,8 +312,9 @@ mod detail {
317312
// frame the same way zend_fetch_debug_backtrace and the observer
318313
// API do.
319314
if execute_data.func.is_null() {
320-
execute_data_ptr =
321-
unsafe { zend_generator_check_placeholder_frame(execute_data_ptr) };
315+
execute_data_ptr = unsafe {
316+
crate::bindings::zend_generator_check_placeholder_frame(execute_data_ptr)
317+
};
322318
}
323319
let Some(execute_data) = (unsafe { execute_data_ptr.as_ref() }) else {
324320
break;
@@ -501,11 +497,6 @@ mod detail {
501497
pub fn collect_stack_sample(
502498
top_execute_data: *mut zend_execute_data,
503499
) -> Result<Backtrace, CollectStackSampleError> {
504-
#[cfg(feature = "stack_walking_tests")]
505-
use crate::bindings::ddog_test_zend_generator_check_placeholder_frame as zend_generator_check_placeholder_frame;
506-
#[cfg(not(feature = "stack_walking_tests"))]
507-
use crate::bindings::zend_generator_check_placeholder_frame;
508-
509500
#[cfg(feature = "tracing")]
510501
let _span = tracing::trace_span!("collect_stack_sample").entered();
511502

@@ -515,8 +506,9 @@ mod detail {
515506

516507
while let Some(execute_data) = unsafe { execute_data_ptr.as_ref() } {
517508
if execute_data.func.is_null() {
518-
execute_data_ptr =
519-
unsafe { zend_generator_check_placeholder_frame(execute_data_ptr) };
509+
execute_data_ptr = unsafe {
510+
crate::bindings::zend_generator_check_placeholder_frame(execute_data_ptr)
511+
};
520512
}
521513
let Some(execute_data) = (unsafe { execute_data_ptr.as_ref() }) else {
522514
break;

0 commit comments

Comments
 (0)