From ffd088ef1210d2beb43272f92cac85b7c6bfbae2 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 7 Sep 2005 19:19:59 +0000 Subject: [PATCH] filter by facility git-svn-id: http://ltt.polymtl.ca/svn@1143 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/filter.c | 15 ++++++++++++++- ltt/branches/poly/lttv/lttv/filter.h | 1 + .../poly/lttv/modules/gui/detailedevents/events.c | 3 +++ .../poly/lttv/modules/gui/filter/filter.c | 1 + ltt/branches/poly/lttv/modules/text/textFilter.c | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index a614909e..e8eec489 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -31,6 +31,7 @@ * LttvTracefileContext{} * |->event\ * | |->name (String, converted to GQuark) + * | |->facility (String, converted to GQuark) * | |->category (String, not yet implemented) * | |->time (LttTime) * | |->tsc (LttCycleCount --> uint64) @@ -207,6 +208,9 @@ 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 @@ -535,6 +539,7 @@ 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: @@ -1923,7 +1928,15 @@ lttv_filter_tree_parse_branch( 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); + return se->op((gpointer)&quark,v); + } + break; case LTTV_FILTER_EVENT_CATEGORY: /* * TODO: Not yet implemented diff --git a/ltt/branches/poly/lttv/lttv/filter.h b/ltt/branches/poly/lttv/lttv/filter.h index 29a74d9d..fcc2d78c 100644 --- a/ltt/branches/poly/lttv/lttv/filter.h +++ b/ltt/branches/poly/lttv/lttv/filter.h @@ -109,6 +109,7 @@ enum _LttvFieldType { LTTV_FILTER_STATE_P_STATUS, /**< state.process_status (LttvProcessStatus) */ LTTV_FILTER_STATE_CPU, /**< state.cpu (?last_cpu?) */ LTTV_FILTER_EVENT_NAME, /**< event.name (char*) */ + LTTV_FILTER_EVENT_FACILITY, /**< event.facility (char*) */ LTTV_FILTER_EVENT_CATEGORY, /**< FIXME: not implemented */ LTTV_FILTER_EVENT_TIME, /**< event.time (double) */ LTTV_FILTER_EVENT_TSC, /**< event.tsc (double) */ diff --git a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c index 66105228..3ae7bbd0 100644 --- a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c +++ b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c @@ -1374,6 +1374,7 @@ static void event_update_selection(EventViewerData *event_viewer_data) { guint i; GPtrArray *positions = event_viewer_data->pos; + g_info("event_update_selection"); for(i=0;ilen;i++) { LttvTracesetContextPosition *cur_pos = @@ -1391,6 +1392,7 @@ static void event_update_selection(EventViewerData *event_viewer_data) gboolean update_current_time(void * hook_data, void * call_data) { + g_info("update_current_time"); EventViewerData *event_viewer_data = (EventViewerData*) hook_data; const LttTime * current_time = (LttTime*)call_data; LttvTracesetContext * tsc = @@ -1432,6 +1434,7 @@ gboolean update_current_time(void * hook_data, void * call_data) gboolean update_current_position(void * hook_data, void * call_data) { + g_info("update_current_position"); EventViewerData *event_viewer_data = (EventViewerData*) hook_data; const LttvTracesetContextPosition *current_pos = (LttvTracesetContextPosition*)call_data; diff --git a/ltt/branches/poly/lttv/modules/gui/filter/filter.c b/ltt/branches/poly/lttv/modules/gui/filter/filter.c index fb67b72c..23ff43d7 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/filter.c +++ b/ltt/branches/poly/lttv/modules/gui/filter/filter.c @@ -182,6 +182,7 @@ gui_filter(Tab *tab) fvd->f_field_options = g_ptr_array_new(); //g_array_new(FALSE,FALSE,16); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.name")); + g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.facility")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.category")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.time")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.tsc")); diff --git a/ltt/branches/poly/lttv/modules/text/textFilter.c b/ltt/branches/poly/lttv/modules/text/textFilter.c index 88a5942b..7dcca632 100644 --- a/ltt/branches/poly/lttv/modules/text/textFilter.c +++ b/ltt/branches/poly/lttv/modules/text/textFilter.c @@ -134,6 +134,7 @@ void filter_list_commands(void *hook_data) { g_print("*** Possible fields ***\n"); g_print("event.name (string)\n"); + g_print("event.facility (string)\n"); g_print("event.category (string)\n"); g_print("event.time (double)\n"); g_print("event.tsc (integer)\n"); -- 2.34.1