linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Use tracefs_warning() for tracefs_sql() errors
@ 2022-02-23  4:20 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2022-02-23  4:20 UTC (permalink / raw)
  To: Linux Trace Devel

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Instead of hard coding fprintf() into the library, use tracefs_warning()
to allow the application control the output.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/tracefs-sqlhist.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tracefs-sqlhist.c b/src/tracefs-sqlhist.c
index 016f3eb23725..ac4903c4d346 100644
--- a/src/tracefs-sqlhist.c
+++ b/src/tracefs-sqlhist.c
@@ -134,7 +134,7 @@ __hidden void sql_parse_error(struct sqlhist_bison *sb, const char *text,
 
 	trace_seq_init(&s);
 	if (!s.buffer) {
-		fprintf(stderr, "Error allocating internal buffer\n");
+		tracefs_warning("Error allocating internal buffer\n");
 		return;
 	}
 
@@ -1097,7 +1097,7 @@ static int build_filter(struct tep_handle *tep, struct sqlhist_bison *sb,
 	case FILTER_BIN_AND:	cmp = TRACEFS_COMPARE_AND; break;
 	case FILTER_STR_CMP:	cmp = TRACEFS_COMPARE_RE; break;
 	default:
-		fprintf(stderr, "Error invalid filter type '%d'", filter->type);
+		tracefs_warning("Error invalid filter type '%d'", filter->type);
 		return ERANGE;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-23  4:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-23  4:20 [PATCH] libtracefs: Use tracefs_warning() for tracefs_sql() errors 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).