X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Ftracecontext.c;h=e4f89a72067e4eb3696df9f85ec39be8bf38373b;hb=b9ce0bad7daf7c0a2333c91fdb1e35d602afe17f;hp=596e06f007901418939c6289952aaa4c34164143;hpb=f826ad80ef4be944bdda493bf0ce8b7706d4131c;p=lttv.git diff --git a/lttv/lttv/tracecontext.c b/lttv/lttv/tracecontext.c index 596e06f0..e4f89a72 100644 --- a/lttv/lttv/tracecontext.c +++ b/lttv/lttv/tracecontext.c @@ -12,8 +12,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -22,10 +22,12 @@ #include #include -#include +#include #include #include +#ifdef BABEL_NOFILTER #include +#endif #include #include #include @@ -36,6 +38,8 @@ #include #include + +#ifdef BABEL_CLEANUP gint compare_tracefile(gconstpointer a, gconstpointer b) { gint comparison = 0; @@ -71,7 +75,7 @@ struct _LttvTracesetContextPosition { * set, else, a position is set (may be end * of trace, with ep->len == 0) */ }; - +#endif void lttv_context_init(LttvTracesetContext *self, LttvTraceset *ts) { LTTV_TRACESET_CONTEXT_GET_CLASS(self)->init(self, ts); @@ -238,7 +242,9 @@ init(LttvTracesetContext *self, LttvTraceset *ts) } self->sync_position = lttv_traceset_context_position_new(self); +#ifdef BABEL_CLEANUP self->pqueue = g_tree_new(compare_tracefile); +#endif lttv_process_traceset_seek_time(self, ltt_time_zero); lttv_traceset_context_compute_time_span(self, &self->time_span); @@ -687,13 +693,14 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, unsigned count = 0; + gint last_ret = 0; struct bt_ctf_event *bt_event; LttvEvent event; while(TRUE) { - if((count >= nb_events) && (nb_events != G_MAXULONG)) { + if(last_ret == TRUE || ((count >= nb_events) && (nb_events != G_MAXULONG))) { break; } @@ -706,7 +713,7 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, to retrieve the right state container */ event.state = self->tmpState; - lttv_hooks_call(self->event_hooks, &event); + last_ret = lttv_hooks_call(self->event_hooks, &event); if(bt_iter_next(bt_ctf_get_iter(self->iter)) < 0) { printf("ERROR NEXT\n");