@@ -371,6 +371,7 @@ pub struct RequestLocals {
371
371
pub env : Option < Cow < ' static , str > > ,
372
372
pub interrupt_count : AtomicU32 ,
373
373
pub profiling_enabled : bool ,
374
+ pub profiling_experimental_features_enabled : bool ,
374
375
pub profiling_endpoint_collection_enabled : bool ,
375
376
pub profiling_experimental_cpu_time_enabled : bool ,
376
377
pub profiling_allocation_enabled : bool ,
@@ -387,6 +388,7 @@ pub struct RequestLocals {
387
388
impl RequestLocals {
388
389
pub fn disable ( & mut self ) {
389
390
self . profiling_enabled = false ;
391
+ self . profiling_experimental_features_enabled = false ;
390
392
self . profiling_endpoint_collection_enabled = false ;
391
393
self . profiling_experimental_cpu_time_enabled = false ;
392
394
self . profiling_allocation_enabled = false ;
@@ -401,6 +403,7 @@ impl Default for RequestLocals {
401
403
env : None ,
402
404
interrupt_count : AtomicU32 :: new ( 0 ) ,
403
405
profiling_enabled : false ,
406
+ profiling_experimental_features_enabled : false ,
404
407
profiling_endpoint_collection_enabled : true ,
405
408
profiling_experimental_cpu_time_enabled : true ,
406
409
profiling_allocation_enabled : true ,
@@ -465,6 +468,7 @@ extern "C" fn rinit(_type: c_int, _module_number: c_int) -> ZendResult {
465
468
// Safety: We are after first rinit and before mshutdown.
466
469
let (
467
470
profiling_enabled,
471
+ profiling_experimental_features_enabled,
468
472
profiling_endpoint_collection_enabled,
469
473
profiling_experimental_cpu_time_enabled,
470
474
profiling_allocation_enabled,
@@ -475,13 +479,19 @@ extern "C" fn rinit(_type: c_int, _module_number: c_int) -> ZendResult {
475
479
output_pprof,
476
480
) = unsafe {
477
481
let profiling_enabled = config:: profiling_enabled ( ) ;
482
+ let profiling_experimental_features_enabled =
483
+ profiling_enabled && config:: profiling_experimental_features_enabled ( ) ;
478
484
(
479
485
profiling_enabled,
486
+ profiling_experimental_features_enabled,
480
487
profiling_enabled && config:: profiling_endpoint_collection_enabled ( ) ,
481
- profiling_enabled && config:: profiling_experimental_cpu_time_enabled ( ) ,
488
+ profiling_experimental_features_enabled
489
+ || profiling_enabled && config:: profiling_experimental_cpu_time_enabled ( ) ,
482
490
profiling_enabled && config:: profiling_allocation_enabled ( ) ,
483
- profiling_enabled && config:: profiling_experimental_timeline_enabled ( ) ,
484
- profiling_enabled && config:: profiling_experimental_exception_enabled ( ) ,
491
+ profiling_experimental_features_enabled
492
+ || profiling_enabled && config:: profiling_experimental_timeline_enabled ( ) ,
493
+ profiling_experimental_features_enabled
494
+ || profiling_enabled && config:: profiling_experimental_exception_enabled ( ) ,
485
495
config:: profiling_experimental_exception_sampling_distance ( ) ,
486
496
config:: profiling_log_level ( ) ,
487
497
config:: profiling_output_pprof ( ) ,
@@ -496,6 +506,7 @@ extern "C" fn rinit(_type: c_int, _module_number: c_int) -> ZendResult {
496
506
locals. interrupt_count . store ( 0 , Ordering :: SeqCst ) ;
497
507
498
508
locals. profiling_enabled = profiling_enabled;
509
+ locals. profiling_experimental_features_enabled = profiling_experimental_features_enabled;
499
510
locals. profiling_endpoint_collection_enabled = profiling_endpoint_collection_enabled;
500
511
locals. profiling_experimental_cpu_time_enabled = profiling_experimental_cpu_time_enabled;
501
512
locals. profiling_allocation_enabled = profiling_allocation_enabled;
@@ -766,6 +777,7 @@ unsafe extern "C" fn minfo(module_ptr: *mut zend::ModuleEntry) {
766
777
REQUEST_LOCALS . with ( |cell| {
767
778
let locals = cell. borrow ( ) ;
768
779
let yes: & [ u8 ] = b"true\0 " ;
780
+ let yes_exp: & [ u8 ] = b"true (all experimental features enabled)\0 " ;
769
781
let no: & [ u8 ] = b"false\0 " ;
770
782
let no_all: & [ u8 ] = b"false (profiling disabled)\0 " ;
771
783
zend:: php_info_print_table_start ( ) ;
@@ -776,11 +788,27 @@ unsafe extern "C" fn minfo(module_ptr: *mut zend::ModuleEntry) {
776
788
if locals. profiling_enabled { yes } else { no } ,
777
789
) ;
778
790
791
+ zend:: php_info_print_table_row (
792
+ 2 ,
793
+ b"Profiling Experimental Features Enabled\0 " . as_ptr ( ) ,
794
+ if locals. profiling_experimental_features_enabled {
795
+ yes
796
+ } else if locals. profiling_enabled {
797
+ no
798
+ } else {
799
+ no_all
800
+ } ,
801
+ ) ;
802
+
779
803
zend:: php_info_print_table_row (
780
804
2 ,
781
805
b"Experimental CPU Time Profiling Enabled\0 " . as_ptr ( ) ,
782
806
if locals. profiling_experimental_cpu_time_enabled {
783
- yes
807
+ if locals. profiling_experimental_features_enabled {
808
+ yes_exp
809
+ } else {
810
+ yes
811
+ }
784
812
} else if locals. profiling_enabled {
785
813
no
786
814
} else {
@@ -818,7 +846,11 @@ unsafe extern "C" fn minfo(module_ptr: *mut zend::ModuleEntry) {
818
846
2 ,
819
847
b"Experimental Timeline Enabled\0 " . as_ptr( ) ,
820
848
if locals. profiling_experimental_timeline_enabled {
821
- yes
849
+ if locals. profiling_experimental_features_enabled {
850
+ yes_exp
851
+ } else {
852
+ yes
853
+ }
822
854
} else if locals. profiling_enabled {
823
855
no
824
856
} else {
@@ -840,7 +872,11 @@ unsafe extern "C" fn minfo(module_ptr: *mut zend::ModuleEntry) {
840
872
2 ,
841
873
b"Experimental Exception Profiling Enabled\0 " . as_ptr( ) ,
842
874
if locals. profiling_experimental_exception_enabled {
843
- yes
875
+ if locals. profiling_experimental_features_enabled {
876
+ yes_exp
877
+ } else {
878
+ yes
879
+ }
844
880
} else if locals. profiling_enabled {
845
881
no
846
882
} else {
0 commit comments