From 680184d6aec19065996912605735d15f3926ffa6 Mon Sep 17 00:00:00 2001 From: 杨威 Date: Fri, 28 Aug 2020 15:39:33 +0800 Subject: Update:add enable_marsio_send_burst_flush under [packet_io.internal.interface] in sapp.toml, set default as 0 --- src/packet_io/packet_io_marsio.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/packet_io/packet_io_marsio.c b/src/packet_io/packet_io_marsio.c index 12aff53..f02d7a0 100644 --- a/src/packet_io/packet_io_marsio.c +++ b/src/packet_io/packet_io_marsio.c @@ -880,13 +880,17 @@ static int marsio_dl_get_function_entry(void) printf("\033[33m[Warning]dlopen '%s' failed!\033[0m\n", "/opt/mrzcpd/lib/libmarsio.so"); return -1; } - - ptr_marsio_send_burst_flush = ( void (*)(struct mr_sendpath * sendpath, queue_id_t sid))dlsym(marsio_so_handle, "marsio_send_burst_flush"); - if(NULL == ptr_marsio_send_burst_flush){ - printf("\033[33m[Warning]dlsym function '%s' from '%s' failed!\033[0m\n", "marsio_send_burst_flush", "/opt/mrzcpd/lib/libmarsio.so"); - return -1; + static int g_enable_marsio_send_burst_flush = 0; + + MESA_load_profile_int_def((char *)"etc/sapp.toml", (char *)"packet_io.internal.interface", (char *)"enable_marsio_send_burst_flush", &g_enable_marsio_send_burst_flush, 0); + if(g_enable_marsio_send_burst_flush != 0) + { + ptr_marsio_send_burst_flush = ( void (*)(struct mr_sendpath * sendpath, queue_id_t sid))dlsym(marsio_so_handle, "marsio_send_burst_flush"); + if(NULL == ptr_marsio_send_burst_flush){ + printf("\033[33m[Warning]dlsym function '%s' from '%s' failed!\033[0m\n", "marsio_send_burst_flush", "/opt/mrzcpd/lib/libmarsio.so"); + return -1; + } } - return 0; } -- cgit v1.2.3