Commit | Line | Data |
---|---|---|
36abff2a PP |
1 | import unittest |
2 | import os.path | |
3 | import bt2 | |
4 | import os | |
5 | ||
6 | ||
7 | class LttngUtilsDebugInfoTestCase(unittest.TestCase): | |
8 | def test_debug_info(self): | |
9 | debug_info_data_dir = os.environ['DEBUG_INFO_DATA_DIR'] | |
10 | trace_path = os.path.join(debug_info_data_dir, 'trace') | |
11 | target_prefix = os.path.join(debug_info_data_dir, '..', '..') | |
12 | src = bt2.ComponentSpec('ctf', 'fs', trace_path) | |
13 | flt = bt2.ComponentSpec('lttng-utils', 'debug-info', { | |
14 | 'target-prefix': target_prefix, | |
15 | }) | |
16 | it = bt2.TraceCollectionNotificationIterator(src, flt, | |
17 | [bt2.EventNotification]) | |
18 | notifs = list(it) | |
19 | debug_info = notifs[2].event['debug_info'] | |
20 | self.assertEqual(debug_info['bin'], 'libhello_so+0x14d4') | |
21 | self.assertEqual(debug_info['func'], 'foo+0xa9') | |
22 | self.assertEqual(debug_info['src'], 'libhello.c:7') | |
23 | debug_info = notifs[3].event['debug_info'] | |
24 | self.assertEqual(debug_info['bin'], 'libhello_so+0x15a6') | |
25 | self.assertEqual(debug_info['func'], 'bar+0xa9') | |
26 | self.assertEqual(debug_info['src'], 'libhello.c:13') |