X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Ffilter.c;h=f62755868f27f8958e4b13989556d2ef6effd5d1;hb=f86f37ff4f4aacacb543c45f8e1bac4dd5180c1f;hp=50e9fceadf0809c707786f07162ffd8ccf9c979f;hpb=33bdc8dd862c92f8b44f685304e6bf413932c244;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index 50e9fcea..f6275586 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -80,8 +80,6 @@ #include #include #include -#include -#include #include #include @@ -219,9 +217,6 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) { if(!g_strcasecmp(f->str,"name") ) { se->field = LTTV_FILTER_EVENT_NAME; } - else if(!g_strcasecmp(f->str,"facility") ) { - se->field = LTTV_FILTER_EVENT_FACILITY; - } else if(!g_strcasecmp(f->str,"category") ) { /* * FIXME: Category not yet functional in lttv @@ -288,7 +283,6 @@ lttv_simple_expression_assign_operator(LttvSimpleExpression* se, LttvExpressionO case LTTV_FILTER_STATE_P_NAME: case LTTV_FILTER_STATE_T_BRAND: case LTTV_FILTER_EVENT_NAME: - case LTTV_FILTER_EVENT_FACILITY: case LTTV_FILTER_STATE_EX_MODE: case LTTV_FILTER_STATE_EX_SUBMODE: case LTTV_FILTER_STATE_P_STATUS: @@ -451,7 +445,6 @@ lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) { case LTTV_FILTER_STATE_P_NAME: case LTTV_FILTER_STATE_T_BRAND: case LTTV_FILTER_EVENT_NAME: - case LTTV_FILTER_EVENT_FACILITY: case LTTV_FILTER_STATE_EX_MODE: case LTTV_FILTER_STATE_EX_SUBMODE: case LTTV_FILTER_STATE_P_STATUS: @@ -575,7 +568,6 @@ lttv_struct_type(gint ft) { return LTTV_FILTER_STATE; break; case LTTV_FILTER_EVENT_NAME: - case LTTV_FILTER_EVENT_FACILITY: case LTTV_FILTER_EVENT_CATEGORY: case LTTV_FILTER_EVENT_TIME: case LTTV_FILTER_EVENT_TSC: @@ -1833,7 +1825,9 @@ lttv_filter_tree_parse( const LttEvent* event, const LttTracefile* tracefile, const LttTrace* trace, - const LttvTracefileContext* context + const LttvTracefileContext* context, + const LttvProcessState* state, + const LttvTraceContext* tc /*,...*/) { @@ -1874,18 +1868,24 @@ lttv_filter_tree_parse( gboolean lresult = FALSE, rresult = FALSE; - LttvProcessState* state; - - LttvTraceState *ts = (LttvTraceState*)context->t_context; + LttvTraceState *ts; LttvTracefileState *tfs = (LttvTracefileState*)context; - guint cpu = tfs->cpu; - state = ts->running_process[cpu]; + if(tc) + ts = (LttvTraceState*)tc; + else if(context) + ts = (LttvTraceState*)context->t_context; + + if(tfs) { + guint cpu = tfs->cpu; + if(ts) + state = ts->running_process[cpu]; + } /* * Parse left branch */ if(t->left == LTTV_TREE_NODE) { - lresult = lttv_filter_tree_parse(t->l_child.t,event,tracefile,trace,context); + lresult = lttv_filter_tree_parse(t->l_child.t,event,tracefile,trace,context,NULL,NULL); } else if(t->left == LTTV_TREE_LEAF) { lresult = lttv_filter_tree_parse_branch(t->l_child.leaf,event,tracefile,trace,state,context); @@ -1902,7 +1902,7 @@ lttv_filter_tree_parse( * Parse right branch */ if(t->right == LTTV_TREE_NODE) { - rresult = lttv_filter_tree_parse(t->r_child.t,event,tracefile,trace,context); + rresult = lttv_filter_tree_parse(t->r_child.t,event,tracefile,trace,context,NULL,NULL); } else if(t->right == LTTV_TREE_LEAF) { rresult = lttv_filter_tree_parse_branch(t->r_child.leaf,event,tracefile,trace,state,context); @@ -1995,7 +1995,7 @@ lttv_filter_tree_parse_branch( return se->op((gpointer)&quark,v); } break; - case LTTV_FILTER_STATE_T_BRAND: + case LTTV_FILTER_STATE_T_BRAND: if(state == NULL) return TRUE; else { GQuark quark = state->brand; @@ -2015,27 +2015,18 @@ lttv_filter_tree_parse_branch( else return se->op((gpointer)&state->state->s,v); break; case LTTV_FILTER_STATE_CPU: - if(context == NULL) return TRUE; + if(state == NULL) return TRUE; else { - if(state == NULL) return TRUE; - else return se->op((gpointer)&state->cpu,v); + return se->op((gpointer)&state->cpu,v); } break; case LTTV_FILTER_EVENT_NAME: if(event == NULL) return TRUE; else { - LttEventType* et; - et = ltt_event_eventtype(event); - GQuark quark = ltt_eventtype_name(et); - return se->op((gpointer)&quark,v); - } - break; - case LTTV_FILTER_EVENT_FACILITY: - if(event == NULL) return TRUE; - else { - LttFacility* fac; - fac = ltt_event_facility(event); - GQuark quark = ltt_facility_name(fac); + struct marker_info *info; + info = marker_get_info_from_id((LttTrace *)trace, event->event_id); + g_assert(info != NULL); + GQuark quark = info->name; return se->op((gpointer)&quark,v); } break;