+ if(event_viewer_data->append == TRUE) {
+ /* append data */
+ lttv_process_traceset_middle(tsc, end, max_num_events, NULL);
+ } else{
+ guint count;
+ LttvTracefileContext *tfc;
+ /* prepend data */
+ do {
+ /* clear the temp list */
+ while(g_queue_pop_head(event_viewer_data->event_fields_queue_tmp));
+ /* read max_num events max */
+ count = lttv_process_traceset_middle(tsc, end, max_num_events, NULL);
+ /* loop if reached the max number of events to read, but not
+ * if end of trace or end time reached.*/
+ tfc = lttv_traceset_context_get_current_tfc(tsc);
+ } while(max_num_events == count
+ && (tfc != NULL && ltt_time_compare(tfc->timestamp, end) < 0));