From: Eero Tamminen Date: Tue, 30 Jan 2024 10:38:38 +0000 (+0200) Subject: dpdk*.c: __FUNCTION__ -> __func__ (C99) X-Git-Tag: collectd-6.0.0.rc2~11^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38277d378f34a31c83a6cdbfbeed2952002ec632;p=thirdparty%2Fcollectd.git dpdk*.c: __FUNCTION__ -> __func__ (C99) Same -Wpendantic warnings fixes for plugin code. Signed-off-by: Eero Tamminen --- diff --git a/src/dpdk_telemetry.c b/src/dpdk_telemetry.c index cfee5f129..93b1830cc 100644 --- a/src/dpdk_telemetry.c +++ b/src/dpdk_telemetry.c @@ -67,7 +67,7 @@ static char g_dpdk_path[BUF_SIZE]; static int dpdk_telemetry_config(oconfig_item_t *ci) { int ret, i; - DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__); + DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__); for (i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -85,7 +85,7 @@ static int dpdk_telemetry_config(oconfig_item_t *ci) { } if (ret < 0) { - INFO(PLUGIN_NAME ": %s:%d ret =%d", __FUNCTION__, __LINE__, ret); + INFO(PLUGIN_NAME ": %s:%d ret =%d", __func__, __LINE__, ret); return ret; } } @@ -248,7 +248,7 @@ static int dpdk_telemetry_cleanup(void) { } static int dpdk_telemetry_socket_init(void) { - DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__); + DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__); char message[BUF_SIZE]; /* Here we look up the length of the g_dpdk_path string @@ -319,7 +319,7 @@ static int dpdk_telemetry_socket_init(void) { } static int dpdk_telemetry_shutdown(void) { - DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__); + DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__); char msg[BUF_SIZE]; int ret; @@ -338,7 +338,7 @@ static int dpdk_telemetry_shutdown(void) { } static int dpdk_telemetry_read(user_data_t *ud) { - DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__); + DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__); char buffer[BUF_SIZE]; int bytes = 0, ret; char *json_string[MAX_COMMANDS] = {"{\"action\":0,\"command\":" @@ -378,7 +378,7 @@ static int dpdk_telemetry_read(user_data_t *ud) { static int dpdk_telemetry_init(void) { - DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__); + DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__); client.s_send = -1; client.s_recv = -1; diff --git a/src/dpdkevents.c b/src/dpdkevents.c index 4c8196aed..6fdface61 100644 --- a/src/dpdkevents.c +++ b/src/dpdkevents.c @@ -111,7 +111,7 @@ typedef enum { #define DPDK_EVENTS_CTX_GET(a) ((dpdk_events_ctx_t *)dpdk_helper_priv_get(a)) #define DPDK_EVENTS_TRACE() \ - DEBUG("%s:%s:%d pid=%u", DPDK_EVENTS_PLUGIN, __FUNCTION__, __LINE__, getpid()) + DEBUG("%s:%s:%d pid=%u", DPDK_EVENTS_PLUGIN, __func__, __LINE__, getpid()) static dpdk_helper_ctx_t *g_hc; static dpdk_events_cfg_status g_state; @@ -497,7 +497,7 @@ static void dpdk_events_gauge_submit(const char *plugin_instance, static int dpdk_events_link_status_dispatch(dpdk_helper_ctx_t *phc) { dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc); - DEBUG(DPDK_EVENTS_PLUGIN ": %s:%d ports=%u", __FUNCTION__, __LINE__, + DEBUG(DPDK_EVENTS_PLUGIN ": %s:%d ports=%u", __func__, __LINE__, ec->nb_ports); /* dispatch Link Status values to collectd */ @@ -552,7 +552,7 @@ static void dpdk_events_keep_alive_dispatch(dpdk_helper_ctx_t *phc) { } else { WARNING(DPDK_EVENTS_PLUGIN ": %s:%d Core id %u is out of 0 to %u range, skipping", - __FUNCTION__, __LINE__, i, INT64_BIT_SIZE * 2); + __func__, __LINE__, i, INT64_BIT_SIZE * 2); continue; } @@ -639,7 +639,7 @@ static int dpdk_events_read(user_data_t *ud) { if (ka_ret) { ERROR(DPDK_EVENTS_PLUGIN ": %s : error %d in dpdk_event_keep_alive_shm_open()", - __FUNCTION__, ka_ret); + __func__, ka_ret); } else dpdk_events_keep_alive_dispatch(g_hc); } diff --git a/src/dpdkstat.c b/src/dpdkstat.c index ae93e53b2..577010390 100644 --- a/src/dpdkstat.c +++ b/src/dpdkstat.c @@ -42,7 +42,7 @@ #define DPDK_STATS_NAME "dpdk_collectd_stats" #define DPDK_STATS_TRACE() \ - DEBUG("%s:%s:%d pid=%u", DPDK_STATS_PLUGIN, __FUNCTION__, __LINE__, getpid()) + DEBUG("%s:%s:%d pid=%u", DPDK_STATS_PLUGIN, __func__, __LINE__, getpid()) struct dpdk_stats_config_s { cdtime_t interval; @@ -266,7 +266,7 @@ static int dpdk_helper_stats_count_get(dpdk_helper_ctx_t *phc) { stats_count += len; } - DPDK_CHILD_LOG("%s:%s:%d stats_count=%d\n", DPDK_STATS_PLUGIN, __FUNCTION__, + DPDK_CHILD_LOG("%s:%s:%d stats_count=%d\n", DPDK_STATS_PLUGIN, __func__, __LINE__, stats_count); return stats_count; @@ -301,7 +301,7 @@ int dpdk_helper_command_handler(dpdk_helper_ctx_t *phc, enum DPDK_CMD cmd) { DPDK_CHILD_LOG( DPDK_STATS_PLUGIN ":%s:%d not enough space for stats (available=%d, needed=%d)\n", - __FUNCTION__, __LINE__, (int)dpdk_stats_get_size(phc), stats_size); + __func__, __LINE__, (int)dpdk_stats_get_size(phc), stats_size); return -ENOBUFS; } @@ -384,7 +384,7 @@ static int dpdk_stats_counters_dispatch(dpdk_helper_ctx_t *phc) { /* dispatch stats values to collectd */ - DEBUG("%s:%s:%d ports=%u", DPDK_STATS_PLUGIN, __FUNCTION__, __LINE__, + DEBUG("%s:%s:%d ports=%u", DPDK_STATS_PLUGIN, __func__, __LINE__, ctx->ports_count); int stats_count = 0; @@ -429,7 +429,7 @@ static int dpdk_stats_reinit_helper() { size_t data_size = sizeof(dpdk_stats_ctx_t) + (ctx->stats_count * DPDK_STATS_CTX_GET_XSTAT_SIZE); - DEBUG("%s:%d helper reinit (new_size=%" PRIsz ")", __FUNCTION__, __LINE__, + DEBUG("%s:%d helper reinit (new_size=%" PRIsz ")", __func__, __LINE__, data_size); dpdk_stats_ctx_t tmp_ctx;