#include <lttv/lttv.h>
#include <lttv/filter.h>
#include <ltt/trace.h>
-#include <ltt/type.h>
-#include <ltt/facility.h>
#include <stdlib.h>
#include <string.h>
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
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:
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:
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:
const LttEvent* event,
const LttTracefile* tracefile,
const LttTrace* trace,
- const LttvTracefileContext* context
+ const LttvTracefileContext* context,
+ const LttvProcessState* state,
+ const LttvTraceContext* tc
/*,...*/)
{
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);
* 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);
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;
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;