From: compudj Date: Tue, 14 Mar 2006 15:11:58 +0000 (+0000) Subject: update tracecontrol X-Git-Tag: v0.12.20~1782 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c56a714eafb51f1e956c7109413811ebe79f8fa9;p=lttv.git update tracecontrol git-svn-id: http://ltt.polymtl.ca/svn@1707 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index 567b54f0..4025e4da 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -36,11 +36,12 @@ * | |->time (LttTime) * | |->tsc (LttCycleCount --> uint64) * | |->fields - * | |->"event name" - * | |->"field name" - * | |->"sub-field name" - * | |->... - * | |->"leaf-field name" (field type) + * | |->"facility_name + * | |->"event name" + * | |->"field name" + * | |->"sub-field name" + * | |->... + * | |->"leaf-field name" (field type) * |->tracefile * | |->name (String, converted to GQuark) * |->trace @@ -204,6 +205,7 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) { * event.category * event.time * event.tsc + * event.field */ g_string_free(f,TRUE); f=g_ptr_array_remove_index(fp,0); @@ -225,8 +227,11 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) { else if(!g_strcasecmp(f->str,"tsc") ) { se->field = LTTV_FILTER_EVENT_TSC; } - else { /* core.xml specified options */ + else if(!g_strcasecmp(f->str,"field") ) { se->field = LTTV_FILTER_EVENT_FIELD; + + } else { + g_warning("Unknown event filter subtype %s", f->str); } } else { g_string_free(f,TRUE); @@ -433,7 +438,7 @@ lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) { case LTTV_FILTER_STATE_EX_SUBMODE: case LTTV_FILTER_STATE_P_STATUS: // se->value.v_string = value; - se->value.v_uint32 = g_quark_from_string(value); + se->value.v_quark = g_quark_from_string(value); g_free(value); break; /* @@ -657,8 +662,7 @@ gboolean lttv_apply_op_eq_string(const gpointer v1, LttvFieldValue v2) { */ gboolean lttv_apply_op_eq_quark(const gpointer v1, LttvFieldValue v2) { GQuark* r = (GQuark*) v1; -// g_print("v1:%i v2:%i\n",*r,v2.v_uint32); - return (*r == v2.v_uint32); + return (*r == v2.v_quark); } /** @@ -770,7 +774,7 @@ gboolean lttv_apply_op_ne_string(const gpointer v1, LttvFieldValue v2) { */ gboolean lttv_apply_op_ne_quark(const gpointer v1, LttvFieldValue v2) { GQuark* r = (GQuark*) v1; - return (*r != v2.v_uint32); + return (*r != v2.v_quark); } @@ -1952,9 +1956,6 @@ lttv_filter_tree_parse_branch( case LTTV_FILTER_STATE_CPU: if(context == NULL) return TRUE; else { - /* FIXME: not sure of that one Mathieu : fixed.*/ - // GQuark quark = ((LttvTracefileState*)context)->cpu_name; - // return se->op((gpointer)&quark,v); if(state == NULL) return TRUE; else return se->op((gpointer)&state->cpu,v); } diff --git a/ltt/branches/poly/lttv/lttv/filter.h b/ltt/branches/poly/lttv/lttv/filter.h index fcc2d78c..d93a1551 100644 --- a/ltt/branches/poly/lttv/lttv/filter.h +++ b/ltt/branches/poly/lttv/lttv/filter.h @@ -113,7 +113,7 @@ enum _LttvFieldType { LTTV_FILTER_EVENT_CATEGORY, /**< FIXME: not implemented */ LTTV_FILTER_EVENT_TIME, /**< event.time (double) */ LTTV_FILTER_EVENT_TSC, /**< event.tsc (double) */ - LTTV_FILTER_EVENT_FIELD, /**< dynamic field, specified in core.xml */ + LTTV_FILTER_EVENT_FIELD, /**< dynamic field, specified in facility */ LTTV_FILTER_UNDEFINED /**< undefined field */ }; @@ -147,6 +147,7 @@ enum _LttvExpressionOp * 'operators' functions */ union _LttvFieldValue { + GQuark v_quark; /**< GQuark */ guint64 v_uint64; /**< unsigned int of 64 bytes */ guint32 v_uint32; /**< unsigned int of 32 bytes */ guint16 v_uint16; /**< unsigned int of 16 bytes */ diff --git a/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c b/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c index e3f1ff85..148a452b 100644 --- a/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c +++ b/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c @@ -342,7 +342,7 @@ gui_control(Tab *tab) tcd->fac_path_label = gtk_label_new("path to facilities:"); gtk_widget_show (tcd->fac_path_label); tcd->fac_path_entry = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(tcd->fac_path_entry),PACKAGE_DATA_DIR "/" PACKAGE "/facilities"); + gtk_entry_set_text(GTK_ENTRY(tcd->fac_path_entry),PACKAGE_DATA_DIR "/" "ltt-control" "/facilities"); gtk_widget_set_size_request(tcd->fac_path_entry, 250, -1); gtk_widget_show (tcd->fac_path_entry); gtk_table_attach( GTK_TABLE(tcd->main_box),tcd->fac_path_label,0,2,14,15,GTK_FILL,GTK_FILL,2,2); diff --git a/ltt/branches/poly/lttv/modules/text/textFilter.c b/ltt/branches/poly/lttv/modules/text/textFilter.c index 7dcca632..41e478d2 100644 --- a/ltt/branches/poly/lttv/modules/text/textFilter.c +++ b/ltt/branches/poly/lttv/modules/text/textFilter.c @@ -47,11 +47,6 @@ /* Insert the hooks before and after each trace and tracefile, and for each event. Print a global header. */ -/* - * YET TO BE ANSWERED ! - * - why does this module need dependency with batchAnalysis ? - */ - /* * TODO * - specify wich hook function will be used to call the core filter @@ -138,6 +133,7 @@ void filter_list_commands(void *hook_data) { g_print("event.category (string)\n"); g_print("event.time (double)\n"); g_print("event.tsc (integer)\n"); + g_print("event.field.facility_name.event_name.field_name.subfield_name (field_type)\n"); g_print("tracefile.name (string)\n"); g_print("trace.name (string)\n"); g_print("state.pid (integer)\n");