X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fmarker.h;h=3d04db8870b142e5fe9e9ac2bfccb796845869e9;hb=c617567aa52c96762a481fbf5ef1a1f3b4377d7e;hp=9a4f4144c127372844730df95e5c46d7ddacf975;hpb=abc34be778e8e109b372add89963e1a6651785b6;p=lttv.git diff --git a/ltt/branches/poly/ltt/marker.h b/ltt/branches/poly/ltt/marker.h index 9a4f4144..3d04db88 100644 --- a/ltt/branches/poly/ltt/marker.h +++ b/ltt/branches/poly/ltt/marker.h @@ -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); } @@ -64,16 +64,28 @@ static inline struct marker_info *marker_get_info_from_name(LttTrace *trace, GQuark name) { gpointer orig_key, value; - guint16 id; int res; - res = g_hash_table_lookup_extended(trace->markers_hash, (gconstpointer)name, - &orig_key, &value); + 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, guint i) {