I'm using the Babeltrace python3 bindings to read an lttng ust trace that contains debug_info. When I run Babeltrace from the shell I see the debug_info in the output:
[13:28:29.998652878] (+0.000000321) hsm-dev lttng_ust_cyg_profile:func_exit: { cpu_id = 1 }, { ip = 0x4008E5, debug_info = { bin = "a.out@0x4008e5", func = "foo+0" }, vpid = 28208, vtid = 28211 }, { addr = 0x4008E5, call_site = 0x400957 }
From the python bindings I can get the other event fields (cpu_id, ip, addr, call_site...) but I get key errors trying to access debug_info, bin or func.
import babeltrace
collection = babeltrace.TraceCollection()
collection.add_traces_recursive('lttng-traces/a.out-20170624-132829/', 'ctf')
for e in collection.events:
if e.name == 'lttng_ust_cyg_profile:func_entry':
print(e['addr'])
print(e['func'])
Traceback (most recent call last):
File "fields.py", line 9, in <module>
print(e['func'])
File "/usr/lib/python3/dist-packages/babeltrace.py", line 865, in __getitem__
raise KeyError(field_name)
KeyError: 'func'
Is there a way to get those fields from Python?
I'm using Babeltrace 1.5.2