X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fmarker.h;h=93f6ff610ebb1b43e1ddb00990c5164f9f8e174b;hb=c09a11e9677885425f146617448fc7d1f5affe90;hp=e3d4cd3d96b8706860563cba05fdcff998d212ea;hpb=8c6a42767875ea167d04ce527afb7baf94963ecc;p=lttv.git diff --git a/ltt/branches/poly/ltt/marker.h b/ltt/branches/poly/ltt/marker.h index e3d4cd3d..93f6ff61 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); } @@ -73,6 +73,19 @@ static inline struct marker_info *marker_get_info_from_name(LttTrace *trace, 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)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) {