Browse Source

core: remove stats_name_separator from cfg_group_core

Federico Cabiddu 5 years ago
parent
commit
9948696fd8

+ 1 - 1
src/core/cfg.y

@@ -917,7 +917,7 @@ assign_stm:
 	| PORT EQUAL error    { yyerror("number expected"); }
 	| CHILDREN EQUAL NUMBER { children_no=$3; }
 	| CHILDREN EQUAL error { yyerror("number expected"); }
-	| STATS_NAMESEP EQUAL STRING { default_core_cfg.stats_name_separator=$3; }
+	| STATS_NAMESEP EQUAL STRING { ksr_stats_namesep=$3; }
 	| STATS_NAMESEP EQUAL error { yyerror("string value expected"); }
 	| SOCKET_WORKERS EQUAL NUMBER { socket_workers=$3; }
 	| SOCKET_WORKERS EQUAL error { yyerror("number expected"); }

+ 0 - 3
src/core/cfg_core.c

@@ -60,7 +60,6 @@ struct cfg_group_core default_core_cfg = {
 	L_WARN, 	/*!<  print only msg. < L_WARN */
 	LOG_DAEMON,	/*!< log_facility -- see syslog(3) */
 	L_DBG+1,    /*!< memdbg */
-  KSR_STATS_NAMESEP, /*  stats_name_separator */
 #ifdef USE_DST_BLACKLIST
 	/* blacklist */
 	0, /*!< dst blacklist is disabled by default */
@@ -186,8 +185,6 @@ cfg_def_t core_cfg_def[] = {
 		"syslog facility, see \"man 3 syslog\""},
 	{"memdbg",		CFG_VAR_INT|CFG_ATOMIC,	0, 0, 0, 0,
 		"log level for memory debugging messages"},
-	{"stats_name_separator",	CFG_VAR_STRING,	0, 0, 0, 0,
-		"separator used for building stats names"},
 #ifdef USE_DST_BLACKLIST
 	/* blacklist */
 	{"use_dst_blacklist",	CFG_VAR_INT,	0, 1, use_dst_blacklist_fixup, 0,

+ 0 - 1
src/core/cfg_core.h

@@ -48,7 +48,6 @@ struct cfg_group_core {
 	int	debug;
 	int	log_facility;
 	int memdbg; /*!< log level for memory debugging messages */
-  char *stats_name_separator;
 #ifdef USE_DST_BLACKLIST
 	/* blacklist */
 	int	use_dst_blacklist; /*!< 1 if blacklist is enabled */

+ 0 - 2
src/core/config.h

@@ -211,6 +211,4 @@
 
 #define DEFAULT_MAX_WHILE_LOOPS 100		/*!< Maximum allowed iterations for a while (to catch runaways) */
 
-#define KSR_STATS_NAMESEP "_"
-
 #endif

+ 1 - 0
src/core/counters.c

@@ -86,6 +86,7 @@ counter_array_t* _cnts_vals = 0;
 int _cnts_row_len; /* number of elements per row */
 static int cnts_no; /* number of registered counters */
 static int cnts_max_rows; /* set to 0 if not yet fully init */
+char *ksr_stats_namesep = KSR_STATS_NAMESEP;
 
 
 int counters_initialized(void)

+ 2 - 0
src/core/counters.h

@@ -39,6 +39,8 @@
 /* counter flags */
 #define CNT_F_NO_RESET 1 /* don't reset */
 
+#define KSR_STATS_NAMESEP "_"
+
 typedef long counter_val_t;
 
 /* use a struct. to force errors on direct access attempts */

+ 2 - 0
src/core/globals.h

@@ -217,6 +217,8 @@ extern str _ksr_xavp_via_fields;
 
 extern char *_sr_uri_host_extra_chars;
 
+extern char *ksr_stats_namesep;
+
 #ifdef USE_DNS_CACHE
 extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */
 extern unsigned int dns_timer_interval; /* gc timer interval in s */

+ 1 - 1
src/modules/ims_usrloc_pcscf/udomain.c

@@ -82,7 +82,7 @@ static char *build_stat_name( str* domain, char *var_name)
 	}
 	memcpy( s, domain->s, domain->len);
 	p = s + domain->len;
-	*(p++) = *cfg_get(core, core_cfg, stats_name_separator);
+	*(p++) = *ksr_stats_namesep;
 	memcpy( p , var_name, strlen(var_name));
 	p += strlen(var_name);
 	*(p++) = 0;

+ 1 - 1
src/modules/p_usrloc/udomain.c

@@ -55,7 +55,7 @@ static char *build_stat_name( str* domain, char *var_name)
 	}
 	memcpy( s, domain->s, domain->len);
 	p = s + domain->len;
-	*(p++) = *cfg_get(core, core_cfg, stats_name_separator);
+	*(p++) = *ksr_stats_namesep;
 	memcpy( p , var_name, strlen(var_name));
 	p += strlen(var_name);
 	*(p++) = 0;

+ 1 - 1
src/modules/usrloc/udomain.c

@@ -61,7 +61,7 @@ static char *build_stat_name( str* domain, char *var_name)
 	}
 	memcpy( s, domain->s, domain->len);
 	p = s + domain->len;
-	*(p++) = *cfg_get(core, core_cfg, stats_name_separator);
+	*(p++) = *ksr_stats_namesep;
 	memcpy( p , var_name, strlen(var_name));
 	p += strlen(var_name);
 	*(p++) = 0;