create directories branches, tags, trunk
[lttv.git] / ltt / branches / poly / ltt / marker.h
index fc1343567837de76837e08482051ff3e25c549f1..3d04db8870b142e5fe9e9ac2bfccb796845869e9 100644 (file)
@@ -52,7 +52,7 @@ static inline guint16 marker_get_id_from_info(LttTrace *trace,
 static inline struct marker_info *marker_get_info_from_id(LttTrace *trace,
     guint16 id)
 {
-  if (unlikely(trace->markers->len < id))
+  if (unlikely(trace->markers->len <= id))
     return NULL;
   return &g_array_index(trace->markers, struct marker_info, id);
 }
@@ -63,7 +63,27 @@ static inline struct marker_info *marker_get_info_from_id(LttTrace *trace,
 static inline struct marker_info *marker_get_info_from_name(LttTrace *trace,
     GQuark name)
 {
-  return g_hash_table_lookup(trace->markers_hash, (gconstpointer)name);
+  gpointer orig_key, value;
+  int res;
+
+  res = g_hash_table_lookup_extended(trace->markers_hash,
+    (gconstpointer)(gulong)name, &orig_key, &value);
+  if (!res)
+    return NULL;
+  return marker_get_info_from_id(trace, (guint16)(gulong)value);
+}
+
+static inline char *marker_get_format_from_name(LttTrace *trace,
+    GQuark name)
+{
+  gpointer orig_key, value;
+  int res;
+
+  res = g_hash_table_lookup_extended(trace->markers_format_hash,
+               (gconstpointer)(gulong)name, &orig_key, &value);
+  if (!res)
+    return NULL;
+  return (char *)value;
 }
 
 static inline struct marker_field *marker_get_field(struct marker_info *info,
This page took 0.023991 seconds and 4 git commands to generate.