From 0a57a132e1c11ea9ccff572dbac4573fc0d5f026 Mon Sep 17 00:00:00 2001 From: Nichamon Naksinehaboon Date: Fri, 12 May 2023 10:35:23 -0500 Subject: [PATCH] Completely remove ldmsd log infrastructure --- ldms/src/ldmsd/ldmsd.c | 27 --------------------------- ldms/src/ldmsd/ldmsd.h | 31 ------------------------------- ldms/src/ldmsd/ldmsd_config.c | 2 +- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/ldms/src/ldmsd/ldmsd.c b/ldms/src/ldmsd/ldmsd.c index 5ac904410..a8eb9b70c 100644 --- a/ldms/src/ldmsd/ldmsd.c +++ b/ldms/src/ldmsd/ldmsd.c @@ -210,33 +210,6 @@ void ldmsd_version_get(struct ldmsd_version *v) v->flags = LDMSD_VERSION_FLAGS; } -void ldmsd_log(int level, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - (void) ovis_vlog(NULL, level, fmt, ap); - va_end(ap); -} - - -#ifndef LDMSD_LOG_AT -#define LDMSD_LOG_AT(l, fsuf) \ -void ldmsd_l##fsuf(const char *fmt, ...) \ -{ \ - va_list ap; \ - va_start(ap, fmt); \ - ovis_vlog(NULL, l, fmt, ap); \ - va_end(ap); \ -} -#endif /* LDMSD_LOG_AT */ - -LDMSD_LOG_AT(LDMSD_LDEBUG, debug); -LDMSD_LOG_AT(LDMSD_LINFO, info); -LDMSD_LOG_AT(LDMSD_LWARNING, warning); -LDMSD_LOG_AT(LDMSD_LERROR, error); -LDMSD_LOG_AT(LDMSD_LCRITICAL, critical); -LDMSD_LOG_AT(LDMSD_LALL, all); - void ldmsd_inc_cfg_cntr() { __atomic_fetch_add(&cfg_cntr, 1, __ATOMIC_SEQ_CST); diff --git a/ldms/src/ldmsd/ldmsd.h b/ldms/src/ldmsd/ldmsd.h index 9f8f01054..301b186f5 100644 --- a/ldms/src/ldmsd/ldmsd.h +++ b/ldms/src/ldmsd/ldmsd.h @@ -894,38 +894,7 @@ ldmsd_store_close(struct ldmsd_store *store, ldmsd_store_handle_t sh) store->close(sh); } -/* - * The #define ldmsd's log levels are defined here - * to transition the new LDMSD's plugin interfaces - * that do not receive a log function handle. - * - * The LDMSD log level macro will be removed when - * we completely remove the logic that passes - * around a log function handle. - */ -#define LDMSD_LDEBUG OVIS_LDEBUG -#define LDMSD_LINFO OVIS_LINFO -#define LDMSD_LWARNING OVIS_LWARN -#define LDMSD_LERROR OVIS_LERROR -#define LDMSD_LCRITICAL OVIS_LCRIT -#define LDMSD_LALL OVIS_LALWAYS - -__attribute__((format(printf, 1, 2))) -void ldmsd_ldebug(const char *fmt, ...); -__attribute__((format(printf, 1, 2))) -void ldmsd_linfo(const char *fmt, ...); -__attribute__((format(printf, 1, 2))) -void ldmsd_lwarning(const char *fmt, ...); -__attribute__((format(printf, 1, 2))) -void ldmsd_lerror(const char *fmt, ...); -__attribute__((format(printf, 1, 2))) -void ldmsd_lcritical(const char *fmt, ...); -__attribute__((format(printf, 1, 2))) -void ldmsd_lall(const char *fmt, ...); - - typedef struct ldmsd_plugin *(*ldmsd_plugin_get_f)(); -void ldmsd_log(int level, const char *fmt, ...); /* ldmsctl command callback function definition */ typedef int (*ldmsctl_cmd_fn_t)(char *, struct attr_value_list*, struct attr_value_list *); diff --git a/ldms/src/ldmsd/ldmsd_config.c b/ldms/src/ldmsd/ldmsd_config.c index 5510a9164..e64ff4cbf 100644 --- a/ldms/src/ldmsd/ldmsd_config.c +++ b/ldms/src/ldmsd/ldmsd_config.c @@ -162,7 +162,7 @@ struct ldmsd_plugin_cfg *new_plugin(char *plugin_name, "function.", plugin_name); goto err; } - lpi = pget(ldmsd_log); + lpi = pget(); if (!lpi) { snprintf(errstr, errlen, "The plugin '%s' could not be loaded.", plugin_name);