X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fevents.c;h=b35f54a8ecba9cee1f5000323b47b3c082462c7a;hp=eea58cfd796ffeec39d13c381d4216dcb4128c14;hb=300d317acaa3bd38afafe0a440946e6c73e6fd73;hpb=8673030f3cb8d157a30e79af524fd5cca253025e diff --git a/formats/ctf/events.c b/formats/ctf/events.c index eea58cfd..b35f54a8 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -172,9 +172,21 @@ struct definition *bt_ctf_get_field(struct bt_ctf_event *event, const char *field) { struct definition *def; + char *field_underscore; if (scope) { def = lookup_definition(scope, field); + /* + * optionally a field can have an underscore prefix, try + * to lookup the field with this prefix if it failed + */ + if (!def) { + field_underscore = g_new(char, strlen(field) + 2); + field_underscore[0] = '_'; + strcpy(&field_underscore[1], field); + def = lookup_definition(scope, field_underscore); + g_free(field_underscore); + } if (bt_ctf_field_type(def) == CTF_TYPE_VARIANT) { struct definition_variant *variant_definition; variant_definition = container_of(def, @@ -222,7 +234,7 @@ const char *bt_ctf_event_name(struct bt_ctf_event *event) const char *bt_ctf_field_name(const struct definition *def) { if (def) - return g_quark_to_string(def->name); + return rem_(g_quark_to_string(def->name)); return NULL; }