@@ -12,6 +12,7 @@
/* Can be overridden */
void tracecmd_warning(const char *fmt, ...);
void tracecmd_fatal(const char *fmt, ...);
+void tracecmd_info(const char *fmt, ...);
/* trace.dat file format version */
#define FILE_VERSION 6
@@ -3280,7 +3280,7 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd, int flags)
version = read_string(handle);
if (!version)
goto failed_read;
- pr_stat("version = %s\n", version);
+ tracecmd_info("version = %s\n", version);
free(version);
if (do_read_check(handle, buf, 1))
@@ -140,7 +140,7 @@ load_plugin(struct trace_plugin_context *trace, const char *path,
list->name = plugin;
*plugin_list = list;
- pr_stat("registering plugin: %s", plugin);
+ tracecmd_info("registering plugin: %s", plugin);
func(trace);
return;
@@ -364,6 +364,16 @@ void __weak tracecmd_warning(const char *fmt, ...)
va_end(ap);
}
+void tracecmd_info(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ tep_vprint("libtracecmd", TEP_LOG_INFO, fmt, ap);
+ va_end(ap);
+}
+
+
void __weak tracecmd_fatal(const char *fmt, ...)
{
int ret;
@@ -44,17 +44,6 @@ static void py_supress_trace_output(void)
skip_output = 1;
}
-void pr_stat(const char *fmt, ...)
-{
- va_list ap;
-
- if (skip_output)
- return;
- va_start(ap, fmt);
- __vpr_stat(fmt, ap);
- va_end(ap);
-}
-
void warning(const char *fmt, ...)
{
va_list ap;
@@ -35,20 +35,6 @@ void warning(const char *fmt, ...)
fprintf(stderr, "\n");
}
-void pr_stat(const char *fmt, ...)
-{
- va_list ap;
-
- if (!show_status)
- return;
-
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
-
- printf("\n");
-}
-
void *malloc_or_die(unsigned int size)
{
void *data;
@@ -2934,6 +2934,20 @@ static void test_event(struct event_list *event, const char *path,
*save = event;
}
+static void pr_stat(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (!show_status)
+ return;
+
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ va_end(ap);
+
+ printf("\n");
+}
+
static int expand_event_files(struct buffer_instance *instance,
const char *file, struct event_list *old_event)
The pr_stat() function is removed from the traceevent library. This function was used by trace-cmd to print statistics. Introduce tracecmd_info() log function and replace pr_stat() with it in the trace-cmd library. However, pr_stat() is used also in the trace-cmd application. In order no to change the existing behaviour, add a static pr_stat() implementation for that usage. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- lib/trace-cmd/include/trace-cmd-local.h | 1 + lib/trace-cmd/trace-input.c | 2 +- lib/trace-cmd/trace-plugin.c | 2 +- lib/trace-cmd/trace-util.c | 10 ++++++++++ python/ctracecmd.i | 11 ----------- tracecmd/trace-cmd.c | 14 -------------- tracecmd/trace-record.c | 14 ++++++++++++++ 7 files changed, 27 insertions(+), 27 deletions(-)