X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdpdkevents.c;h=a580a3a55775d36e30386238517d1960615857bb;hp=4cdf01dfb778a83626b99e07d67403c865906835;hb=abaa1c8a24e8eff5632dd6052b1da5f6535caf19;hpb=47a8c3f0893a4ad8ef8f690ae0bd496ef55dcdcd diff --git a/src/dpdkevents.c b/src/dpdkevents.c index 4cdf01df..a580a3a5 100644 --- a/src/dpdkevents.c +++ b/src/dpdkevents.c @@ -511,16 +511,16 @@ static int dpdk_events_link_status_dispatch(dpdk_helper_ctx_t *phc) { char dev_name[DATA_MAX_NAME_LEN]; if (ec->config.link_status.port_name[i][0] != 0) { - snprintf(dev_name, sizeof(dev_name), "%s", + ssnprintf(dev_name, sizeof(dev_name), "%s", ec->config.link_status.port_name[i]); } else { - snprintf(dev_name, sizeof(dev_name), "port.%d", i); + ssnprintf(dev_name, sizeof(dev_name), "port.%d", i); } if (ec->config.link_status.notify) { int sev = ec->link_info[i].link_status ? NOTIF_OKAY : NOTIF_WARNING; char msg[DATA_MAX_NAME_LEN]; - snprintf(msg, sizeof(msg), "Link Status: %s", + ssnprintf(msg, sizeof(msg), "Link Status: %s", ec->link_info[i].link_status ? "UP" : "DOWN"); dpdk_events_notification_dispatch(sev, dev_name, ec->link_info[i].read_time, msg); @@ -557,7 +557,7 @@ static void dpdk_events_keep_alive_dispatch(dpdk_helper_ctx_t *phc) { } char core_name[DATA_MAX_NAME_LEN]; - snprintf(core_name, sizeof(core_name), "lcore%u", i); + ssnprintf(core_name, sizeof(core_name), "lcore%u", i); if (!ec->config.keep_alive.send_updated || (ec->core_info[i].lcore_state != @@ -572,34 +572,34 @@ static void dpdk_events_keep_alive_dispatch(dpdk_helper_ctx_t *phc) { switch (ec->config.keep_alive.shm->core_state[i]) { case RTE_KA_STATE_ALIVE: sev = NOTIF_OKAY; - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: ALIVE", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: ALIVE", i); break; case RTE_KA_STATE_MISSING: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: MISSING", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: MISSING", i); sev = NOTIF_WARNING; break; case RTE_KA_STATE_DEAD: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: DEAD", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: DEAD", i); sev = NOTIF_FAILURE; break; case RTE_KA_STATE_UNUSED: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: UNUSED", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: UNUSED", i); sev = NOTIF_OKAY; break; case RTE_KA_STATE_GONE: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: GONE", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: GONE", i); sev = NOTIF_FAILURE; break; case RTE_KA_STATE_DOZING: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: DOZING", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: DOZING", i); sev = NOTIF_OKAY; break; case RTE_KA_STATE_SLEEP: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: SLEEP", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: SLEEP", i); sev = NOTIF_OKAY; break; default: - snprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: UNKNOWN", i); + ssnprintf(msg, sizeof(msg), "lcore %u Keep Alive Status: UNKNOWN", i); sev = NOTIF_FAILURE; }