From: Julien Desfossez Date: Thu, 1 Mar 2012 16:14:44 +0000 (-0500) Subject: fix API : deal with the optional underscore X-Git-Tag: v1.0.0-pre3~10 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=300d317acaa3bd38afafe0a440946e6c73e6fd73;hp=300d317acaa3bd38afafe0a440946e6c73e6fd73 fix API : deal with the optional underscore A field can be prefixed by an underscore internally by the tracer. This provides the abilility for the user to specify the underscore or not (depending if he read the metadata or the tracepoint event definition). This is a fallback mechanism, so if the request fails, we prefix an underscore to the field name and request it again. Also, the bt_ctf_field_name function now removes the optional underscore. A quick benchmark shows that calling the bt_ctf_get_field without the underscore on a field that requires an underscore adds around 151 nanoseconds to the call on a core 2 duo (tested in a loop of 1000000 iterations). Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers ---