From 5e96e7e38fc3a40f0d9076c7ca8f369ad8c91d8c Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 17 May 2006 19:10:30 +0000 Subject: [PATCH] update for powerpc git-svn-id: http://ltt.polymtl.ca/svn@1824 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/configure.in | 2 +- ltt/branches/poly/lttv/lttv/state.c | 22 +++++++++++++++---- ltt/branches/poly/lttv/lttv/state.h | 3 ++- .../poly/lttv/modules/gui/controlflow/cfv.c | 1 + .../lttv/modules/gui/controlflow/drawing.c | 4 +++- .../lttv/modules/gui/controlflow/drawitem.c | 1 + .../modules/gui/controlflow/processlist.c | 2 ++ .../lttv/modules/gui/detailedevents/events.c | 4 ++++ .../gui/lttvwindow/lttvwindow/callbacks.c | 2 +- .../gui/lttvwindow/lttvwindow/callbacks.h | 2 +- .../gui/lttvwindow/lttvwindow/init_module.c | 1 + .../gui/lttvwindow/lttvwindow/lttvwindow.h | 2 ++ .../lttv/modules/gui/statistics/statistics.c | 20 ++++++++--------- .../modules/gui/tracecontrol/tracecontrol.c | 2 ++ 14 files changed, 49 insertions(+), 19 deletions(-) diff --git a/ltt/branches/poly/configure.in b/ltt/branches/poly/configure.in index fe7a6d61..02c656d5 100644 --- a/ltt/branches/poly/configure.in +++ b/ltt/branches/poly/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.41-12052006) +AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.42-17052006) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 05ea74f1..9201c818 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -826,8 +826,9 @@ free_max_time(LttvTraceState *tcs) typedef struct _LttvNameTables { // FIXME GQuark *eventtype_names; GQuark *syscall_names; - guint nb_syscalls; + guint nb_syscalls; GQuark *trap_names; + guint nb_traps; GQuark *irq_names; GQuark *soft_irq_names; } LttvNameTables; @@ -918,7 +919,7 @@ create_name_tables(LttvTraceState *tcs) ltt_enum_string_get(t, i)); } */ - + name_tables->nb_traps = 256; name_tables->trap_names = g_new(GQuark, 256); for(i = 0 ; i < 256 ; i++) { g_string_printf(fe_name, "trap %d", i); @@ -926,6 +927,7 @@ create_name_tables(LttvTraceState *tcs) } } else { name_tables->trap_names = NULL; + name_tables->nb_traps = 0; } if(!lttv_trace_find_hook(tcs->parent.t, @@ -988,6 +990,7 @@ get_name_tables(LttvTraceState *tcs) tcs->syscall_names = name_tables->syscall_names; tcs->nb_syscalls = name_tables->nb_syscalls; tcs->trap_names = name_tables->trap_names; + tcs->nb_traps = name_tables->nb_traps; tcs->irq_names = name_tables->irq_names; tcs->soft_irq_names = name_tables->soft_irq_names; } @@ -1359,8 +1362,19 @@ static gboolean trap_entry(void *hook_data, void *call_data) LttvExecutionSubmode submode; - submode = ((LttvTraceState *)(s->parent.t_context))->trap_names[ - ltt_event_get_unsigned(e, f)]; + guint nb_traps = ((LttvTraceState *)(s->parent.t_context))->nb_traps; + guint trap = ltt_event_get_unsigned(e, f); + + if(trap < nb_traps) { + submode = ((LttvTraceState *)(s->parent.t_context))->trap_names[trap]; + } else { + /* Fixup an incomplete trap table */ + GString *string = g_string_new(""); + g_string_printf(string, "trap %u", trap); + submode = g_quark_from_string(string->str); + g_string_free(string, TRUE); + } + push_state(s, LTTV_STATE_TRAP, submode); return FALSE; } diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index 3b9dda4a..62f8e3ab 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -279,8 +279,9 @@ struct _LttvTraceState { /* Block/char devices, locks, memory pages... */ GQuark *eventtype_names; GQuark *syscall_names; - guint nb_syscalls; + guint nb_syscalls; GQuark *trap_names; + guint nb_traps; GQuark *irq_names; GQuark *soft_irq_names; LttTime *max_time_state_recomputed_in_seek; diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c index ad1e5fb7..33bcdd2a 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "cfv.h" #include "drawing.h" diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 95f3887c..9aec7623 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -575,7 +575,8 @@ void drawing_request_expose(EventsRequest *events_request, LttvTracesetState *tss, LttTime end_time) { - gint x, x_end, width; + gint x, width; + guint x_end; ControlFlowData *cfd = events_request->viewer_data; LttvTracesetContext *tsc = (LttvTracesetContext*)tss; @@ -1454,4 +1455,5 @@ motion_notify_ruler(GtkWidget *widget, GdkEventMotion *event, gpointer user_data { //g_debug("motion"); //eventually follow mouse and show time here + return 0; } diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c index 7e1980e2..d97628b0 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c @@ -110,6 +110,7 @@ #include #include +#include "drawing.h" #include "drawitem.h" diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index cece72cb..3c9a5dad 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -160,6 +160,8 @@ gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer data) gtk_adjustment_set_value(control_flow_data->v_adjust, gtk_adjustment_get_value(control_flow_data->v_adjust) + cell_height); break; + default: + g_error("should only scroll up and down."); } return TRUE; } diff --git a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c index b2390468..0a7f8b8d 100644 --- a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c +++ b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -1040,6 +1041,8 @@ gboolean tree_v_scroll_handler (GtkWidget *widget, GdkEventScroll *event, gpoint gtk_adjustment_set_value(event_viewer_data->vadjust_c, gtk_adjustment_get_value(event_viewer_data->vadjust_c) + 1); break; + default: + g_error("Only scroll up and down expected"); } return TRUE; } @@ -1753,6 +1756,7 @@ gint redraw_notify(void *hook_data, void *call_data) EventViewerData *event_viewer_data = (EventViewerData*) hook_data; get_events(event_viewer_data->vadjust_c->value, event_viewer_data); + return 0; } void gui_events_free(EventViewerData *event_viewer_data) 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 e07f7f16..4f2a9639 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -4516,7 +4516,7 @@ gboolean execute_events_requests(Tab *tab) } -void create_main_window_with_trace(gchar *path) +void create_main_window_with_trace(const gchar *path) { if(path == NULL) return; diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h index e517472a..f38331aa 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h @@ -27,7 +27,7 @@ MainWindow *construct_main_window(MainWindow * parent); void main_window_free(MainWindow * mw); void main_window_destructor(MainWindow * mw); -void create_main_window_with_trace(gchar *path); +void create_main_window_with_trace(const gchar *path); void insert_viewer_wrap(GtkWidget *menuitem, gpointer user_data); gboolean execute_events_requests(Tab *tab); diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c index 1ca5cf04..8c3f9729 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h index a3867f02..ca0e203c 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h @@ -824,4 +824,6 @@ void events_request_free(EventsRequest *events_request); GtkWidget *main_window_get_widget(Tab *tab); +void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos); + #endif //LTTVWINDOW_H diff --git a/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c b/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c index d39b11d1..0e87e382 100644 --- a/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c +++ b/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c @@ -485,15 +485,15 @@ void show_tree(StatisticViewerData * statistic_viewer_data, case LTTV_GOBJECT: if(LTTV_IS_ATTRIBUTE(*(value.v_gobject))) { subtree = (LttvAttribute *)*(value.v_gobject); - if(is_named) - sprintf(dir_str, "%s", g_quark_to_string(name)); - else - sprintf(dir_str, "%lu", name); - gtk_tree_store_append (store, &iter, parent); - gtk_tree_store_set (store, &iter,NAME_COLUMN,dir_str,-1); - path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); - str = gtk_tree_path_to_string (path); - g_hash_table_insert(statistic_viewer_data->statistic_hash, + if(is_named) + sprintf(dir_str, "%s", g_quark_to_string(name)); + else + sprintf(dir_str, "%u", name); + gtk_tree_store_append (store, &iter, parent); + gtk_tree_store_set (store, &iter,NAME_COLUMN,dir_str,-1); + path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); + str = gtk_tree_path_to_string (path); + g_hash_table_insert(statistic_viewer_data->statistic_hash, (gpointer)str, subtree); show_tree(statistic_viewer_data, subtree, &iter); } @@ -522,7 +522,7 @@ void show_statistic(StatisticViewerData * statistic_viewer_data, if(is_named) sprintf(type_name,"%s", g_quark_to_string(name)); else - sprintf(type_name,"%lu", name); + sprintf(type_name,"%u", name); type_value[0] = '\0'; switch(type) { case LTTV_INT: diff --git a/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c b/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c index 148a452b..83826552 100644 --- a/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c +++ b/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c @@ -21,6 +21,7 @@ #endif #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include +#include #include "hTraceControlInsert.xpm" #include "TraceControlStart.xpm" -- 2.34.1