Optimize and test fiber log

This commit is contained in:
zhengshuxin 2024-10-25 15:03:15 +08:00
parent eb84d01ea2
commit 808709245c
2 changed files with 8 additions and 5 deletions

View File

@ -25,7 +25,7 @@
#include "init.h" #include "init.h"
static char *version = "3.6.1-6 20241018-14:42"; static char *version = "3.6.1-6 20241024-11:47";
const char *acl_version(void) const char *acl_version(void)
{ {

View File

@ -79,7 +79,7 @@ static int acl_var_fiber_hook_log;
static ACL_CONFIG_BOOL_TABLE __conf_bool_tab[] = { static ACL_CONFIG_BOOL_TABLE __conf_bool_tab[] = {
{ "fiber_quick_abort", 1, &acl_var_fiber_quick_abort }, { "fiber_quick_abort", 1, &acl_var_fiber_quick_abort },
{ "fiber_share_stack", 0, &acl_var_fiber_share_stack }, { "fiber_share_stack", 0, &acl_var_fiber_share_stack },
{ "fiber_hook_log", 1, &acl_var_fiber_hook_log }, { "fiber_hook_log", 0, &acl_var_fiber_hook_log },
{ 0, 0, 0 }, { 0, 0, 0 },
}; };
@ -1071,8 +1071,8 @@ static void fiber_log_writer(void *, const char *fmt, va_list ap)
acl::string buf; acl::string buf;
buf.vformat(fmt, tmp); buf.vformat(fmt, tmp);
//acl_msg_info("%s", buf.c_str()); acl_msg_info("%s", buf.c_str());
printf("%s\r\n", buf.c_str()); //printf("%s\r\n", buf.c_str());
} }
static void hook_fiber_log(void) static void hook_fiber_log(void)
@ -1314,8 +1314,11 @@ void acl_fiber_server_main(int argc, char *argv[],
acl_msg_info("schedule event type - %s", acl_var_fiber_schedule_event); acl_msg_info("schedule event type - %s", acl_var_fiber_schedule_event);
if (acl_var_fiber_hook_log) { if (acl_var_fiber_hook_log) {
// No support io_uring mode current!.
if (__fiber_schedule_event != FIBER_EVENT_IO_URING) {
hook_fiber_log(); hook_fiber_log();
} }
}
#if !defined(_WIN32) && !defined(_WIN64) #if !defined(_WIN32) && !defined(_WIN64)
/* notify master that child started ok */ /* notify master that child started ok */