linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] libtraceevent: Add back log functions for backward compatibility
Date: Tue, 4 May 2021 16:31:55 -0400	[thread overview]
Message-ID: <20210504163156.2bfdd63d@gandalf.local.home> (raw)

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>
---
 src/event-utils.h |  7 +++++++
 src/parse-utils.c | 16 ++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/src/event-utils.h b/src/event-utils.h
index 0e09838..c13665f 100644
--- a/src/event-utils.h
+++ b/src/event-utils.h
@@ -14,6 +14,13 @@ void tep_info(const char *fmt, ...);
 /* Can be overridden */
 int tep_vprint(const char *name, enum tep_loglevel level, 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);			\
diff --git a/src/parse-utils.c b/src/parse-utils.c
index b4e95b7..1a9bdfa 100644
--- a/src/parse-utils.c
+++ b/src/parse-utils.c
@@ -62,3 +62,19 @@ void tep_info(const char *fmt, ...)
 	tep_vprint("libtraceevent", TEP_LOG_INFO, 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, 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, fmt, ap);
+}
+
+void vpr_stat(const char *fmt, va_list ap) __attribute__((weak, alias("__vpr_stat")));
-- 
2.29.2


                 reply	other threads:[~2021-05-04 20:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210504163156.2bfdd63d@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).