g_message("Running test 9 : seek_forward and seek_backward");
lttv_process_traceset_seek_time(tsc, ltt_time_zero);
- count = lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL, NULL);
g_assert(count == 500);
lttv_traceset_context_position_save(tsc, saved_pos);
t0 = get_time();
- count = lttv_process_traceset_seek_n_forward(tsc, 150000, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 150000, NULL, NULL, NULL, NULL, NULL, NULL);
t1 = get_time();
g_message("Seek forward 150000 events in %g seconds", t1 - t0);
g_assert(count == 150000);
t0 = get_time();
count = lttv_process_traceset_seek_n_backward(tsc, 150000,
seek_back_default_offset, lttv_process_traceset_seek_time, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
t1 = get_time();
g_message("Seek backward 150000 events in %g seconds", t1 - t0);
g_assert(count == 150000);
g_warning("Problem with seek_n ! Positions differ. (1)");
}
- lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL);
+ lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL, NULL);
lttv_traceset_context_position_save(tsc, saved_pos);
- lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL);
+ lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL, NULL);
lttv_process_traceset_seek_n_backward(tsc, 15005,
seek_back_default_offset, lttv_process_traceset_seek_time, NULL,
- NULL, NULL, NULL, NULL);
- lttv_process_traceset_seek_n_forward(tsc, 5, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
+ lttv_process_traceset_seek_n_forward(tsc, 5, NULL, NULL, NULL, NULL, NULL, NULL);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) {
g_warning("Problem with seek_n ! Positions differ. (2)");
}
lttv_process_traceset_seek_time(tsc, ltt_time_infinite);
- count = lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL, NULL);
if(count > 0)
g_warning("Problem with seek_n ! Forward at end of traceset.");
t0 = get_time();
lttv_process_traceset_seek_n_backward(tsc, 300,
seek_back_default_offset, lttv_process_traceset_seek_time, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
t1 = get_time();
g_message("Seek backward 300 events in %g seconds", t1 - t0);
- count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL);
- count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL, NULL);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) {
g_warning("Problem with seek_n ! Positions differ. (4)");
t0 = get_time();
lttv_process_traceset_seek_n_backward(tsc, 10,
seek_back_default_offset, lttv_process_traceset_seek_time, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
t1 = get_time();
g_message("Seek backward 10 events in %g seconds", t1 - t0);
t0 = get_time();
- count = lttv_process_traceset_seek_n_forward(tsc, 10, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 10, NULL, NULL, NULL, NULL, NULL, NULL);
t1 = get_time();
g_message("Seek forward 10 events in %g seconds", t1 - t0);
lttv_traceset_context_position_save(tsc, saved_pos);
lttv_process_traceset_seek_n_backward(tsc, 301,
seek_back_default_offset, lttv_process_traceset_seek_time, NULL,
- NULL, NULL, NULL, NULL);
- count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL);
- count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL, NULL);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos) == 0) {
g_warning("Problem with seek_n ! Positions _should_ differ. (5)");
/* Try a seek by closest time : Hint : try this one with and without states
* computed. */
lttv_process_traceset_seek_time(tsc, ltt_time_zero);
- count = lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL, NULL);
lttv_traceset_context_position_save(tsc, saved_pos);
t0 = get_time();
lttv_process_traceset_seek_n_backward(tsc, 100301,
seek_back_default_offset,
(seek_time_fct)lttv_state_traceset_seek_time_closest, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
t1 = get_time();
g_message("Seek backward 100301 events (with seek closest) in %g seconds",
t1 - t0);
- count = lttv_process_traceset_seek_n_forward(tsc, 100301, NULL, NULL, NULL, NULL, NULL);
+ count = lttv_process_traceset_seek_n_forward(tsc, 100301, NULL, NULL, NULL, NULL, NULL, NULL);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) {
g_warning("Problem with seek_n with state seek time! Positions differ. (6)");
lttv_traceset_context_position_new(tsc);
lttv_process_traceset_seek_time(tsc, ltt_time_zero);
- lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL);
+ lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL, NULL);
lttv_traceset_context_position_save(tsc, saved_pos);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos) != 0)
g_critical("Error in seek position. (1)");
lttv_process_traceset_seek_time(tsc, ltt_time_infinite);
lttv_process_traceset_seek_n_backward(tsc, 500,
seek_back_default_offset, lttv_process_traceset_seek_time, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
lttv_traceset_context_position_save(tsc, saved_pos);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos) != 0)
event_viewer_data->last_tree_update_time = 0;
+ event_viewer_data->init_done = 0;
+
/* Create a model for storing the data list */
event_viewer_data->store_m = gtk_list_store_new (
N_COLUMNS, /* Total number of columns */
event_viewer_data->previous_value = 0;
event_viewer_data->vadjust_c->lower = 0.0;
//event_viewer_data->vadjust_c->upper = event_viewer_data->number_of_events;
+ LttTime time = lttvwindow_get_current_time(tab);
+ time = ltt_time_sub(time, tsc->time_span.start_time);
+ event_viewer_data->vadjust_c->value = ltt_time_to_double(time);
event_viewer_data->vadjust_c->value = 0.0;
event_viewer_data->vadjust_c->step_increment = 1.0;
event_viewer_data->vadjust_c->page_increment = 2.0;
event_viewer_data->background_info_waiting = 0;
+
request_background_data(event_viewer_data);
-
return event_viewer_data;
}
{
g_debug("tree sel changed cb");
EventViewerData *event_viewer_data = (EventViewerData*) data;
+
#if 0
/* Set the cursor to currently selected event */
GtkTreeModel* model = GTK_TREE_MODEL(event_viewer_data->store_m);
floor(exact_num_visible);
*/
- g_debug("size allocate : last_num_visible_events : %d,\
- num_visible_events : %d",
- last_num_visible_events,
- event_viewer_data->num_visible_events);
- if(event_viewer_data->num_visible_events != last_num_visible_events)
- {
+ g_debug("size allocate %p : last_num_visible_events : %d",
+ event_viewer_data, last_num_visible_events);
+ g_debug("num_visible_events : %d, value %lu",
+ event_viewer_data->num_visible_events,
+ event_viewer_data->vadjust_c->value);
+
+ if(event_viewer_data->num_visible_events != last_num_visible_events) {
get_events(event_viewer_data->vadjust_c->value, event_viewer_data);
- }
+ }
}
}
#endif //0
-static gboolean events_check_handler(guint count, gboolean *stop_flag)
+static gboolean events_check_handler(guint count, gboolean *stop_flag,
+ gpointer data)
{
+ EventViewerData *evd = (EventViewerData*)data;
if(count % CHECK_GDK_INTERVAL == 0) {
- gtk_main_iteration_do(FALSE);
+ GdkEvent *event;
+ GtkWidget *widget;
+ while((event = gdk_event_get()) != NULL) {
+ widget = gtk_get_event_widget(event);
+ if(widget ==
+ lookup_widget(main_window_get_widget(evd->tab),
+ "StopProcessingButton")) {
+ gtk_main_do_event(event);
+ gdk_window_process_all_updates();
+ }
+ gdk_event_free(event);
+ }
if(*stop_flag)
return TRUE;
else
events_check_handler,
&event_viewer_data->tab->stop_foreground,
event_viewer_data->main_win_filter,
- event_viewer_data->filter, NULL);
+ event_viewer_data->filter, NULL, event_viewer_data);
} else if(relative_position < 0) {
guint count;
events_check_handler,
&event_viewer_data->tab->stop_foreground,
event_viewer_data->main_win_filter,
- event_viewer_data->filter, NULL);
+ event_viewer_data->filter, NULL, event_viewer_data);
} /* else 0 : do nothing : we are already at the beginning position */
lttv_traceset_context_position_destroy(pos);
LttEvent *e = ltt_tracefile_get_event(tfc->tf);
if(event_viewer_data->num_events % CHECK_GDK_INTERVAL == 0) {
- gtk_main_iteration_do(FALSE);
+ GdkEvent *event;
+ GtkWidget *widget;
+ while((event = gdk_event_get()) != NULL) {
+ widget = gtk_get_event_widget(event);
+ if(widget ==
+ lookup_widget(main_window_get_widget(event_viewer_data->tab),
+ "StopProcessingButton")) {
+ gtk_main_do_event(event);
+ gdk_window_process_all_updates();
+ }
+ gdk_event_free(event);
+ }
+ //gtk_main_iteration_do(FALSE);
if(event_viewer_data->tab->stop_foreground)
return TRUE;
}