Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(agent): cleanup agent's verbosedebug log #896

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 14 additions & 6 deletions agent/php_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,9 +2163,13 @@ void nr_php_observer_fcall_begin(zend_execute_data* execute_data) {
int show_executes = NR_PHP_PROCESS_GLOBALS(special_flags).show_executes;

if (nrunlikely(show_executes)) {
nrl_verbosedebug(NRL_AGENT,
"Stack depth: %d after OAPI function beginning via %s",
NRPRG(php_cur_stack_depth), __func__);
int show_stack_depth
= NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_stack_depth;
if (nrunlikely(show_stack_depth)) {
nrl_verbosedebug(NRL_AGENT,
"Stack depth: %d after OAPI function beginning via %s",
NRPRG(php_cur_stack_depth), __func__);
}
nr_php_show_exec(NR_EXECUTE_ORIG_ARGS);
}
nr_php_instrument_func_begin(NR_EXECUTE_ORIG_ARGS);
Expand All @@ -2191,9 +2195,13 @@ void nr_php_observer_fcall_end(zend_execute_data* execute_data,
= NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_returns;

if (nrunlikely(show_executes_return)) {
nrl_verbosedebug(NRL_AGENT,
"Stack depth: %d before OAPI function exiting via %s",
NRPRG(php_cur_stack_depth), __func__);
int show_stack_depth
zsistla marked this conversation as resolved.
Show resolved Hide resolved
= NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_stack_depth;
if (nrunlikely(show_stack_depth)) {
nrl_verbosedebug(NRL_AGENT,
"Stack depth: %d before OAPI function exiting via %s",
NRPRG(php_cur_stack_depth), __func__);
}
nr_php_show_exec_return(NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
}

Expand Down
2 changes: 1 addition & 1 deletion agent/php_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef struct _nrphpglobals_t {
uint8_t no_background_jobs;
uint8_t show_executes;
uint8_t show_execute_params;
uint8_t show_execute_stack;
uint8_t show_execute_stack_depth;
uint8_t show_execute_returns;
uint8_t show_executes_untrimmed;
uint8_t no_exception_handler;
Expand Down
2 changes: 1 addition & 1 deletion agent/php_minit.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ PHP_MINIT_FUNCTION(newrelic) {
NR_INFO_SPECIAL_FLAGS(no_background_jobs);
NR_INFO_SPECIAL_FLAGS(show_executes);
NR_INFO_SPECIAL_FLAGS(show_execute_params);
NR_INFO_SPECIAL_FLAGS(show_execute_stack);
NR_INFO_SPECIAL_FLAGS(show_execute_stack_depth);
NR_INFO_SPECIAL_FLAGS(show_execute_returns);
NR_INFO_SPECIAL_FLAGS(show_executes_untrimmed);
NR_INFO_SPECIAL_FLAGS(no_signal_handler);
Expand Down
6 changes: 3 additions & 3 deletions agent/php_nrini.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,8 @@ static void foreach_special_control_flag(const char* str,
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_params = 1;
return;
}
if (0 == nr_strcmp(str, "show_execute_stack")) {
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_stack = 1;
if (0 == nr_strcmp(str, "show_execute_stack_depth")) {
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_stack_depth = 1;
return;
}
if (0 == nr_strcmp(str, "show_execute_returns")) {
Expand Down Expand Up @@ -973,7 +973,7 @@ static PHP_INI_MH(nr_special_mh) {
NR_PHP_PROCESS_GLOBALS(special_flags).no_background_jobs = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).show_executes = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_params = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_stack = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_stack_depth = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).show_execute_returns = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).show_executes_untrimmed = 0;
NR_PHP_PROCESS_GLOBALS(special_flags).no_exception_handler = 0;
Expand Down
4 changes: 2 additions & 2 deletions agent/scripts/newrelic.ini.private.template
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
; no_background_jobs
; show_executes
; show_execute_params
; show_execute_stack
; show_execute_stack_depth
; show_execute_returns
; show_executes_untrimmed
; no_exception_handler
Expand All @@ -52,7 +52,7 @@
; debug_dt
; disable_laravel_queue
;
;newrelic.special = show_executes, show_execute_params, show_execute_stack, show_execute_returns, show_executes_untrimmed
;newrelic.special = show_executes, show_execute_params, show_execute_stack_depth, show_execute_returns, show_executes_untrimmed

; Setting: newrelic.special.appinfo_timeout
; Type : integer (time in msec)
Expand Down