1 #ifndef BABELTRACE2_TRACE_IR_EVENT_CLASS_H
2 #define BABELTRACE2_TRACE_IR_EVENT_CLASS_H
5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
32 #include <babeltrace2/types.h>
39 @defgroup api-tir-ev-cls Event class
45 An <strong><em>event class</em></strong> is the class of \bt_p_ev,
46 which \bt_p_ev_msg contain:
48 @image html trace-structure.png
50 In the illustration above, notice that:
52 - A \bt_stream is a conceptual \ref api-msg-seq "sequence of messages",
53 some of which are \bt_p_ev_msg.
54 - An event message contains an \bt_ev.
55 - An event is an instance of an event class.
56 - The \ref api-tir-ev-prop-payload "payload field" of an event is an
57 instance of the \ref api-tir-ev-cls-prop-p-fc "payload field class"
58 which an event class contains.
60 An event class is a \ref api-tir "trace IR" metadata object.
62 An event class is a \ref api-fund-shared-object "shared object": get a
63 new reference with bt_event_class_get_ref() and put an existing
64 reference with bt_event_class_put_ref().
66 Some library functions \ref api-fund-freezing "freeze" event classes on
67 success. The documentation of those functions indicate this
70 The type of an event class is #bt_event_class.
72 A \bt_stream_cls contains event classes. All the event classes of a
73 given stream class have unique
74 \ref api-tir-ev-cls-prop-id "numeric IDs". Borrow the stream class
75 which contains an event class with bt_event_class_borrow_stream_class()
76 or bt_event_class_borrow_stream_class_const().
78 To create a default event class:
82 If bt_stream_class_assigns_automatic_event_class_id() returns
83 #BT_TRUE (the default) for the stream class to use
85 <dd>Use bt_event_class_create().</dd>
88 If bt_stream_class_assigns_automatic_event_class_id() returns
89 #BT_FALSE for the stream class to use
91 <dd>Use bt_event_class_create_with_id().</dd>
96 An event class has the following properties:
99 <dt>\anchor api-tir-ev-cls-prop-id Numeric ID</dt>
101 Numeric ID, unique amongst the numeric IDs of the event class's
102 \bt_stream_cls's event classes.
104 Depending on whether or not the event class's stream class
105 automatically assigns event class IDs
106 (see bt_stream_class_assigns_automatic_event_class_id()),
107 set the event class's numeric ID on creation with
108 bt_event_class_create() or
109 bt_event_class_create_with_id().
111 You cannot change the numeric ID once the event class is created.
113 Get an event class's numeric ID with bt_event_class_get_id().
116 <dt>\anchor api-tir-ev-cls-prop-name \bt_dt_opt Name</dt>
118 Name of the event class.
120 Use bt_event_class_set_name() and bt_event_class_get_name().
123 <dt>\anchor api-tir-ev-cls-prop-log-lvl \bt_dt_opt Log level</dt>
125 Log level of the event class.
127 The event class's log level corresponds to the log level of the
128 tracer's original instrumentation point.
130 Use bt_event_class_set_log_level() and
131 bt_event_class_get_log_level().
135 \anchor api-tir-ev-cls-prop-emf-uri
136 \bt_dt_opt Eclipse Modeling Framework (EMF) URI
139 EMF URI of the event class.
141 Use bt_event_class_set_emf_uri() and
142 bt_event_class_get_emf_uri().
146 \anchor api-tir-ev-cls-prop-p-fc
147 \bt_dt_opt Payload field class
150 Payload \bt_fc of the event class.
152 The payload of an event class instance (\bt_ev) contains the
155 Use bt_event_class_set_payload_field_class()
156 bt_event_class_borrow_payload_field_class(),
157 and bt_event_class_borrow_payload_field_class_const().
161 \anchor api-tir-ev-cls-prop-sc-fc
162 \bt_dt_opt Specific context field class
165 Specific context \bt_fc of the event class.
167 The specific context of an event class instance (\bt_ev) contains
168 any contextual data of which the layout is specific to the
169 event's class and which does not belong to the payload.
171 Use bt_event_class_set_specific_context_field_class()
172 bt_event_class_borrow_specific_context_field_class(),
173 and bt_event_class_borrow_specific_context_field_class_const().
177 \anchor api-tir-ev-cls-prop-user-attrs
178 \bt_dt_opt User attributes
181 User attributes of the event class.
183 User attributes are custom attributes attached to an event class.
185 Use bt_event_class_set_user_attributes(),
186 bt_event_class_borrow_user_attributes(), and
187 bt_event_class_borrow_user_attributes_const().
198 @typedef struct bt_event_class bt_event_class;
213 Creates a default event class and adds it to the \bt_stream_cls
218 Only use this function if
221 bt_stream_class_assigns_automatic_event_class_id(stream_class)
226 Otherwise, use bt_event_class_create_with_id().
229 On success, the returned event class has the following property values:
236 <td>\ref api-tir-ev-cls-prop-id "Numeric ID"
237 <td>Automatically assigned by \bt_p{stream_class}
239 <td>\ref api-tir-ev-cls-prop-name "Name"
242 <td>\ref api-tir-ev-cls-prop-log-lvl "Log level"
245 <td>\ref api-tir-ev-cls-prop-emf-uri "EMF URI"
248 <td>\ref api-tir-ev-cls-prop-p-fc "Payload field class"
251 <td>\ref api-tir-ev-cls-prop-sc-fc "Specific context field class"
254 <td>\ref api-tir-ev-cls-prop-user-attrs "User attributes"
255 <td>Empty \bt_map_val
258 @param[in] stream_class
259 Stream class to add the created event class to.
262 New event class reference, or \c NULL on memory error.
264 @bt_pre_not_null{stream_class}
266 <code>bt_stream_class_assigns_automatic_event_class_id(stream_class)</code>
269 @bt_post_success_frozen{stream_class}
271 @sa bt_event_class_create_with_id() —
272 Creates an event class with a specific numeric ID and adds it to a
275 extern bt_event_class
*bt_event_class_create(
276 bt_stream_class
*stream_class
);
280 Creates a default event class with the numeric ID \bt_p{id} and adds
281 it to the \bt_stream_cls \bt_p{stream_class}.
285 Only use this function if
288 bt_stream_class_assigns_automatic_event_class_id(stream_class)
293 Otherwise, use bt_event_class_create().
296 On success, the returned event class has the following property values:
303 <td>\ref api-tir-ev-cls-prop-id "Numeric ID"
306 <td>\ref api-tir-ev-cls-prop-name "Name"
309 <td>\ref api-tir-ev-cls-prop-log-lvl "Log level"
312 <td>\ref api-tir-ev-cls-prop-emf-uri "EMF URI"
315 <td>\ref api-tir-ev-cls-prop-p-fc "Payload field class"
318 <td>\ref api-tir-ev-cls-prop-sc-fc "Specific context field class"
321 <td>\ref api-tir-ev-cls-prop-user-attrs "User attributes"
322 <td>Empty \bt_map_val
325 @param[in] stream_class
326 Stream class to add the created event class to.
328 Numeric ID of the event class to create and add to
332 New event class reference, or \c NULL on memory error.
334 @bt_pre_not_null{stream_class}
336 <code>bt_stream_class_assigns_automatic_event_class_id(stream_class)</code>
339 \bt_p{stream_class} does not contain an event class with the numeric
342 @bt_post_success_frozen{stream_class}
344 @sa bt_event_class_create() —
345 Creates an event class with an automatic numeric ID and adds it to a
348 extern bt_event_class
*bt_event_class_create_with_id(
349 bt_stream_class
*stream_class
, uint64_t id
);
354 @name Stream class access
360 Borrows the \bt_stream_cls which contains the event class
363 @param[in] event_class
364 Event class from which to borrow the stream class which contains it.
367 Stream class which contains \bt_p{event_class}.
369 @bt_pre_not_null{event_class}
371 @sa bt_event_class_borrow_stream_class_const() —
372 \c const version of this function.
374 extern bt_stream_class
*bt_event_class_borrow_stream_class(
375 bt_event_class
*event_class
);
379 Borrows the \bt_stream_cls which contains the event class
380 \bt_p{event_class} (\c const version).
382 See bt_event_class_borrow_stream_class().
384 extern const bt_stream_class
*bt_event_class_borrow_stream_class_const(
385 const bt_event_class
*event_class
);
396 Returns the numeric ID of the event class \bt_p{event_class}.
398 See the \ref api-tir-ev-cls-prop-id "numeric ID" property.
400 @param[in] event_class
401 Event class of which to get the numeric ID.
404 Numeric ID of \bt_p{event_class}.
406 @bt_pre_not_null{event_class}
408 @sa bt_event_class_create_with_id() —
409 Creates an event class with a specific numeric ID and adds it to a
412 extern uint64_t bt_event_class_get_id(const bt_event_class
*event_class
);
416 Status codes for bt_event_class_set_name().
418 typedef enum bt_event_class_set_name_status
{
423 BT_EVENT_CLASS_SET_NAME_STATUS_OK
= __BT_FUNC_STATUS_OK
,
429 BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
430 } bt_event_class_set_name_status
;
434 Sets the name of the event class \bt_p{event_class} to
435 a copy of \bt_p{name}.
437 See the \ref api-tir-ev-cls-prop-name "name" property.
439 @param[in] event_class
440 Event class of which to set the name to \bt_p{name}.
442 New name of \bt_p{event_class} (copied).
444 @retval #BT_EVENT_CLASS_SET_NAME_STATUS_OK
446 @retval #BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR
449 @bt_pre_not_null{event_class}
450 @bt_pre_hot{event_class}
451 @bt_pre_not_null{name}
453 @sa bt_event_class_get_name() —
454 Returns the name of an event class.
456 extern bt_event_class_set_name_status
bt_event_class_set_name(
457 bt_event_class
*event_class
, const char *name
);
461 Returns the name of the event class \bt_p{event_class}.
463 See the \ref api-tir-ev-cls-prop-name "name" property.
465 If \bt_p{event_class} has no name, this function returns \c NULL.
467 @param[in] event_class
468 Event class of which to get the name.
472 Name of \bt_p{event_class}, or \c NULL if none.
474 The returned pointer remains valid as long as \bt_p{event_class}
478 @bt_pre_not_null{event_class}
480 @sa bt_event_class_set_name() —
481 Sets the name of an event class.
483 extern const char *bt_event_class_get_name(const bt_event_class
*event_class
);
487 Event class log level enumerators.
489 typedef enum bt_event_class_log_level
{
494 BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY
= 0,
498 Action must be taken immediately.
500 BT_EVENT_CLASS_LOG_LEVEL_ALERT
= 1,
506 BT_EVENT_CLASS_LOG_LEVEL_CRITICAL
= 2,
512 BT_EVENT_CLASS_LOG_LEVEL_ERROR
= 3,
518 BT_EVENT_CLASS_LOG_LEVEL_WARNING
= 4,
522 Normal, but significant, condition.
524 BT_EVENT_CLASS_LOG_LEVEL_NOTICE
= 5,
528 Informational message.
530 BT_EVENT_CLASS_LOG_LEVEL_INFO
= 6,
534 Debugging information with system-level scope
537 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM
= 7,
541 Debugging information with program-level scope
544 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM
= 8,
548 Debugging information with process-level scope
551 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS
= 9,
555 Debugging information with module (executable/library) scope
558 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE
= 10,
562 Debugging information with compilation unit scope
565 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT
= 11,
569 Debugging information with function-level scope.
571 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION
= 12,
575 Debugging information with function-level scope.
577 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE
= 13,
581 Debugging-level message.
583 BT_EVENT_CLASS_LOG_LEVEL_DEBUG
= 14,
584 } bt_event_class_log_level
;
588 Sets the log level of the event class \bt_p{event_class} to
591 See the \ref api-tir-ev-cls-prop-log-lvl "log level" property.
593 @param[in] event_class
594 Event class of which to set the log level to \bt_p{log_level}.
596 New log level of \bt_p{event_class}.
598 @bt_pre_not_null{event_class}
599 @bt_pre_hot{event_class}
601 @sa bt_event_class_get_log_level() —
602 Returns the log level of an event class.
604 extern void bt_event_class_set_log_level(bt_event_class
*event_class
,
605 bt_event_class_log_level log_level
);
609 Returns the log level of the event class \bt_p{event_class}.
611 See the \ref api-tir-ev-cls-prop-log-lvl "log level" property.
613 @param[in] event_class
614 Event class of which to get the log level.
615 @param[out] log_level
616 <strong>If this function returns
617 #BT_PROPERTY_AVAILABILITY_AVAILABLE</strong>, \bt_p{*log_level} is
618 the log level of \bt_p{event_class}.
620 @retval #BT_PROPERTY_AVAILABILITY_AVAILABLE
621 The log level of \bt_p{event_class} is available.
622 @retval #BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
623 The log level of \bt_p{event_class} is not available.
625 @bt_pre_not_null{event_class}
626 @bt_pre_not_null{log_level}
628 @sa bt_event_class_set_log_level() —
629 Sets the log level of an event class.
631 extern bt_property_availability
bt_event_class_get_log_level(
632 const bt_event_class
*event_class
,
633 bt_event_class_log_level
*log_level
);
637 Status codes for bt_event_class_set_emf_uri().
639 typedef enum bt_event_class_set_emf_uri_status
{
644 BT_EVENT_CLASS_SET_EMF_URI_STATUS_OK
= __BT_FUNC_STATUS_OK
,
650 BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
651 } bt_event_class_set_emf_uri_status
;
655 Sets the Eclipse Modeling Framework (EMF) URI of the event class
656 \bt_p{event_class} to a copy of \bt_p{emf_uri}.
658 See the \ref api-tir-ev-cls-prop-emf-uri "EMF URI" property.
660 @param[in] event_class
661 Event class of which to set the EMF URI to \bt_p{emf_uri}.
663 New EMF URI of \bt_p{event_class} (copied).
665 @retval #BT_EVENT_CLASS_SET_EMF_URI_STATUS_OK
667 @retval #BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR
670 @bt_pre_not_null{event_class}
671 @bt_pre_hot{event_class}
672 @bt_pre_not_null{emf_uri}
674 @sa bt_event_class_get_emf_uri() —
675 Returns the EMF URI of an event class.
677 extern bt_event_class_set_emf_uri_status
bt_event_class_set_emf_uri(
678 bt_event_class
*event_class
, const char *emf_uri
);
682 Returns the Eclipse Modeling Framework (EMF) URI of the event
683 class \bt_p{event_class}.
685 See the \ref api-tir-ev-cls-prop-emf-uri "EMF URI" property.
687 If \bt_p{event_class} has no EMF URI, this function returns \c NULL.
689 @param[in] event_class
690 Event class of which to get the EMF URI.
694 EMF URI of \bt_p{event_class}, or \c NULL if none.
696 The returned pointer remains valid as long as \bt_p{event_class}
700 @bt_pre_not_null{event_class}
702 @sa bt_event_class_set_emf_uri() —
703 Sets the EMF URI of an event class.
705 extern const char *bt_event_class_get_emf_uri(
706 const bt_event_class
*event_class
);
710 Status codes for bt_event_class_set_payload_field_class() and
711 bt_event_class_set_specific_context_field_class().
713 typedef enum bt_event_class_set_field_class_status
{
718 BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK
= __BT_FUNC_STATUS_OK
,
724 BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
725 } bt_event_class_set_field_class_status
;
729 Sets the payload \bt_fc of the event class
730 \bt_p{event_class} to \bt_p{field_class}.
732 See the \ref api-tir-ev-cls-prop-p-fc "payload field class" property.
734 @param[in] event_class
735 Event class of which to set the payload field class to
737 @param[in] field_class
738 New payload field class of \bt_p{event_class}.
740 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK
742 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
745 @bt_pre_not_null{event_class}
746 @bt_pre_hot{event_class}
747 @bt_pre_not_null{field_class}
748 @bt_pre_is_struct_fc{field_class}
750 \bt_p{field_class}, or any of its contained field classes,
751 is not already part of a \bt_stream_cls or of an event class.
753 If any of the field classes recursively contained in
754 \bt_p{field_class} has a
755 \ref api-tir-fc-link "link to another field class", it must honor
756 the field class link rules.
758 @bt_post_success_frozen{field_class}
760 @sa bt_event_class_borrow_payload_field_class() —
761 Borrows the payload field class of an event class.
762 @sa bt_event_class_borrow_payload_field_class_const() —
763 Borrows the payload field class of an event class
766 extern bt_event_class_set_field_class_status
767 bt_event_class_set_payload_field_class(bt_event_class
*event_class
,
768 bt_field_class
*field_class
);
772 Borrows the payload \bt_fc from the event class \bt_p{event_class}.
774 See the \ref api-tir-ev-cls-prop-p-fc "payload field class" property.
776 If \bt_p{event_class} has no payload field class, this function
779 @param[in] event_class
780 Event class from which to borrow the payload field class.
783 \em Borrowed reference of the payload field class of
784 \bt_p{event_class}, or \c NULL if none.
786 @bt_pre_not_null{event_class}
788 @sa bt_event_class_set_payload_field_class() —
789 Sets the payload field class of an event class.
790 @sa bt_event_class_borrow_payload_field_class_const() —
791 \c const version of this function.
793 extern bt_field_class
*bt_event_class_borrow_payload_field_class(
794 bt_event_class
*event_class
);
798 Borrows the payload \bt_fc from the event class \bt_p{event_class}
801 See bt_event_class_borrow_payload_field_class().
803 extern const bt_field_class
*bt_event_class_borrow_payload_field_class_const(
804 const bt_event_class
*event_class
);
808 Sets the specific context \bt_fc of the event class
809 \bt_p{event_class} to \bt_p{field_class}.
811 See the \ref api-tir-ev-cls-prop-sc-fc "specific context field class"
814 @param[in] event_class
815 Event class of which to set the specific context field class to
817 @param[in] field_class
818 New specific context field class of \bt_p{event_class}.
820 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK
822 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
825 @bt_pre_not_null{event_class}
826 @bt_pre_hot{event_class}
827 @bt_pre_not_null{field_class}
828 @bt_pre_is_struct_fc{field_class}
830 \bt_p{field_class}, or any of its contained field classes,
831 is not already part of a \bt_stream_cls or of an event class.
833 If any of the field classes recursively contained in
834 \bt_p{field_class} has a
835 \ref api-tir-fc-link "link to another field class", it must honor
836 the field class link rules.
838 @bt_post_success_frozen{field_class}
840 @sa bt_event_class_borrow_specific_context_field_class() —
841 Borrows the specific context field class of an event class.
842 @sa bt_event_class_borrow_specific_context_field_class_const() —
843 Borrows the specific context field class of an event class
846 extern bt_event_class_set_field_class_status
847 bt_event_class_set_specific_context_field_class(bt_event_class
*event_class
,
848 bt_field_class
*field_class
);
852 Borrows the specific context \bt_fc from the event class
855 See the \ref api-tir-ev-cls-prop-sc-fc "specific context field class"
858 If \bt_p{event_class} has no specific context field class, this function
861 @param[in] event_class
862 Event class from which to borrow the specific context field class.
865 \em Borrowed reference of the specific context field class of
866 \bt_p{event_class}, or \c NULL if none.
868 @bt_pre_not_null{event_class}
870 @sa bt_event_class_set_specific_context_field_class() —
871 Sets the specific context field class of an event class.
872 @sa bt_event_class_borrow_specific_context_field_class_const() —
873 \c const version of this function.
875 extern bt_field_class
*
876 bt_event_class_borrow_specific_context_field_class(bt_event_class
*event_class
);
880 Borrows the specific context \bt_fc from the event class
881 \bt_p{event_class} (\c const version).
883 See bt_event_class_borrow_specific_context_field_class().
885 extern const bt_field_class
*
886 bt_event_class_borrow_specific_context_field_class_const(
887 const bt_event_class
*event_class
);
891 Sets the user attributes of the event class \bt_p{event_class} to
892 \bt_p{user_attributes}.
894 See the \ref api-tir-ev-cls-prop-user-attrs "user attributes" property.
897 When you create a default event class with bt_event_class_create()
898 or bt_event_class_create_with_id(), the event class's initial user
899 attributes is an empty \bt_map_val. Therefore you can borrow it with
900 bt_event_class_borrow_user_attributes() and fill it directly instead
901 of setting a new one with this function.
903 @param[in] event_class
904 Event class of which to set the user attributes to
905 \bt_p{user_attributes}.
906 @param[in] user_attributes
907 New user attributes of \bt_p{event_class}.
909 @bt_pre_not_null{event_class}
910 @bt_pre_hot{event_class}
911 @bt_pre_not_null{user_attributes}
912 @bt_pre_is_map_val{user_attributes}
914 @sa bt_event_class_borrow_user_attributes() —
915 Borrows the user attributes of an event class.
917 extern void bt_event_class_set_user_attributes(
918 bt_event_class
*event_class
, const bt_value
*user_attributes
);
922 Borrows the user attributes of the event class \bt_p{event_class}.
924 See the \ref api-tir-ev-cls-prop-user-attrs "user attributes" property.
927 When you create a default event class with bt_event_class_create()
928 or bt_event_class_create_with_id(), the event class's initial user
929 attributes is an empty \bt_map_val.
931 @param[in] event_class
932 Event class from which to borrow the user attributes.
935 User attributes of \bt_p{event_class} (a \bt_map_val).
937 @bt_pre_not_null{event_class}
939 @sa bt_event_class_set_user_attributes() —
940 Sets the user attributes of an event class.
941 @sa bt_event_class_borrow_user_attributes_const() —
942 \c const version of this function.
944 extern bt_value
*bt_event_class_borrow_user_attributes(
945 bt_event_class
*event_class
);
949 Borrows the user attributes of the event class \bt_p{event_class}
952 See bt_event_class_borrow_user_attributes().
954 extern const bt_value
*bt_event_class_borrow_user_attributes_const(
955 const bt_event_class
*event_class
);
960 @name Reference count
966 Increments the \ref api-fund-shared-object "reference count" of
967 the event class \bt_p{event_class}.
969 @param[in] event_class
971 Event class of which to increment the reference count.
976 @sa bt_event_class_put_ref() —
977 Decrements the reference count of an event class.
979 extern void bt_event_class_get_ref(const bt_event_class
*event_class
);
983 Decrements the \ref api-fund-shared-object "reference count" of
984 the event class \bt_p{event_class}.
986 @param[in] event_class
988 Event class of which to decrement the reference count.
993 @sa bt_event_class_get_ref() —
994 Increments the reference count of an event class.
996 extern void bt_event_class_put_ref(const bt_event_class
*event_class
);
1000 Decrements the reference count of the event class
1001 \bt_p{_event_class}, and then sets \bt_p{_event_class} to \c NULL.
1005 Event class of which to decrement the reference count.
1007 Can contain \c NULL.
1010 @bt_pre_assign_expr{_event_class}
1012 #define BT_EVENT_CLASS_PUT_REF_AND_RESET(_event_class) \
1014 bt_event_class_put_ref(_event_class); \
1015 (_event_class) = NULL; \
1020 Decrements the reference count of the event class \bt_p{_dst}, sets
1021 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
1023 This macro effectively moves an event class reference from the expression
1024 \bt_p{_src} to the expression \bt_p{_dst}, putting the existing
1025 \bt_p{_dst} reference.
1029 Destination expression.
1031 Can contain \c NULL.
1037 Can contain \c NULL.
1040 @bt_pre_assign_expr{_dst}
1041 @bt_pre_assign_expr{_src}
1043 #define BT_EVENT_CLASS_MOVE_REF(_dst, _src) \
1045 bt_event_class_put_ref(_dst); \
1058 #endif /* BABELTRACE2_TRACE_IR_EVENT_CLASS_H */