-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't inject the tracer if Opcache JIT is enabled
- Loading branch information
Showing
3 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
require_once __DIR__."/includes/autoload.php"; | ||
skip_if_not_php8(); | ||
skip_if_opcache_missing(); | ||
|
||
$jit_disabled = [ | ||
"-dzend_extension=opcache", | ||
"-dzend_extension=opcache -dopcache.jit_buffer_size=32M", | ||
"-dzend_extension=opcache -dopcache.jit_buffer_size=32M -dopcache.enable=0 -dopcache.enable_cli=1", | ||
"-dzend_extension=opcache -dopcache.jit=tracing -dopcache.enable_cli=1", | ||
]; | ||
foreach ($jit_disabled as $options) { | ||
$output = runCLI($options.' -v', true, ['DD_TRACE_DEBUG=1']); | ||
assertContains($output, 'Application instrumentation bootstrapping complete (\'ddtrace\')'); | ||
assertContains($output, 'with dd_library_loader v'); | ||
assertContains($output, 'with ddtrace v'); | ||
} | ||
|
||
$jit_enabled = [ | ||
"-dzend_extension=opcache -dopcache.jit_buffer_size=32M -dopcache.enable_cli=1", | ||
]; | ||
foreach ($jit_enabled as $options) { | ||
$output = runCLI($options.' -v', true, ['DD_TRACE_DEBUG=1']); | ||
assertContains($output, 'Opcache JIT is enabled, unregister the injected extension'); | ||
assertContains($output, 'with dd_library_loader v'); | ||
assertNotContains($output, 'with ddtrace v'); | ||
} |