Skip to content

Commit

Permalink
Completely remove ldmsd log infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
nichamon authored and tom95858 committed Jul 19, 2023
1 parent 30f8a7b commit 0a57a13
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 59 deletions.
27 changes: 0 additions & 27 deletions ldms/src/ldmsd/ldmsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
31 changes: 0 additions & 31 deletions ldms/src/ldmsd/ldmsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down
2 changes: 1 addition & 1 deletion ldms/src/ldmsd/ldmsd_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0a57a13

Please sign in to comment.