[PATCH] trace-cmd: Implement warning() in the library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The warning() function is used in a lot of places in the trace-cmd
library, but there is no implementation. The function is implemented in
the trace-cmd application. Added a weak implementation in the library, in
case the function in not implemented in the application, using that
library.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
---
 Depends on "[v4] trace-cmd: Remove all die()s from trace-cmd library"
 https://patchwork.kernel.org/project/linux-trace-devel/patch/20210405092100.869572-1-tz.stoyanov@xxxxxxxxx/

 lib/trace-cmd/trace-util.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index db7bead6..0ee842e5 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -368,6 +368,16 @@ static int __vlib_warning(const char *fmt, va_list ap)
 	return ret;
 }
 
+void __weak warning(const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+	__vlib_warning(fmt, ap);
+	va_end(ap);
+}
+
+
 void __weak tracecmd_lib_fatal(const char *fmt, ...)
 {
 	int ret;
-- 
2.30.2




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux