@@ -146,6 +146,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
146
146
{ "access.format" , & fpm_conf_set_string , WPO (access_format ) },
147
147
{ "slowlog" , & fpm_conf_set_string , WPO (slowlog ) },
148
148
{ "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 ) },
149
150
{ "request_terminate_timeout" , & fpm_conf_set_time , WPO (request_terminate_timeout ) },
150
151
{ "rlimit_files" , & fpm_conf_set_integer , WPO (rlimit_files ) },
151
152
{ "rlimit_core" , & fpm_conf_set_rlimit_core , WPO (rlimit_core ) },
@@ -970,6 +971,30 @@ static int fpm_conf_process_all_pools() /* {{{ */
970
971
}
971
972
}
972
973
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
+
973
998
/* chroot */
974
999
if (wp -> config -> chroot && * wp -> config -> chroot ) {
975
1000
@@ -1635,6 +1660,7 @@ static void fpm_conf_dump() /* {{{ */
1635
1660
zlog (ZLOG_NOTICE , "\taccess.format = %s" , STR2STR (wp -> config -> access_format ));
1636
1661
zlog (ZLOG_NOTICE , "\tslowlog = %s" , STR2STR (wp -> config -> slowlog ));
1637
1662
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 );
1638
1664
zlog (ZLOG_NOTICE , "\trequest_terminate_timeout = %ds" , wp -> config -> request_terminate_timeout );
1639
1665
zlog (ZLOG_NOTICE , "\trlimit_files = %d" , wp -> config -> rlimit_files );
1640
1666
zlog (ZLOG_NOTICE , "\trlimit_core = %d" , wp -> config -> rlimit_core );
0 commit comments