libtracefs: Use tracefs_warning() for tracefs_sql() errors
PATCH 1/1 libtracefs: Use tracefs_warning() for tracefs_sql() errors
From: "Steven Rostedt (Google)" <[email protected]>
Instead of hard coding fprintf() into the library, use tracefs_warning() to allow the application control the output.
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/tracefs-sqlhist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/tracefs-sqlhist.c +2 -2
@@ -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 ; }
Signature · 1 line
2.34.1