lkml.org 
[lkml]   [2021]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 12/21] libtracefs; Add error message for bad selections to SQL sequence
Date
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

If the building of the synthetic event fails on creating the selection,
report it properly.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
src/tracefs-sqlhist.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/tracefs-sqlhist.c b/src/tracefs-sqlhist.c
index d39851845570..e542eb95c17f 100644
--- a/src/tracefs-sqlhist.c
+++ b/src/tracefs-sqlhist.c
@@ -971,6 +971,16 @@ static void *synth_init_error(struct tep_handle *tep, struct sql_table *table)
return field_match_error(tep, sb, match);
}

+static void selection_error(struct tep_handle *tep,
+ struct sqlhist_bison *sb, struct expr *expr)
+{
+ /* We just care about event not existing */
+ if (errno != ENODEV)
+ return;
+
+ test_field_exists(tep, sb, expr);
+}
+
static struct tracefs_synth *build_synth(struct tep_handle *tep,
const char *name,
struct sql_table *table)
@@ -1051,8 +1061,10 @@ static struct tracefs_synth *build_synth(struct tep_handle *tep,
ret = tracefs_synth_add_end_field(synth,
field->field, field->label);
}
- if (ret < 0)
+ if (ret < 0) {
+ selection_error(tep, table->sb, expr);
goto free;
+ }
continue;
}

--
2.30.2
\
 
 \ /
  Last update: 2021-08-03 06:25    [W:0.135 / U:1.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site