trace-cmd: quiet some output when using libtracecmd
PATCH 1/1 trace-cmd: quiet some output when using libtracecmd
If you link against libtracecmd you get a few extraneous warnings and printf's that aren't related to your tool. So by default make the path to the events you are tracing use pr_stat() so if it's not defined we don't get the output, and make the weak warning() do nothing by default. The trace-cmd stuff has this defined so it'll continue to work normally, it just won't be noisy for consumers of libtracecmd. Thanks,
--- parse-utils.c | 5 ----- trace-record.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-)
parse-utils.c +0 -5
@@ -63,11 +63,6 @@ void __warning(const char *fmt, ...)void __weak warning (const char *fmt, ...) { -va_list ap; - -va_start (ap, fmt); -__vwarning (fmt, ap); -va_end (ap); }void __vpr_stat (const char *fmt,va_list ap)
trace-record.c +1 -1
@@ -2120,7 +2120,7 @@ static int expand_event_files(struct buffer_instance *instance, path = globbuf.gl_pathv[i]; event =create_event (instance, path, old_event); -printf ("%s\n" , path); +pr_stat ("%s\n" , path); len =strlen (path);
Signature · 1 line
2.5.0
Steven Rostedt
AppliedQuoted 6 lines · On Fri, 4 Dec 2015 10:37:30 -0500 Josef Bacik <[email protected]> wrote:
If you link against libtracecmd you get a few extraneous warnings and printf's that aren't related to your tool. So by default make the path to the events you are tracing use
pr_stat()so if it's not defined we don't get the output, and make the weakwarning()do nothing by default. The trace-cmd stuff has this defined so it'll continue to work normally, it just won't be noisy for consumers of libtracecmd. Thanks,
I finally got around to look at these patches.
Applied!
-- Steve
Quoted 36 lines
Signed-off-by Josef Bacik <[email protected]>--- parse-utils.c | 5 ----- trace-record.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-)parse-utils.c +0
-5@@ -63,11 +63,6 @@ void __warning(const char *fmt, ...)void __weak warning (const char *fmt, ...) { -va_list ap; - -va_start (ap, fmt); -__vwarning (fmt, ap); -va_end (ap); }void __vpr_stat (const char *fmt,va_list ap)trace-record.c +1
-1@@ -2120,7 +2120,7 @@ static int expand_event_files(struct buffer_instance *instance, path = globbuf.gl_pathv[i]; event =create_event (instance, path, old_event); -printf ("%s\n" , path); +pr_stat ("%s\n" , path); len =strlen (path);