libtracefs: Have tracefs_sql() cast handle stacktrace
PATCH 1/1 libtracefs: Have tracefs_sql() cast handle stacktrace
From: "Steven Rostedt (Google)" <[email protected]>
A histogram can have a "stacktrace" type. Allow casts to make that:
# sqlhist select cast '('start.stack as stacktrace')' from sleep_lat as start
echo 'hist:keys=stack.stacktrace' > /sys/kernel/tracing/events/synthetic/sleep_lat/triggerSigned-off-by Steven Rostedt (Google) <[email protected]>
--- src/tracefs-sqlhist.c | 4 ++++ 1 file changed, 4 insertions(+)
src/tracefs-sqlhist.c +4 -0
@@ -1450,6 +1450,10 @@ static int verify_field_type(struct tep_handle *tep,if (tfield->flags & (TEP_FIELD_IS_STRING |TEP_FIELD_IS_ARRAY )) goto fail_type; ret =TRACEFS_HIST_KEY_BUCKETS ; + }else if (!strcmp (type,"stacktrace" )) { +if (!(tfield->flags & (TEP_FIELD_IS_ARRAY ))) + goto fail_type; + ret =TRACEFS_HIST_KEY_STACKTRACE ; }else { parse_error(sb, field->raw, "Cast of '%s' to unknown type '%s'\n",
Signature · 1 line
2.47.2