* | |->name (String, converted to GQuark)
* | |->category (String, not yet implemented)
* | |->time (LttTime)
- * | |->tsc (LttCycleCount)
+ * | |->tsc (LttCycleCount --> uint64)
* | |->fields
* | |->"event name"
* | |->"field name"
*/
/*
- * TODO
+ * \todo
* - refine switch of expression in multiple uses functions
- * - remove the idle expressions in the tree ****
+ * - remove the idle expressions in the tree
*/
#include <lttv/filter.h>
case LTTV_FILTER_TRACEFILE_NAME:
case LTTV_FILTER_STATE_P_NAME:
case LTTV_FILTER_EVENT_NAME:
+ case LTTV_FILTER_STATE_CPU:
switch(op) {
case LTTV_FIELD_EQ:
se->op = lttv_apply_op_eq_quark;
case LTTV_FILTER_STATE_EX_MODE:
case LTTV_FILTER_STATE_EX_SUBMODE:
case LTTV_FILTER_STATE_P_STATUS:
+ case LTTV_FILTER_EVENT_TSC:
switch(op) {
case LTTV_FIELD_EQ:
se->op = lttv_apply_op_eq_uint64;
case LTTV_FILTER_STATE_CT:
case LTTV_FILTER_STATE_IT:
case LTTV_FILTER_EVENT_TIME:
- case LTTV_FILTER_EVENT_TSC:
switch(op) {
case LTTV_FIELD_EQ:
se->op = lttv_apply_op_eq_ltttime;
case LTTV_FILTER_TRACEFILE_NAME:
case LTTV_FILTER_STATE_P_NAME:
case LTTV_FILTER_EVENT_NAME:
+ case LTTV_FILTER_STATE_CPU:
// se->value.v_string = value;
- se->value.v_uint32 = g_quark_to_string(value);
+ se->value.v_uint32 = g_quark_from_string(value);
g_free(value);
break;
/*
case LTTV_FILTER_STATE_EX_MODE:
case LTTV_FILTER_STATE_EX_SUBMODE:
case LTTV_FILTER_STATE_P_STATUS:
+ case LTTV_FILTER_EVENT_TSC:
se->value.v_uint64 = atoi(value);
g_free(value);
break;
case LTTV_FILTER_STATE_CT:
case LTTV_FILTER_STATE_IT:
case LTTV_FILTER_EVENT_TIME:
- case LTTV_FILTER_EVENT_TSC:
//se->value.v_double = atof(value);
/*
* parsing logic could be optimised,
*/
gboolean lttv_apply_op_eq_ltttime(const gpointer v1, LttvFieldValue v2) {
LttTime* r = (LttTime*) v1;
-// return ((r->tv_sec == v2.v_ltttime.tv_sec) && (r->tv_nsec == v2.v_ltttime.tv_nsec));
return ltt_time_compare(*r, v2.v_ltttime)==0?1:0;
}
case LTTV_FILTER_TRACE_NAME:
if(trace == NULL) return TRUE;
else {
- GQuark quark = g_quark_to_string(ltt_trace_name(trace));
+ char* trace_name = ltt_trace_name(trace);
+ GQuark quark = g_quark_from_string(trace_name);
return se->op((gpointer)&quark,v);
}
break;
case LTTV_FILTER_TRACEFILE_NAME:
if(tracefile == NULL) return TRUE;
else {
- GQuark quark = g_quark_to_string(ltt_tracefile_name(tracefile));
+ char* tracefile_name = ltt_tracefile_name(tracefile);
+ GQuark quark = g_quark_from_string(tracefile_name);
return se->op((gpointer)&quark,v);
}
break;
*/
if(state == NULL) return TRUE;
else {
- GQuark quark = g_quark_to_string(state->name);
+ GQuark quark = state->name;
return se->op((gpointer)&quark,v);
}
break;
case LTTV_FILTER_STATE_CPU:
if(context == NULL) return TRUE;
else {
- /* FIXME: not sure of that one */
- return se->op((gpointer)g_quark_to_string(((LttvTracefileState*)context)->cpu_name),v);
+ /* FIXME: not sure of that one */
+ GQuark quark = ((LttvTracefileState*)context)->cpu_name;
+ return se->op((gpointer)&quark,v);
}
break;
case LTTV_FILTER_EVENT_NAME:
else {
LttEventType* et;
et = ltt_event_eventtype(event);
- g_print("v:%s\n",ltt_eventtype_name(et));
- GQuark quark = g_quark_to_string(ltt_eventtype_name(et));
+ char* event_name = ltt_eventtype_name(et);
+ GQuark quark = g_quark_from_string(event_name);
return se->op((gpointer)&quark,v);
}
break;
}
break;
case LTTV_FILTER_EVENT_TSC:
-// if(event == NULL) return TRUE;
-// else {
-// double val = ltt_time_to_double(event->event_time);
-// return se->op((gpointer)&val,v);
-// }
- /*
- * FIXME: Where is event.tsc
- */
- return TRUE;
+ if(event == NULL) return TRUE;
+ else {
+ LttCycleCount count = ltt_event_cycle_count(event);
+ return se->op((gpointer)&count,v);
+ }
break;
case LTTV_FILTER_EVENT_FIELD:
/*