From: yangxx Date: Thu, 27 Nov 2003 20:29:35 +0000 (+0000) Subject: filter for selecting eventtype X-Git-Tag: v0.12.20~3150 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ed3b99b601fb95fea1f2c4e8718a0a94233929f2;p=lttv.git filter for selecting eventtype git-svn-id: http://ltt.polymtl.ca/svn@339 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/include/lttv/lttvfilter.h b/ltt/branches/poly/include/lttv/lttvfilter.h index b0d22bcb..c73882a2 100644 --- a/ltt/branches/poly/include/lttv/lttvfilter.h +++ b/ltt/branches/poly/include/lttv/lttvfilter.h @@ -7,33 +7,65 @@ typedef struct _LttvTracesetSelector LttvTracesetSelector; typedef struct _LttvTraceSelector LttvTraceSelector; typedef struct _LttvTracefileSelector LttvTracefileSelector; +typedef struct _LttvEventtypeSelector LttvEventtypeSelector; LttvTracesetSelector *lttv_traceset_selector_new(char * name); LttvTraceSelector *lttv_trace_selector_new(LttTrace *t); LttvTracefileSelector *lttv_tracefile_selector_new(LttTracefile *t); +LttvEventtypeSelector *lttv_eventtype_selector_new(LttEventType * et); void lttv_traceset_selector_destroy(LttvTracesetSelector *s); void lttv_trace_selector_destroy(LttvTraceSelector *t); void lttv_tracefile_selector_destroy(LttvTracefileSelector *t); +void lttv_eventtype_selector_destroy(LttvEventtypeSelector *t); -void lttv_traceset_selector_add(LttvTracesetSelector *s, LttvTraceSelector *t); -unsigned lttv_traceset_selector_number(LttvTracesetSelector *s); -LttvTraceSelector *lttv_traceset_selector_get(LttvTracesetSelector *s, unsigned i); -void lttv_traceset_selector_remove(LttvTracesetSelector *s, unsigned i); +void lttv_traceset_selector_trace_add(LttvTracesetSelector *s, + LttvTraceSelector *t); +unsigned lttv_traceset_selector_trace_number(LttvTracesetSelector *s); +LttvTraceSelector *lttv_traceset_selector_trace_get(LttvTracesetSelector *s, + unsigned i); +void lttv_traceset_selector_trace_remove(LttvTracesetSelector *s, + unsigned i); -void lttv_trace_selector_add(LttvTraceSelector *s, LttvTracefileSelector *t); -unsigned lttv_trace_selector_number(LttvTraceSelector *s); -LttvTracefileSelector *lttv_trace_selector_get(LttvTraceSelector *s, unsigned i); -void lttv_trace_selector_remove(LttvTraceSelector *s, unsigned i); +void lttv_trace_selector_tracefile_add(LttvTraceSelector *s, + LttvTracefileSelector *t); +unsigned lttv_trace_selector_tracefile_number(LttvTraceSelector *s); +LttvTracefileSelector *lttv_trace_selector_tracefile_get(LttvTraceSelector *s, + unsigned i); +void lttv_trace_selector_tracefile_remove(LttvTraceSelector *s, unsigned i); + +void lttv_trace_selector_eventtype_add(LttvTraceSelector *s, + LttvEventtypeSelector *et); +unsigned lttv_trace_selector_eventtype_number(LttvTraceSelector *s); +LttvEventtypeSelector *lttv_trace_selector_eventtype_get(LttvTraceSelector *s, + unsigned i); +void lttv_trace_selector_eventtype_remove(LttvTraceSelector *s, unsigned i); + + +void lttv_tracefile_selector_eventtype_add(LttvTracefileSelector *s, + LttvEventtypeSelector *et); +unsigned lttv_tracefile_selector_eventtype_number(LttvTracefileSelector *s); +LttvEventtypeSelector *lttv_tracefile_selector_eventtype_get(LttvTracefileSelector *s, + unsigned i); +void lttv_tracefile_selector_eventtype_remove(LttvTracefileSelector *s, unsigned i); + void lttv_trace_selector_set_selected(LttvTraceSelector *s, gboolean g); void lttv_tracefile_selector_set_selected(LttvTracefileSelector *s, gboolean g); +void lttv_eventtype_selector_set_selected(LttvEventtypeSelector *s, gboolean g); gboolean lttv_trace_selector_get_selected(LttvTraceSelector *s); gboolean lttv_tracefile_selector_get_selected(LttvTracefileSelector *s); +gboolean lttv_eventtype_selector_get_selected(LttvEventtypeSelector *s); +char * lttv_traceset_selector_get_name(LttvTracesetSelector *s); char * lttv_trace_selector_get_name(LttvTraceSelector *s); char * lttv_tracefile_selector_get_name(LttvTracefileSelector *s); +char * lttv_eventtype_selector_get_name(LttvEventtypeSelector *s); + +LttvEventtypeSelector * lttv_eventtype_selector_clone(LttvEventtypeSelector * s); +void lttv_eventtype_selector_copy(LttvTraceSelector *s, LttvTracefileSelector *d); + #endif // LTTV_FILTER_H diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c index 9a62b515..cce4dc42 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c @@ -17,6 +17,7 @@ #include #include #include +#include #define PATH_LENGTH 256 #define DEFAULT_TIME_WIDTH_S 1 @@ -70,10 +71,14 @@ LttvTracesetSelector * construct_traceset_selector(LttvTraceset * traceset) LttvTracesetSelector * s; LttvTraceSelector * trace; LttvTracefileSelector * tracefile; - int i, j, nb_trace, nb_tracefile, nb_control, nb_per_cpu; + LttvEventtypeSelector * eventtype; + int i, j, k, m; + int nb_trace, nb_tracefile, nb_control, nb_per_cpu, nb_facility, nb_event; LttvTrace * trace_v; LttTrace * t; LttTracefile *tf; + LttFacility * fac; + LttEventType * et; s = lttv_traceset_selector_new(lttv_traceset_name(traceset)); nb_trace = lttv_traceset_number(traceset); @@ -81,7 +86,19 @@ LttvTracesetSelector * construct_traceset_selector(LttvTraceset * traceset) trace_v = lttv_traceset_get(traceset, i); t = lttv_trace(trace_v); trace = lttv_trace_selector_new(t); - lttv_traceset_selector_add(s, trace); + lttv_traceset_selector_trace_add(s, trace); + + nb_facility = ltt_trace_facility_number(t); + for(k=0;kcurrent_tab->multi_vpaned); s = g_object_get_data(G_OBJECT(w), "Traceset_Selector"); - t = lttv_traceset_selector_get(s,i); + t = lttv_traceset_selector_trace_get(s,i); lttv_trace_selector_set_selected(t, FALSE); //check if other viewers select the trace w = gtk_multi_vpaned_get_first_widget(mw_data->current_tab->multi_vpaned); while(w){ s = g_object_get_data(G_OBJECT(w), "Traceset_Selector"); - t = lttv_traceset_selector_get(s,i); + t = lttv_traceset_selector_trace_get(s,i); selected = lttv_trace_selector_get_selected(t); if(selected)break; w = gtk_multi_vpaned_get_next_widget(mw_data->current_tab->multi_vpaned); @@ -1110,24 +1144,56 @@ void checkbox_changed(GtkTreeView *treeview, void update_filter(LttvTracesetSelector *s, GtkTreeStore *store ) { - GtkTreeIter iter, child_iter; - int i, j; + GtkTreeIter iter, child_iter, child_iter1, child_iter2; + int i, j, k, nb_eventtype; LttvTraceSelector * trace; LttvTracefileSelector * tracefile; - gboolean value, value1; + LttvEventtypeSelector * eventtype; + gboolean value, value1, value2; if(gtk_tree_model_get_iter_first((GtkTreeModel*)store, &iter)){ i = 0; do{ - trace = lttv_traceset_selector_get(s, i); + trace = lttv_traceset_selector_trace_get(s, i); + nb_eventtype = lttv_trace_selector_eventtype_number(trace); gtk_tree_model_get ((GtkTreeModel*)store, &iter, CHECKBOX_COLUMN, &value,-1); if(value){ j = 0; if(gtk_tree_model_iter_children ((GtkTreeModel*)store, &child_iter, &iter)){ do{ - tracefile = lttv_trace_selector_get(trace, j); - gtk_tree_model_get ((GtkTreeModel*)store, &child_iter, CHECKBOX_COLUMN, &value1,-1); - lttv_tracefile_selector_set_selected(tracefile,value1); + if(j<1){//eventtype selector for trace + gtk_tree_model_get ((GtkTreeModel*)store, &child_iter, CHECKBOX_COLUMN, &value2,-1); + if(value2){ + k=0; + if(gtk_tree_model_iter_children ((GtkTreeModel*)store, &child_iter1, &child_iter)){ + do{ + eventtype = lttv_trace_selector_eventtype_get(trace,k); + gtk_tree_model_get ((GtkTreeModel*)store, &child_iter1, CHECKBOX_COLUMN, &value2,-1); + lttv_eventtype_selector_set_selected(eventtype,value2); + k++; + }while(gtk_tree_model_iter_next((GtkTreeModel*)store, &child_iter1)); + } + } + }else{ //tracefile selector + tracefile = lttv_trace_selector_tracefile_get(trace, j - 1); + gtk_tree_model_get ((GtkTreeModel*)store, &child_iter, CHECKBOX_COLUMN, &value1,-1); + lttv_tracefile_selector_set_selected(tracefile,value1); + if(value1){ + gtk_tree_model_iter_children((GtkTreeModel*)store, &child_iter1, &child_iter); //eventtype selector + gtk_tree_model_get ((GtkTreeModel*)store, &child_iter1, CHECKBOX_COLUMN, &value2,-1); + if(value2){ + k = 0; + if(gtk_tree_model_iter_children ((GtkTreeModel*)store, &child_iter2, &child_iter1)){ + do{//eventtype selector for tracefile + eventtype = lttv_tracefile_selector_eventtype_get(tracefile,k); + gtk_tree_model_get ((GtkTreeModel*)store, &child_iter2, CHECKBOX_COLUMN, &value2,-1); + lttv_eventtype_selector_set_selected(eventtype,value2); + k++; + }while(gtk_tree_model_iter_next((GtkTreeModel*)store, &child_iter2)); + } + } + } + } j++; }while(gtk_tree_model_iter_next((GtkTreeModel*)store, &child_iter)); } @@ -1146,10 +1212,11 @@ gboolean get_filter_selection(LttvTracesetSelector *s,char *title, char * column GtkWidget * scroll_win; GtkCellRenderer * renderer; GtkTreeViewColumn * column; - GtkTreeIter iter, child_iter; - int i, j, id, nb_trace, nb_tracefile; + GtkTreeIter iter, child_iter, child_iter1, child_iter2; + int i, j, k, id, nb_trace, nb_tracefile, nb_eventtype; LttvTraceSelector * trace; LttvTracefileSelector * tracefile; + LttvEventtypeSelector * eventtype; char * name; gboolean checked; @@ -1159,7 +1226,7 @@ gboolean get_filter_selection(LttvTracesetSelector *s,char *title, char * column GTK_STOCK_OK,GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL,GTK_RESPONSE_REJECT, NULL); - gtk_window_set_default_size((GtkWindow*)dialogue, 300, 100); + gtk_window_set_default_size((GtkWindow*)dialogue, 300, 500); store = gtk_tree_store_new (TOTAL_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING); tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); @@ -1201,9 +1268,9 @@ gboolean get_filter_selection(LttvTracesetSelector *s,char *title, char * column gtk_widget_show(scroll_win); gtk_widget_show(tree); - nb_trace = lttv_traceset_selector_number(s); + nb_trace = lttv_traceset_selector_trace_number(s); for(i=0;i #include #include +#include struct _LttvTracesetSelector { char * traceset_name; - GPtrArray *traces; + GPtrArray * traces; }; struct _LttvTraceSelector { char * trace_name; GPtrArray * tracefiles; + GPtrArray * eventtypes; gboolean selected; }; struct _LttvTracefileSelector { char * tracefile_name; + GPtrArray * eventtypes; + gboolean selected; +}; + +struct _LttvEventtypeSelector { + char * eventtype_name; gboolean selected; }; @@ -41,6 +49,7 @@ LttvTraceSelector *lttv_trace_selector_new(LttTrace *t) trace = g_new(LttvTraceSelector, 1); trace->trace_name = g_strdup(ltt_trace_name(t)); trace->tracefiles = g_ptr_array_new(); + trace->eventtypes = g_ptr_array_new(); trace->selected = TRUE; return trace; } @@ -51,10 +60,19 @@ LttvTracefileSelector *lttv_tracefile_selector_new(LttTracefile *t) tracefile = g_new(LttvTracefileSelector, 1); tracefile->tracefile_name = g_strdup(ltt_tracefile_name(t)); + tracefile->eventtypes = g_ptr_array_new(); tracefile->selected = TRUE; return tracefile; } +LttvEventtypeSelector *lttv_eventtype_selector_new(LttEventType * et) +{ + LttvEventtypeSelector * ev; + ev = g_new(LttvEventtypeSelector, 1); + ev->eventtype_name = g_strdup(ltt_eventtype_name(et)); + ev->selected = TRUE; + return ev; +} void lttv_traceset_selector_destroy(LttvTracesetSelector *s) { @@ -74,66 +92,135 @@ void lttv_trace_selector_destroy(LttvTraceSelector *s) { int i; LttvTracefileSelector * t; + LttvEventtypeSelector * e; for(i=0;itracefiles->len;i++){ t = (LttvTracefileSelector*)s->tracefiles->pdata[i]; lttv_tracefile_selector_destroy(t); } + for(i=0;ieventtypes->len;i++){ + e = (LttvEventtypeSelector*)s->eventtypes->pdata[i]; + lttv_eventtype_selector_destroy(e); + } if(s->trace_name) g_free(s->trace_name); g_free(s); } void lttv_tracefile_selector_destroy(LttvTracefileSelector *t) { + int i; + LttvEventtypeSelector * e; + + for(i=0;ieventtypes->len;i++){ + e = (LttvEventtypeSelector*)t->eventtypes->pdata[i]; + lttv_eventtype_selector_destroy(e); + } + if(t->tracefile_name) g_free(t->tracefile_name); g_free(t); } -void lttv_traceset_selector_add(LttvTracesetSelector *s, LttvTraceSelector *t) +void lttv_eventtype_selector_destroy(LttvEventtypeSelector *e) +{ + if(e->eventtype_name) g_free(e->eventtype_name); + free(e); +} + +void lttv_traceset_selector_trace_add(LttvTracesetSelector *s, + LttvTraceSelector *t) { g_ptr_array_add(s->traces, t); } -void lttv_trace_selector_add(LttvTraceSelector *s, LttvTracefileSelector *t) +void lttv_trace_selector_tracefile_add(LttvTraceSelector *s, + LttvTracefileSelector *t) { g_ptr_array_add(s->tracefiles, t); } +void lttv_trace_selector_eventtype_add(LttvTraceSelector *s, + LttvEventtypeSelector *et) +{ + g_ptr_array_add(s->eventtypes, et); +} + +void lttv_tracefile_selector_eventtype_add(LttvTracefileSelector *s, + LttvEventtypeSelector *et) +{ + g_ptr_array_add(s->eventtypes, et); +} -unsigned lttv_traceset_selector_number(LttvTracesetSelector *s) +unsigned lttv_traceset_selector_trace_number(LttvTracesetSelector *s) { return s->traces->len; } -unsigned lttv_trace_selector_number(LttvTraceSelector *s) +unsigned lttv_trace_selector_tracefile_number(LttvTraceSelector *s) { return s->tracefiles->len; } -LttvTraceSelector *lttv_traceset_selector_get(LttvTracesetSelector *s, unsigned i) +unsigned lttv_trace_selector_eventtype_number(LttvTraceSelector *s) +{ + return s->eventtypes->len; +} + +unsigned lttv_tracefile_selector_eventtype_number(LttvTracefileSelector *s) +{ + return s->eventtypes->len; +} + +LttvTraceSelector *lttv_traceset_selector_trace_get(LttvTracesetSelector *s, + unsigned i) { g_assert(s->traces->len > i); return ((LttvTraceSelector *)s->traces->pdata[i]); } -LttvTracefileSelector *lttv_trace_selector_get(LttvTraceSelector *s, unsigned i) +LttvTracefileSelector *lttv_trace_selector_tracefile_get(LttvTraceSelector *s, + unsigned i) { g_assert(s->tracefiles->len > i); return ((LttvTracefileSelector *)s->tracefiles->pdata[i]); } -void lttv_traceset_selector_remove(LttvTracesetSelector *s, unsigned i) +LttvEventtypeSelector *lttv_trace_selector_eventtype_get(LttvTraceSelector *s, + unsigned i) +{ + g_assert(s->eventtypes->len > i); + return ((LttvEventtypeSelector *)s->eventtypes->pdata[i]); +} + +LttvEventtypeSelector *lttv_tracefile_selector_eventtype_get(LttvTracefileSelector *s, + unsigned i) +{ + g_assert(s->eventtypes->len > i); + return ((LttvEventtypeSelector *)s->eventtypes->pdata[i]); +} + +void lttv_traceset_selector_trace_remove(LttvTracesetSelector *s, unsigned i) { g_assert(s->traces->len > i); g_ptr_array_remove_index(s->traces, i); } -void lttv_trace_selector_remove(LttvTraceSelector *s, unsigned i) +void lttv_trace_selector_tracefile_remove(LttvTraceSelector *s, unsigned i) { g_assert(s->tracefiles->len > i); g_ptr_array_remove_index(s->tracefiles, i); } +void lttv_trace_selector_eventtype_remove(LttvTraceSelector *s, unsigned i) +{ + g_assert(s->eventtypes->len > i); + g_ptr_array_remove_index(s->eventtypes, i); +} + +void lttv_tracefile_selector_eventtype_remove(LttvTracefileSelector *s, unsigned i) +{ + g_assert(s->eventtypes->len > i); + g_ptr_array_remove_index(s->eventtypes, i); +} void lttv_trace_selector_set_selected(LttvTraceSelector *s, gboolean g) { @@ -145,6 +232,11 @@ void lttv_tracefile_selector_set_selected(LttvTracefileSelector *s, gboolean g) s->selected = g; } +void lttv_eventtype_selector_set_selected(LttvEventtypeSelector *s, gboolean g) +{ + s->selected = g; +} + gboolean lttv_trace_selector_get_selected(LttvTraceSelector *s) { return s->selected; @@ -155,6 +247,16 @@ gboolean lttv_tracefile_selector_get_selected(LttvTracefileSelector *s) return s->selected; } +gboolean lttv_eventtype_selector_get_selected(LttvEventtypeSelector *s) +{ + return s->selected; +} + +char * lttv_traceset_selector_get_name(LttvTracesetSelector *s) +{ + return s->traceset_name; +} + char * lttv_trace_selector_get_name(LttvTraceSelector *s) { return s->trace_name; @@ -164,3 +266,29 @@ char * lttv_tracefile_selector_get_name(LttvTracefileSelector *s) { return s->tracefile_name; } + +char * lttv_eventtype_selector_get_name(LttvEventtypeSelector *s) +{ + return s->eventtype_name; +} + +LttvEventtypeSelector * lttv_eventtype_selector_clone(LttvEventtypeSelector * s) +{ + LttvEventtypeSelector * ev = g_new(LttvEventtypeSelector, 1); + ev->eventtype_name = g_strdup(s->eventtype_name); + ev->selected = s->selected; + return ev; +} + +void lttv_eventtype_selector_copy(LttvTraceSelector * s, LttvTracefileSelector * d) +{ + int i, len; + LttvEventtypeSelector * ev, *ev1; + + len = s->eventtypes->len; + for(i=0;i #include #include +#include #include //#include "mw_api.h" @@ -931,12 +932,16 @@ void get_test_data(double time_value, guint list_height, end.tv_sec = G_MAXULONG; end.tv_nsec = G_MAXULONG; get_events(event_viewer_data, start, end, RESERVE_SMALL_SIZE, &size); + if(size == 0){ + get_events(event_viewer_data, start, end, G_MAXULONG, &size); + } }else size = 1; if(size > 0) event_number = event_viewer_data->start_event_index + 1; else event_number = event_viewer_data->start_event_index; break; case SCROLL_PAGE_DOWN: - if(event_viewer_data->end_event_index >= event_viewer_data->number_of_events - 1 - list_height){ + i = event_viewer_data->number_of_events - 1 - list_height; + if((gint)(event_viewer_data->end_event_index) >= i){ event_viewer_data->append = TRUE; first = event_viewer_data->raw_trace_data_queue->head; if(!first)break; @@ -946,6 +951,9 @@ void get_test_data(double time_value, guint list_height, end.tv_sec = G_MAXULONG; end.tv_nsec = G_MAXULONG; get_events(event_viewer_data, start, end, RESERVE_SMALL_SIZE,&size); + if(size == 0){ + get_events(event_viewer_data, start, end, G_MAXULONG,&size); + } } if(list_height <= event_viewer_data->number_of_events - 1 - event_viewer_data->end_event_index) event_number = event_viewer_data->start_event_index + list_height - 1; @@ -961,7 +969,7 @@ void get_test_data(double time_value, guint list_height, start = ltt_time_add(event_viewer_data->time_span.startTime, time); event_viewer_data->previous_value = time_value; get_events(event_viewer_data, start, end, RESERVE_SMALL_SIZE,&size); - if(size < list_height){ + if(size < list_height && size > 0){ event_viewer_data->append = FALSE; first = event_viewer_data->raw_trace_data_queue->head; if(!first)break; @@ -983,6 +991,9 @@ void get_test_data(double time_value, guint list_height, event_viewer_data->start_event_index = event_viewer_data->current_event_index; } event_number = event_viewer_data->raw_trace_data_queue->length - list_height; + }else if(size == 0){ + get_events(event_viewer_data, start, end, RESERVE_SMALL_SIZE*RESERVE_SMALL_SIZE,&size); + event_number = 0; }else{ event_number = 0; } @@ -1001,6 +1012,7 @@ void get_test_data(double time_value, guint list_height, first = event_viewer_data->raw_trace_data_queue->head; if(first){ raw_data = (RawTraceData*)g_list_nth_data(first,event_number); + if(!raw_data) raw_data = (RawTraceData*)g_list_nth_data(first,0); time = ltt_time_sub(raw_data->time, event_viewer_data->time_span.startTime); event_viewer_data->vadjust_c->value = ltt_time_to_double(time) * NANOSECONDS_PER_SECOND; g_signal_stop_emission_by_name(G_OBJECT(event_viewer_data->vadjust_c), "value-changed"); @@ -1011,6 +1023,9 @@ void get_test_data(double time_value, guint list_height, event_viewer_data->start_event_index = event_number; event_viewer_data->end_event_index = event_number + list_height - 1; + if(event_viewer_data->end_event_index > event_viewer_data->number_of_events - 1){ + event_viewer_data->end_event_index = event_viewer_data->number_of_events - 1; + } first = event_viewer_data->raw_trace_data_queue->head; gtk_list_store_clear(event_viewer_data->store_m); @@ -1218,11 +1233,14 @@ int event_selected_hook(void *hook_data, void *call_data) } - +/* If every module uses the filter, maybe these two + * (add/remove_context_hooks functions) should be put in common place + */ void add_context_hooks(EventViewerData * event_viewer_data, LttvTracesetContext * tsc) { - gint i, j, nbi, nb_tracefile, nb_control, nb_per_cpu; + gint i, j, k, m,n, nbi, id; + gint nb_tracefile, nb_control, nb_per_cpu, nb_facility, nb_event; LttTrace *trace; LttvTraceContext *tc; LttvTracefileContext *tfc; @@ -1230,6 +1248,9 @@ void add_context_hooks(EventViewerData * event_viewer_data, LttvTraceSelector * t_s; LttvTracefileSelector * tf_s; gboolean selected; + LttFacility * fac; + LttEventType * et; + LttvEventtypeSelector * eventtype; ts_s = (LttvTracesetSelector*)g_object_get_data(G_OBJECT(event_viewer_data->hbox_v), event_viewer_data->filter_key); @@ -1238,7 +1259,7 @@ void add_context_hooks(EventViewerData * event_viewer_data, nbi = lttv_traceset_number(tsc->ts); for(i = 0 ; i < nbi ; i++) { - t_s = lttv_traceset_selector_get(ts_s,i); + t_s = lttv_traceset_selector_trace_get(ts_s,i); selected = lttv_trace_selector_get_selected(t_s); if(!selected) continue; tc = tsc->traces[i]; @@ -1250,7 +1271,7 @@ void add_context_hooks(EventViewerData * event_viewer_data, nb_tracefile = nb_control + nb_per_cpu; for(j = 0 ; j < nb_tracefile ; j++) { - tf_s = lttv_trace_selector_get(t_s,j); + tf_s = lttv_trace_selector_tracefile_get(t_s,j); selected = lttv_tracefile_selector_get_selected(tf_s); if(!selected) continue; @@ -1260,8 +1281,28 @@ void add_context_hooks(EventViewerData * event_viewer_data, tfc = tc->per_cpu_tracefiles[j - nb_control]; //if there are hooks for tracefile, add them here - lttv_tracefile_context_add_hooks(tfc, NULL,NULL,NULL,NULL, - event_viewer_data->before_event_hooks,NULL); + // lttv_tracefile_context_add_hooks(tfc, NULL,NULL,NULL,NULL, + // event_viewer_data->before_event_hooks,NULL); + + nb_facility = ltt_trace_facility_number(trace); + n = 0; + for(k=0;kbefore_event_hooks, + NULL); + } + n++; + } + } + } } @@ -1274,7 +1315,8 @@ void add_context_hooks(EventViewerData * event_viewer_data, void remove_context_hooks(EventViewerData * event_viewer_data, LttvTracesetContext * tsc) { - gint i, j, nbi, nb_tracefile, nb_control, nb_per_cpu; + gint i, j, k, m, nbi, n, id; + gint nb_tracefile, nb_control, nb_per_cpu, nb_facility, nb_event; LttTrace *trace; LttvTraceContext *tc; LttvTracefileContext *tfc; @@ -1282,6 +1324,9 @@ void remove_context_hooks(EventViewerData * event_viewer_data, LttvTraceSelector * t_s; LttvTracefileSelector * tf_s; gboolean selected; + LttFacility * fac; + LttEventType * et; + LttvEventtypeSelector * eventtype; ts_s = (LttvTracesetSelector*)g_object_get_data(G_OBJECT(event_viewer_data->hbox_v), event_viewer_data->filter_key); @@ -1290,7 +1335,7 @@ void remove_context_hooks(EventViewerData * event_viewer_data, nbi = lttv_traceset_number(tsc->ts); for(i = 0 ; i < nbi ; i++) { - t_s = lttv_traceset_selector_get(ts_s,i); + t_s = lttv_traceset_selector_trace_get(ts_s,i); selected = lttv_trace_selector_get_selected(t_s); if(!selected) continue; tc = tsc->traces[i]; @@ -1302,7 +1347,7 @@ void remove_context_hooks(EventViewerData * event_viewer_data, nb_tracefile = nb_control + nb_per_cpu; for(j = 0 ; j < nb_tracefile ; j++) { - tf_s = lttv_trace_selector_get(t_s,j); + tf_s = lttv_trace_selector_tracefile_get(t_s,j); selected = lttv_tracefile_selector_get_selected(tf_s); if(!selected) continue; @@ -1312,8 +1357,25 @@ void remove_context_hooks(EventViewerData * event_viewer_data, tfc = tc->per_cpu_tracefiles[j - nb_control]; //if there are hooks for tracefile, remove them here - lttv_tracefile_context_remove_hooks(tfc, NULL,NULL,NULL,NULL, - event_viewer_data->before_event_hooks,NULL); + // lttv_tracefile_context_remove_hooks(tfc, NULL,NULL,NULL,NULL, + // event_viewer_data->before_event_hooks,NULL); + + nb_facility = ltt_trace_facility_number(trace); + n = 0; + for(k=0;kts); for(i = 0 ; i < nbi ; i++) { - t_s = lttv_traceset_selector_get(ts_s,i); + t_s = lttv_traceset_selector_trace_get(ts_s,i); selected = lttv_trace_selector_get_selected(t_s); if(!selected) continue; tc = tsc->traces[i]; @@ -565,7 +565,7 @@ void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, nb_tracefile = nb_control + nb_per_cpu; for(j = 0 ; j < nb_tracefile ; j++) { - tf_s = lttv_trace_selector_get(t_s,j); + tf_s = lttv_trace_selector_tracefile_get(t_s,j); selected = lttv_tracefile_selector_get_selected(tf_s); if(!selected) continue; @@ -605,7 +605,7 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, nbi = lttv_traceset_number(tsc->ts); for(i = 0 ; i < nbi ; i++) { - t_s = lttv_traceset_selector_get(ts_s,i); + t_s = lttv_traceset_selector_trace_get(ts_s,i); selected = lttv_trace_selector_get_selected(t_s); if(!selected) continue; tc = tsc->traces[i]; @@ -617,7 +617,7 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, nb_tracefile = nb_control + nb_per_cpu; for(j = 0 ; j < nb_tracefile ; j++) { - tf_s = lttv_trace_selector_get(t_s,j); + tf_s = lttv_trace_selector_tracefile_get(t_s,j); selected = lttv_tracefile_selector_get_selected(tf_s); if(!selected) continue;