} else {
LttTime pos_time;
+ LttvTracefileContext *tfc =
+ lttv_traceset_context_get_current_tfc(tsc);
/* Else, the first request in list_in is a position request */
/* If first req in list_in pos != current pos */
g_assert(events_request->start_position != NULL);
events_request->start_position).tv_sec,
lttv_traceset_context_position_get_time(
events_request->start_position).tv_nsec);
-
- g_debug("SEEK POS context time : %lu, %lu",
- lttv_traceset_context_get_current_tfc(tsc)->timestamp.tv_sec,
- lttv_traceset_context_get_current_tfc(tsc)->timestamp.tv_nsec);
+
+ if(tfc) {
+ g_debug("SEEK POS context time : %lu, %lu",
+ tfc->timestamp.tv_sec,
+ tfc->timestamp.tv_nsec);
+ } else {
+ g_debug("SEEK POS context time : %lu, %lu",
+ ltt_time_infinite.tv_sec,
+ ltt_time_infinite.tv_nsec);
+ }
g_assert(events_request->start_position != NULL);
if(lttv_traceset_context_ctx_pos_compare(tsc,
events_request->start_position) != 0) {
trace = ltt_trace_open(abs_path);
if(trace == NULL) {
g_warning("cannot open trace %s", abs_path);
+
+ GtkWidget *dialogue =
+ gtk_message_dialog_new(
+ GTK_WINDOW(gtk_widget_get_toplevel(widget)),
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ "Cannot open trace : maybe you should enter in the trace "
+ "directory to select it ?");
+ gtk_dialog_run(GTK_DIALOG(dialogue));
+ gtk_widget_destroy(dialogue);
+
} else {
trace_v = lttv_trace_new(trace);
lttvwindowtraces_add_trace(trace_v);
new_time_window.end_time = ltt_time_add(new_time_window.start_time,
new_time_window.time_width) ;
/* If on borders, don't fall off */
- if(ltt_time_compare(new_time_window.start_time, time_span.start_time) <0)
+ if(ltt_time_compare(new_time_window.start_time, time_span.start_time) <0
+ || ltt_time_compare(new_time_window.start_time, time_span.end_time) >0)
{
new_time_window.start_time = time_span.start_time;
new_time_window.end_time = ltt_time_add(new_time_window.start_time,
else
{
if(ltt_time_compare(new_time_window.end_time,
- time_span.end_time) > 0)
+ time_span.end_time) > 0
+ || ltt_time_compare(new_time_window.end_time,
+ time_span.start_time) < 0)
{
new_time_window.start_time =
ltt_time_sub(time_span.end_time, new_time_window.time_width);
}
-void create_main_window_with_trace(gchar *path)
+void create_main_window_with_trace(const gchar *path)
{
if(path == NULL) return;