summaryrefslogtreecommitdiff
path: root/src/config/config_parse.cpp
diff options
context:
space:
mode:
authorlijia <[email protected]>2021-07-09 17:48:39 +0800
committerlijia <[email protected]>2021-07-09 17:48:39 +0800
commit41724299de7b703145510ddeecc75b0bf099ec3c (patch)
tree987519fe06a750cefda44875a177399eb4f910aa /src/config/config_parse.cpp
parent1df8b36e679069d7c1b2760d33ca14ec3b4a61fc (diff)
TSG-6871, 支持按每个插件的entry统计单包处理延时.
Diffstat (limited to 'src/config/config_parse.cpp')
-rw-r--r--src/config/config_parse.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/config/config_parse.cpp b/src/config/config_parse.cpp
index b4ae989..f87c364 100644
--- a/src/config/config_parse.cpp
+++ b/src/config/config_parse.cpp
@@ -265,6 +265,7 @@ static const sapp_config_check_t g_sapp_cfg_check_attr[] =
{6000,0,RLOG_LV_DEBUG,"PROFILING", NULL,NULL, NULL, NULL, NULL, 0},
{6101,0,RLOG_LV_DEBUG,"profiling.pkt_latency", "enabled", NULL,NULL, NULL, NULL, 0},
{6102,6101,RLOG_LV_DEBUG,"profiling.pkt_latency", "threshold", "1",NULL, NULL, NULL, 0},
+ {6103,6101,RLOG_LV_DEBUG,"profiling.pkt_latency", "accurate_enable", NULL,NULL, NULL, NULL, 0},
{6201,0,RLOG_LV_DEBUG,"profiling.sanity_check", "raw_pkt_broken_enabled", NULL,NULL, NULL, NULL, 0},
{6202,0,RLOG_LV_DEBUG,"profiling.sanity_check", "symbol_conflict_enabled", NULL,NULL, NULL, NULL, 0},
@@ -348,7 +349,6 @@ static const sapp_config_check_t g_sapp_cfg_check_attr[] =
{SAPP_CFG_OBSOLETE_FLAG,0,RLOG_LV_INFO,"SPECIAL_CONFIG_LINK","send_raw_pkt_path",NULL, NULL, NULL,NULL, 0},
{SAPP_CFG_OBSOLETE_FLAG,0,RLOG_LV_INFO,"SPECIAL_CONFIG_LINK","vxlan_sport_service_map_path",NULL, NULL, NULL,NULL, 0},
-
{-1,-1,RLOG_LV_DEBUG,NULL,NULL,NULL, NULL, NULL,NULL, 0}
};
@@ -2197,7 +2197,21 @@ int sapp_parse_config(void)
/******************************* PROFILING ******************************/
tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"profiling.pkt_latency", (char *)"enabled", (int *)&pconfig->profiling.pkt_latency_enabled, 0);
- tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"profiling.pkt_latency", (char *)"threshold", (int *)&pconfig->profiling.pkt_latency_threshold_in_us, 1000000);
+ if(pconfig->profiling.pkt_latency_enabled != 0){
+ tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"profiling.pkt_latency", (char *)"accurate_enable", (int *)&pconfig->profiling.pkt_latency_accurate_enable, 0);
+ tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"profiling.pkt_latency", (char *)"threshold", (int *)&pconfig->profiling.pkt_latency_threshold_in_ns, 1000000);
+ if(pconfig->profiling.pkt_latency_threshold_in_ns <= 0){
+ sapp_log(30, ~0, ~0, "config parse error! invalid value of 'profiling.pkt_latency->threshold', valid range is [1,999999]");
+ return -1;
+ }
+ if(pconfig->profiling.pkt_latency_threshold_in_ns >= 1000000){
+ sapp_log(30, ~0, ~0, "config parse error! invalid value of 'profiling.pkt_latency->threshold', valid range is [1,999999], set to max value 999999!");
+ pconfig->profiling.pkt_latency_threshold_in_ns *= 999999;
+ }
+ /* Ϊ�������ļ�����鿴, ����д̫���0, �����ļ���ĵ�λ��΢��, ������ʵ��������nsΪ��λ, �˴�Ҫ����1000 */
+ pconfig->profiling.pkt_latency_threshold_in_ns *= 1000;
+ }
+
tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"profiling.sanity_check", (char *)"raw_pkt_broken_enabled", (int *)&pconfig->profiling.sanity_check_raw_pkt_broken_enabled, 0);
tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"profiling.sanity_check", (char *)"symbol_conflict_enabled", (int *)&pconfig->profiling.sanity_check_symbol_conflict_enabled, 0);