summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95e06f1)
raw | patch | inline | side by side (parent: 95e06f1)
author | Maryam Tahhan <maryam.tahhan@intel.com> | |
Sun, 3 Apr 2016 09:42:44 +0000 (10:42 +0100) | ||
committer | Kim Jones <kim-marie.jones@intel.com> | |
Thu, 28 Jul 2016 12:16:32 +0000 (13:16 +0100) |
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
src/dpdkstat.c | patch | blob | history |
diff --git a/src/dpdkstat.c b/src/dpdkstat.c
index 8bb8ef9bdfc2b266cfe81d481e1068a6146d30dc..e451990d58c55e45c951176e5449b5d0089b0517 100644 (file)
--- a/src/dpdkstat.c
+++ b/src/dpdkstat.c
g_configuration->enabled_port_mask = 0;
g_configuration->eal_argc = 2;
g_configuration->eal_initialized = 0;
- snprintf(g_configuration->coremask, DATA_MAX_NAME_LEN, "%s", "0xf");
- snprintf(g_configuration->memory_channels, DATA_MAX_NAME_LEN, "%s", "1");
- snprintf(g_configuration->process_type, DATA_MAX_NAME_LEN, "%s", "secondary");
- snprintf(g_configuration->file_prefix, DATA_MAX_NAME_LEN, "%s",
+ ssnprintf(g_configuration->coremask, DATA_MAX_NAME_LEN, "%s", "0xf");
+ ssnprintf(g_configuration->memory_channels, DATA_MAX_NAME_LEN, "%s", "1");
+ ssnprintf(g_configuration->process_type, DATA_MAX_NAME_LEN, "%s", "secondary");
+ ssnprintf(g_configuration->file_prefix, DATA_MAX_NAME_LEN, "%s",
"/var/run/.rte_config");
return 0;
}
DEBUG("dpdkstat: Plugin Read Interval %lu milliseconds\n",
CDTIME_T_TO_MS(g_configuration->interval));
} else if (strcasecmp("Coremask", child->key) == 0) {
- snprintf(g_configuration->coremask, DATA_MAX_NAME_LEN, "%s",
+ ssnprintf(g_configuration->coremask, DATA_MAX_NAME_LEN, "%s",
child->values[0].value.string);
DEBUG("dpdkstat:COREMASK %s \n", g_configuration->coremask);
g_configuration->eal_argc+=1;
} else if (strcasecmp("MemoryChannels", child->key) == 0) {
- snprintf(g_configuration->memory_channels, DATA_MAX_NAME_LEN, "%s",
+ ssnprintf(g_configuration->memory_channels, DATA_MAX_NAME_LEN, "%s",
child->values[0].value.string);
DEBUG("dpdkstat:Memory Channels %s \n", g_configuration->memory_channels);
g_configuration->eal_argc+=1;
} else if (strcasecmp("SocketMemory", child->key) == 0) {
- snprintf(g_configuration->socket_memory, DATA_MAX_NAME_LEN, "%s",
+ ssnprintf(g_configuration->socket_memory, DATA_MAX_NAME_LEN, "%s",
child->values[0].value.string);
DEBUG("dpdkstat: socket mem %s \n", g_configuration->socket_memory);
g_configuration->eal_argc+=1;
} else if (strcasecmp("ProcessType", child->key) == 0) {
- snprintf(g_configuration->process_type, DATA_MAX_NAME_LEN, "%s",
+ ssnprintf(g_configuration->process_type, DATA_MAX_NAME_LEN, "%s",
child->values[0].value.string);
DEBUG("dpdkstat: proc type %s \n", g_configuration->process_type);
g_configuration->eal_argc+=1;
} else if (strcasecmp("FilePrefix", child->key) == 0) {
- snprintf(g_configuration->file_prefix, DATA_MAX_NAME_LEN, "/var/run/.%s_config",
+ ssnprintf(g_configuration->file_prefix, DATA_MAX_NAME_LEN, "/var/run/.%s_config",
child->values[0].value.string);
DEBUG("dpdkstat: file prefix %s \n", g_configuration->file_prefix);
if (strcasecmp(g_configuration->file_prefix, "/var/run/.rte_config") != 0) {
int nbytes = read(g_configuration->helper_pipes[0], buf, sizeof(buf));
if(nbytes <= 0)
break;
- snprintf( out, nbytes, "%s", buf);
+ ssnprintf( out, nbytes, "%s", buf);
DEBUG("dpdkstat: helper-proc: %s\n", out);
}
cdtime_t time = g_configuration->port_read_time[i];
char dev_name[64];
int len = g_configuration->num_stats_in_port[i];
- snprintf(dev_name, sizeof(dev_name), "port.%d", i);
+ ssnprintf(dev_name, sizeof(dev_name), "port.%d", i);
struct rte_eth_xstats *xstats = (&g_configuration->xstats);
xstats += count; /* pointer arithmetic to jump to each stats struct */
for (j = 0; j < len; j++) {