2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * Babeltrace - Debug info utilities
13 const char *get_filename_from_path(const char *path
)
15 size_t i
= strlen(path
);
21 if (path
[i
- 1] == '/') {
23 * Path ends with a trailing slash, no filename to return.
24 * Return the original path.
40 bt_bool
is_event_common_ctx_dbg_info_compatible(const bt_field_class
*in_field_class
,
41 const char *debug_info_field_class_name
)
43 const bt_field_class_structure_member
*member
;
44 const bt_field_class
*ip_fc
, *vpid_fc
;
45 bt_bool match
= BT_FALSE
;
48 * If the debug info field is already present in the event common
49 * context. Do not try to add it.
52 bt_field_class_structure_borrow_member_by_name_const(
53 in_field_class
, debug_info_field_class_name
);
59 * Verify that the ip and vpid field are present and of the right field
62 member
= bt_field_class_structure_borrow_member_by_name_const(
63 in_field_class
, IP_FIELD_NAME
);
68 ip_fc
= bt_field_class_structure_member_borrow_field_class_const(
70 if (bt_field_class_get_type(ip_fc
) !=
71 BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER
) {
76 member
= bt_field_class_structure_borrow_member_by_name_const(
77 in_field_class
, VPID_FIELD_NAME
);
82 vpid_fc
= bt_field_class_structure_member_borrow_field_class_const(
85 if (bt_field_class_get_type(vpid_fc
) !=
86 BT_FIELD_CLASS_TYPE_SIGNED_INTEGER
) {
90 if (bt_field_class_integer_get_field_value_range(vpid_fc
) != 32) {