MCPcopy Create free account
hub / github.com/corosync/corosync / stats_map_init

Function stats_map_init

exec/stats.c:289–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289cs_error_t stats_map_init(const struct corosync_api_v1 *corosync_api)
290{
291 int i;
292 char param[ICMAP_KEYNAME_MAXLEN];
293 int32_t err;
294
295 api = corosync_api;
296
297 stats_map = qb_trie_create();
298 if (!stats_map) {
299 return CS_ERR_INIT;
300 }
301
302 /* Populate the static portions of the trie */
303 for (i = 0; i<NUM_PG_STATS; i++) {
304 sprintf(param, "stats.pg.%s", cs_pg_stats[i].name);
305 stats_add_entry(param, &cs_pg_stats[i]);
306 }
307 for (i = 0; i<NUM_SRP_STATS; i++) {
308 sprintf(param, "stats.srp.%s", cs_srp_stats[i].name);
309 stats_add_entry(param, &cs_srp_stats[i]);
310 }
311 for (i = 0; i<NUM_IPCSG_STATS; i++) {
312 sprintf(param, "stats.ipcs.%s", cs_ipcs_global_stats[i].name);
313 stats_add_entry(param, &cs_ipcs_global_stats[i]);
314 }
315
316 /* KNET, IPCS & SCHEDMISS stats are added when appropriate */
317
318
319 /* Call us when we can free things */
320 err = qb_map_notify_add(stats_map, NULL, stats_map_free_cb, QB_MAP_NOTIFY_FREE, NULL);
321
322 return (qb_to_cs_error(err));
323}
324
325cs_error_t stats_map_get(const char *key_name,
326 void *value,

Callers 1

mainFunction · 0.85

Calls 2

stats_add_entryFunction · 0.85
qb_to_cs_errorFunction · 0.85

Tested by

no test coverage detected