@@ -107,7 +107,6 @@ static inline nruserfn_t* nr_php_get_wraprec_from_op_array_extension(const char*
107
107
108
108
static void nr_php_show_exec_return (NR_EXECUTE_PROTO TSRMLS_DC );
109
109
static int nr_php_show_exec_indentation (TSRMLS_D );
110
- static void nr_php_show_exec (NR_EXECUTE_PROTO TSRMLS_DC );
111
110
112
111
/*
113
112
* Purpose: Enable monitoring on specific functions in the framework.
@@ -606,10 +605,11 @@ static int nr_php_show_exec_indentation(TSRMLS_D) {
606
605
* Note that this function doesn't handle internal functions, and will crash if
607
606
* you give it one.
608
607
*/
609
- static void nr_php_show_exec (NR_EXECUTE_PROTO TSRMLS_DC ) {
608
+ void nr_php_show_exec (const char * context , NR_EXECUTE_PROTO TSRMLS_DC ) {
610
609
char argstr [NR_EXECUTE_DEBUG_STRBUFSZ ];
611
610
const char * filename = nr_php_op_array_file_name (NR_OP_ARRAY );
612
611
const char * function_name = nr_php_op_array_function_name (NR_OP_ARRAY );
612
+ const char * ctx = context ? context : "execute" ;
613
613
#if ZEND_MODULE_API_NO >= ZEND_7_4_X_API_NO
614
614
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO
615
615
nruserfn_t * wr = nr_php_get_wraprec_from_op_array_extension (__func__ , execute_data -> func );
@@ -626,12 +626,13 @@ static void nr_php_show_exec(NR_EXECUTE_PROTO TSRMLS_DC) {
626
626
nr_show_execute_params (NR_EXECUTE_ORIG_ARGS , argstr TSRMLS_CC );
627
627
nrl_verbosedebug (
628
628
NRL_AGENT ,
629
- "execute : %.*s scope={%.*s} function={" NRP_FMT_UQ
629
+ NRP_FMT_UQ " : %.*s scope={%.*s} function={" NRP_FMT_UQ
630
630
"}"
631
631
" params={" NRP_FMT_UQ
632
632
"}"
633
633
" %.5s"
634
634
"@ " NRP_FMT_UQ ":%d" ,
635
+ NRP_SHOW_EXEC_CONTEXT (ctx ),
635
636
nr_php_show_exec_indentation (TSRMLS_C ), nr_php_indentation_spaces ,
636
637
NRSAFELEN (nr_php_class_entry_name_length (NR_OP_ARRAY -> scope )),
637
638
nr_php_class_entry_name (NR_OP_ARRAY -> scope ),
@@ -649,12 +650,13 @@ static void nr_php_show_exec(NR_EXECUTE_PROTO TSRMLS_DC) {
649
650
nr_show_execute_params (NR_EXECUTE_ORIG_ARGS , argstr TSRMLS_CC );
650
651
nrl_verbosedebug (
651
652
NRL_AGENT ,
652
- "execute : %.*s function={" NRP_FMT_UQ
653
+ NRP_FMT_UQ " : %.*s function={" NRP_FMT_UQ
653
654
"}"
654
655
" params={" NRP_FMT_UQ
655
656
"}"
656
657
" %.5s"
657
658
"@ " NRP_FMT_UQ ":%d" ,
659
+ NRP_SHOW_EXEC_CONTEXT (ctx ),
658
660
nr_php_show_exec_indentation (TSRMLS_C ), nr_php_indentation_spaces ,
659
661
NRP_PHP (function_name ), NRP_ARGSTR (argstr ),
660
662
#if ZEND_MODULE_API_NO < ZEND_7_4_X_API_NO
@@ -667,16 +669,17 @@ static void nr_php_show_exec(NR_EXECUTE_PROTO TSRMLS_DC) {
667
669
/*
668
670
* file
669
671
*/
670
- nrl_verbosedebug (NRL_AGENT , "execute: %.*s file={" NRP_FMT "}" ,
672
+ nrl_verbosedebug (NRL_AGENT , NRP_FMT_UQ ": %.*s file={" NRP_FMT "}" ,
673
+ NRP_SHOW_EXEC_CONTEXT (ctx ),
671
674
nr_php_show_exec_indentation (TSRMLS_C ),
672
675
nr_php_indentation_spaces , NRP_FILENAME (filename ));
673
676
} else {
674
677
/*
675
678
* unknown
676
679
*/
677
- nrl_verbosedebug (NRL_AGENT , "execute : %.*s ?" ,
678
- nr_php_show_exec_indentation ( TSRMLS_C ),
679
- nr_php_indentation_spaces );
680
+ nrl_verbosedebug (NRL_AGENT , NRP_FMT_UQ " : %.*s ?" ,
681
+ NRP_SHOW_EXEC_CONTEXT ( ctx ),
682
+ nr_php_show_exec_indentation ( TSRMLS_C ), nr_php_indentation_spaces );
680
683
}
681
684
}
682
685
@@ -1537,7 +1540,7 @@ static void nr_php_execute_enabled(NR_EXECUTE_PROTO TSRMLS_DC) {
1537
1540
1538
1541
static void nr_php_execute_show (NR_EXECUTE_PROTO TSRMLS_DC ) {
1539
1542
if (nrunlikely (NR_PHP_PROCESS_GLOBALS (special_flags ).show_executes )) {
1540
- nr_php_show_exec (NR_EXECUTE_ORIG_ARGS TSRMLS_CC );
1543
+ nr_php_show_exec ("execute" , NR_EXECUTE_ORIG_ARGS TSRMLS_CC );
1541
1544
}
1542
1545
1543
1546
nr_php_execute_enabled (NR_EXECUTE_ORIG_ARGS TSRMLS_CC );
@@ -2175,7 +2178,7 @@ void nr_php_observer_fcall_begin(zend_execute_data* execute_data) {
2175
2178
int show_executes = NR_PHP_PROCESS_GLOBALS (special_flags ).show_executes ;
2176
2179
2177
2180
if (nrunlikely (show_executes )) {
2178
- nr_php_show_exec (NR_EXECUTE_ORIG_ARGS );
2181
+ nr_php_show_exec ("execute" , NR_EXECUTE_ORIG_ARGS );
2179
2182
}
2180
2183
nr_php_instrument_func_begin (NR_EXECUTE_ORIG_ARGS );
2181
2184
0 commit comments