Babeltrace 2 C API  2.1.0
Open-source trace manipulation framework
field-location.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright (C) 2022-2024 EfficiOS Inc. and Linux Foundation
5  */
6 
7 #ifndef BABELTRACE2_TRACE_IR_FIELD_LOCATION_H
8 #define BABELTRACE2_TRACE_IR_FIELD_LOCATION_H
9 
10 #ifndef __BT_IN_BABELTRACE_H
11 # error "Please include <babeltrace2/babeltrace.h> instead."
12 #endif
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
225 
231 
237 
244 
276 extern bt_field_location *bt_field_location_create(
277  bt_trace_class *trace_class,
278  bt_field_location_scope root_scope,
279  const char *const *items,
280  uint64_t item_count) __BT_NOEXCEPT;
281 
299  const bt_field_location *field_location) __BT_NOEXCEPT;
300 
321 extern uint64_t bt_field_location_get_item_count(
322  const bt_field_location *field_location) __BT_NOEXCEPT;
323 
355 extern const char *bt_field_location_get_item_by_index(
356  const bt_field_location *field_location,
357  uint64_t index) __BT_NOEXCEPT;
358 
376 extern void bt_field_location_get_ref(
377  const bt_field_location *field_location) __BT_NOEXCEPT;
378 
396 extern void bt_field_location_put_ref(
397  const bt_field_location *field_location) __BT_NOEXCEPT;
398 
416 #define BT_FIELD_LOCATION_PUT_REF_AND_RESET(_field_location) \
417  do { \
418  bt_field_location_put_ref(_field_location); \
419  (_field_location) = NULL; \
420  } while (0)
421 
450 #define BT_FIELD_LOCATION_MOVE_REF(_dst, _src) \
451  do { \
452  bt_field_location_put_ref(_dst); \
453  (_dst) = (_src); \
454  (_src) = NULL; \
455  } while (0)
456 
459 #ifdef __cplusplus
460 }
461 #endif
462 
463 #endif /* BABELTRACE2_TRACE_IR_FIELD_LOCATION_H */
Specific context of the current event.
Definition: field-location.h:236
void bt_field_location_get_ref(const bt_field_location *field_location)
Increments the reference count of the field location field_location.
Common context of the current event.
Definition: field-location.h:230
Payload of the current event.
Definition: field-location.h:242
void bt_field_location_put_ref(const bt_field_location *field_location)
Decrements the reference count of the field location field_location.
uint64_t bt_field_location_get_item_count(const bt_field_location *field_location)
Returns the number of items contained in the field location field_location.
struct bt_trace_class bt_trace_class
Trace class.
Definition: types.h:92
Context of the current packet.
Definition: field-location.h:224
const char * bt_field_location_get_item_by_index(const bt_field_location *field_location, uint64_t index)
Returns the item at index index from the field location field_location.
bt_field_location_scope bt_field_location_get_root_scope(const bt_field_location *field_location)
Returns the root scope of the field location field_location.
bt_field_location_scope
Field location scope enumerators.
Definition: field-location.h:219
bt_field_location * bt_field_location_create(bt_trace_class *trace_class, bt_field_location_scope root_scope, const char *const *items, uint64_t item_count)
Creates a field location from the trace class trace_class using the scope scope and the items items...