* [PATCH v2] libtraceevent: Add back log functions for backward compatibility
@ 2021-05-13 1:56 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-05-13 1:56 UTC (permalink / raw)
To: linux-trace-devel
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
The following functions are obsolete and were removed:
tep_vwarning()
pr_stat()
vpr_stat()
__pr_stat()
__vpr_stat()
But unfortunately they were part of a library release. Add them back as
all weak functions and label them deprecated.
Link: https://lore.kernel.org/linux-trace-devel/20210428073001.755905-1-tz.stoyanov@gmail.com/
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Changes since v1:
Ported to the new version of "Add API to set severity to tracefs library logs"
src/event-utils.h | 7 +++++++
src/parse-utils.c | 16 ++++++++++++++++
2 files changed, 23 insertions(+)
Index: libtraceevent.git/src/event-utils.h
===================================================================
--- libtraceevent.git.orig/src/event-utils.h
+++ libtraceevent.git/src/event-utils.h
@@ -15,6 +15,13 @@ void tep_info(const char *fmt, ...);
int tep_vprint(const char *name, enum tep_loglevel level,
bool print_err, const char *fmt, va_list ap);
+/* For backward compatibilty, do not use */
+int tep_vwarning(const char *name, const char *fmt, va_list ap);
+void pr_stat(const char *fmt, ...);
+void vpr_stat(const char *fmt, va_list ap);
+void __pr_stat(const char *fmt, ...);
+void __vpr_stat(const char *fmt, va_list ap);
+
#define min(x, y) ({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
Index: libtraceevent.git/src/parse-utils.c
===================================================================
--- libtraceevent.git.orig/src/parse-utils.c
+++ libtraceevent.git/src/parse-utils.c
@@ -79,3 +79,19 @@ void tep_info(const char *fmt, ...)
tep_vprint("libtraceevent", TEP_LOG_INFO, false, fmt, ap);
va_end(ap);
}
+
+/* The below is for backward compatibility */
+int __weak tep_vwarning(const char *name, const char *fmt, va_list ap)
+{
+ return tep_vprint(name, TEP_LOG_WARNING, true, fmt, ap);
+}
+
+void pr_stat(const char *fmt, ...) __attribute__((weak, alias("tep_info")));
+void __pr_stat(const char *fmt, ...) __attribute__((weak, alias("tep_info")));
+
+void __weak __vpr_stat(const char *fmt, va_list ap)
+{
+ tep_vprint("libtraceevent", TEP_LOG_INFO, false, fmt, ap);
+}
+
+void vpr_stat(const char *fmt, va_list ap) __attribute__((weak, alias("__vpr_stat")));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-13 1:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 1:56 [PATCH v2] libtraceevent: Add back log functions for backward compatibility Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).