MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / build_stat_name

Function build_stat_name

statistics.c:133–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132
133char *build_stat_name( str* prefix, char *var_name)
134{
135 int n;
136 char *s;
137 char *p;
138
139 n = prefix->len + 1 + strlen(var_name) + 1;
140 s = (char*)shm_malloc( n );
141 if (s==0) {
142 LM_ERR("no more shm mem\n");
143 return 0;
144 }
145 memcpy( s, prefix->s, prefix->len);
146 p = s + prefix->len;
147 *(p++) = '-';
148 memcpy( p , var_name, strlen(var_name));
149 p += strlen(var_name);
150 *(p++) = 0;
151 return s;
152}
153
154
155/************* Functions for handling MODULEs(groups) of stats ***************/

Callers 5

init_pkg_statsFunction · 0.85
add_cc_flowFunction · 0.85
add_cc_agentFunction · 0.85
new_udomainFunction · 0.85

Calls 1

shm_mallocFunction · 0.85

Tested by

no test coverage detected