From: compudj Date: Thu, 11 Oct 2007 17:25:54 +0000 (+0000) Subject: fix marker id off by one X-Git-Tag: v0.12.20~832 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c7146c5c1e676a169708c76bc29534067b951fb5;p=lttv.git fix marker id off by one git-svn-id: http://ltt.polymtl.ca/svn@2657 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/ltt/marker.c b/ltt/branches/poly/ltt/marker.c index 0ff55f45..f344be05 100644 --- a/ltt/branches/poly/ltt/marker.c +++ b/ltt/branches/poly/ltt/marker.c @@ -428,7 +428,7 @@ int marker_id_event(LttTrace *trace, GQuark name, guint16 id, struct marker_info *info, *head; int found = 0; - if (trace->markers->len < id) + if (trace->markers->len <= id) trace->markers = g_array_set_size(trace->markers, id+1); info = &g_array_index(trace->markers, struct marker_info, id); info->name = name; diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 59575e7a..e3887375 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -1104,6 +1104,8 @@ int ltt_process_facility_tracefile(LttTracefile *tf) //pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->alignment); pos += ltt_align((size_t)pos, sizeof(uint16_t), tf->alignment); id = ltt_get_uint16(LTT_GET_BO(tf), pos); + g_debug("In MARKER_ID_SET_MARKER_ID of marker %s id %hu", + marker_name, id); pos += sizeof(guint16); int_size = *(guint8*)pos; pos += sizeof(guint8); diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 06d22007..4d5afc30 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -21,6 +21,7 @@ #include #endif +#include #include #include #include