From: compudj Date: Tue, 23 Aug 2005 02:12:39 +0000 (+0000) Subject: lttvwindow updated to do not share traces between tracesets X-Git-Tag: v0.12.20~2431 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=23bb9b6b5c24b17e7d96d5216fe7e5a8d7731d45;p=lttv.git lttvwindow updated to do not share traces between tracesets git-svn-id: http://ltt.polymtl.ca/svn@1058 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index 5ded4686..b126b85e 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -424,7 +424,7 @@ int SetTraceset(Tab * tab, LttvTraceset *traceset) current_time_change_manager(tab, new_current_time); //FIXME : we delete the filter tree, when it should be updated. - lttv_filter_tree_destroy(tab->filter); + lttv_filter_destroy(tab->filter); tab->filter = NULL; #if 0 @@ -939,7 +939,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab) } } } - +#if 0 /* 0.1 Lock Traces */ { guint iter_trace=0; @@ -958,7 +958,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab) /* 0.2 Seek tracefiles positions to context position */ lttv_process_traceset_synchronize_tracefiles(tsc); - +#endif //0 /* Events processing algorithm implementation */ /* Warning : the gtk_events_pending takes a LOT of cpu time. So what we do @@ -1590,7 +1590,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab) } - +#if 0 /* C Unlock Traces */ { //lttv_process_traceset_get_sync_data(tsc); @@ -1605,7 +1605,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab) lttvwindowtraces_unlock(trace_v); } } - +#endif //0 #if 0 //set the cursor back to normal gdk_window_set_cursor(win, NULL); @@ -1735,19 +1735,21 @@ void add_trace(GtkWidget * widget, gpointer user_data) break; } get_absolute_pathname(dir, abs_path); - trace_v = lttvwindowtraces_get_trace_by_name(abs_path); - if(trace_v == NULL) { + // Mathieu : modify to not share traces anymore : mmap uses so much less + // memory than a full buffer read... +// trace_v = lttvwindowtraces_get_trace_by_name(abs_path); +// if(trace_v == NULL) { trace = ltt_trace_open(abs_path); if(trace == NULL) { g_warning("cannot open trace %s", abs_path); } else { trace_v = lttv_trace_new(trace); - lttvwindowtraces_add_trace(trace_v); + //lttvwindowtraces_add_trace(trace_v); lttvwindow_add_trace(tab, trace_v); } - } else { - lttvwindow_add_trace(tab, trace_v); - } +// } else { +// lttvwindow_add_trace(tab, trace_v); +// } gtk_widget_destroy((GtkWidget*)file_selector); @@ -1841,15 +1843,15 @@ void remove_trace(GtkWidget *widget, gpointer user_data) lttv_traceset_remove(traceset, index); lttv_trace_unref(trace_v); // Remove local reference - if(lttv_trace_get_ref_number(trace_v) <= 1) { +// if(lttv_trace_get_ref_number(trace_v) <= 1) { /* ref 1 : lttvwindowtraces only*/ ltt_trace_close(lttv_trace(trace_v)); /* lttvwindowtraces_remove_trace takes care of destroying * the traceset linked with the trace_v and also of destroying * the trace_v at the same time. */ - lttvwindowtraces_remove_trace(trace_v); - } +// lttvwindowtraces_remove_trace(trace_v); +// } tab->traceset_info->traceset_context = g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); @@ -2259,6 +2261,8 @@ Tab *create_new_tab(GtkWidget* widget, gpointer user_data){ strcpy(label,"Page"); if(get_label(mw_data, label,"Get the name of the tab","Please input tab's name")) return (create_tab (mw_data, copy_tab, notebook, label)); + else + return NULL; } void @@ -3809,7 +3813,7 @@ char * get_selection(char ** loaded_module_name, int nb_module, } id = gtk_dialog_run(GTK_DIALOG(dialogue)); - GtkTreeModel **store_model = (GtkTreeModel**)&store; /* for strict aliasing */ + GtkTreeModel **store_model = (GtkTreeModel*)store; switch(id){ case GTK_RESPONSE_ACCEPT: case GTK_RESPONSE_OK: diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c index 31b57646..0bece47a 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c @@ -140,13 +140,13 @@ void lttvwindowtraces_add_trace(LttvTrace *trace) struct stat buf; gchar attribute_path[PATH_MAX]; - if(stat(ltt_trace_name(lttv_trace(trace)), &buf)) { + if(stat(g_quark_to_string(ltt_trace_name(lttv_trace(trace))), &buf)) { g_warning("lttvwindowtraces_add_trace: Trace %s not found", - ltt_trace_name(lttv_trace(trace))); + g_quark_to_string(ltt_trace_name(lttv_trace(trace)))); return; } g_assert( - snprintf(attribute_path, PATH_MAX, "%lu:%lu", buf.st_dev, buf.st_ino) >= 0); + snprintf(attribute_path, PATH_MAX, "%llu:%llu", buf.st_dev, buf.st_ino) >= 0); g_assert(attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), @@ -224,7 +224,7 @@ void lttvwindowtraces_remove_trace(LttvTrace *trace) /* Found */ LttvAttribute *l_attribute; - /* create new traceset and tracesetcontext */ + /* destroy traceset and tracesetcontext */ LttvTraceset *ts; LttvTracesetStats *tss; @@ -880,7 +880,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) /* There is no events requests pending : we should never have been called! */ g_assert(g_slist_length(*list_out) != 0 || g_slist_length(*list_in) != 0); - +#if 0 /* 0.1 Lock traces */ { guint iter_trace=0; @@ -897,7 +897,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) } /* 0.2 Sync tracefiles */ lttv_process_traceset_synchronize_tracefiles(tsc); - +#endif //0 /* 1. Before processing */ { /* if list_in is empty */ @@ -1214,6 +1214,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) } } } +#if 0 /* 4. Unlock traces */ { //lttv_process_traceset_get_sync_data(tsc); @@ -1227,6 +1228,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) lttvwindowtraces_unlock(trace_v); } } +#endif //0 return ret_val; }