@@ -146,6 +146,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
146146 { "access.format" , & fpm_conf_set_string , WPO (access_format ) },
147147 { "slowlog" , & fpm_conf_set_string , WPO (slowlog ) },
148148 { "request_slowlog_timeout" , & fpm_conf_set_time , WPO (request_slowlog_timeout ) },
149+ { "request_slowlog_trace_depth" , & fpm_conf_set_integer , WPO (request_slowlog_trace_depth ) },
149150 { "request_terminate_timeout" , & fpm_conf_set_time , WPO (request_terminate_timeout ) },
150151 { "rlimit_files" , & fpm_conf_set_integer , WPO (rlimit_files ) },
151152 { "rlimit_core" , & fpm_conf_set_rlimit_core , WPO (rlimit_core ) },
@@ -970,6 +971,30 @@ static int fpm_conf_process_all_pools() /* {{{ */
970971 }
971972 }
972973
974+ /* request_slowlog_trace_depth */
975+ if (wp -> config -> request_slowlog_trace_depth ) {
976+ #if HAVE_FPM_TRACE
977+ if (! (wp -> config -> slowlog && * wp -> config -> slowlog )) {
978+ zlog (ZLOG_ERROR , "[pool %s] 'slowlog' must be specified for use with 'request_slowlog_trace_depth'" , wp -> config -> name );
979+ return -1 ;
980+ }
981+ #else
982+ static int warned = 0 ;
983+
984+ if (!warned ) {
985+ zlog (ZLOG_WARNING , "[pool %s] 'request_slowlog_trace_depth' is not supported on your system" , wp -> config -> name );
986+ warned = 1 ;
987+ }
988+ #endif
989+
990+ if (wp -> config -> request_slowlog_trace_depth <= 0 ) {
991+ zlog (ZLOG_ERROR , "[pool %s] 'request_slowlog_trace_depth' (%d) must be a positive value" , wp -> config -> name , wp -> config -> request_slowlog_trace_depth );
992+ return -1 ;
993+ }
994+ } else {
995+ wp -> config -> request_slowlog_trace_depth = 20 ;
996+ }
997+
973998 /* chroot */
974999 if (wp -> config -> chroot && * wp -> config -> chroot ) {
9751000
@@ -1635,6 +1660,7 @@ static void fpm_conf_dump() /* {{{ */
16351660 zlog (ZLOG_NOTICE , "\taccess.format = %s" , STR2STR (wp -> config -> access_format ));
16361661 zlog (ZLOG_NOTICE , "\tslowlog = %s" , STR2STR (wp -> config -> slowlog ));
16371662 zlog (ZLOG_NOTICE , "\trequest_slowlog_timeout = %ds" , wp -> config -> request_slowlog_timeout );
1663+ zlog (ZLOG_NOTICE , "\trequest_slowlog_trace_depth = %d" , wp -> config -> request_slowlog_trace_depth );
16381664 zlog (ZLOG_NOTICE , "\trequest_terminate_timeout = %ds" , wp -> config -> request_terminate_timeout );
16391665 zlog (ZLOG_NOTICE , "\trlimit_files = %d" , wp -> config -> rlimit_files );
16401666 zlog (ZLOG_NOTICE , "\trlimit_core = %d" , wp -> config -> rlimit_core );
0 commit comments