From: compudj Date: Thu, 11 Oct 2007 03:17:11 +0000 (+0000) Subject: debug ltt X-Git-Tag: v0.12.20~841 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=03dab2c12579a972e206610262ea870dd37e1a5a;p=lttv.git debug ltt git-svn-id: http://ltt.polymtl.ca/svn@2648 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/ltt/marker.c b/ltt/branches/poly/ltt/marker.c index 7583e62b..f1053d8c 100644 --- a/ltt/branches/poly/ltt/marker.c +++ b/ltt/branches/poly/ltt/marker.c @@ -395,6 +395,7 @@ int marker_format_event(LttTrace *trace, GQuark name, const char *format) g_error("Error parsing marker format \"%s\" for marker \"%s\"", format, g_quark_to_string(name)); } + return 0; } int marker_id_event(LttTrace *trace, GQuark name, guint16 id, @@ -402,6 +403,7 @@ int marker_id_event(LttTrace *trace, GQuark name, guint16 id, uint8_t size_t_size, uint8_t alignment) { struct marker_info *info, *head; + int found = 0; if (trace->markers->len < id) trace->markers = g_array_set_size(trace->markers, id+1); @@ -417,9 +419,16 @@ int marker_id_event(LttTrace *trace, GQuark name, guint16 id, if (!head) g_hash_table_insert(trace->markers_hash, (gpointer)name, info); else { - g_hash_table_replace(trace->markers_hash, (gpointer)name, info); - info->next = head; + struct marker_info *iter; + for (iter = head; iter != NULL; iter = iter->next) + if (iter->name == name) + found = 1; + if (!found) { + g_hash_table_replace(trace->markers_hash, (gpointer)name, info); + info->next = head; + } } + return 0; } int allocate_marker_data(LttTrace *trace)