diff mbox series

libtracefs: Use tracefs_warning() for tracefs_sql() errors

Message ID 20220222232045.129e3b6c@rorschach.local.home (mailing list archive)
State Accepted
Commit 8fc17aa859c2aa5481409e0fa6099e24bf2b31ad
Headers show
Series libtracefs: Use tracefs_warning() for tracefs_sql() errors | expand

Commit Message

Steven Rostedt Feb. 23, 2022, 4:20 a.m. UTC
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 mbox series

Patch

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;
 	}