Babeltrace 2 C API  2.1.1
Open-source trace manipulation framework
event-class.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5  */
6 
7 #ifndef BABELTRACE2_TRACE_IR_EVENT_CLASS_H
8 #define BABELTRACE2_TRACE_IR_EVENT_CLASS_H
9 
10 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11 
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
14 #endif
15 
16 #include <stdint.h>
17 
18 #include <babeltrace2/types.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
297  bt_stream_class *stream_class) __BT_NOEXCEPT;
298 
376  bt_stream_class *stream_class, uint64_t id) __BT_NOEXCEPT;
377 
402  bt_event_class *event_class) __BT_NOEXCEPT;
403 
412  const bt_event_class *event_class) __BT_NOEXCEPT;
413 
439 extern uint64_t bt_event_class_get_id(
440  const bt_event_class *event_class) __BT_NOEXCEPT;
441 
454 
459  BT_EVENT_CLASS_SET_NAMESPACE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
461 
490  bt_event_class *event_class, const char *ns) __BT_NOEXCEPT;
491 
520 extern const char *
521 bt_event_class_get_namespace(const bt_event_class *event_class) __BT_NOEXCEPT;
522 
532  BT_EVENT_CLASS_SET_NAME_STATUS_OK = __BT_FUNC_STATUS_OK,
533 
538  BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
540 
566  bt_event_class *event_class, const char *name) __BT_NOEXCEPT;
567 
579  BT_EVENT_CLASS_SET_UID_STATUS_OK = __BT_FUNC_STATUS_OK,
580 
585  BT_EVENT_CLASS_SET_UID_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
587 
618  bt_event_class *event_class, const char *uid) __BT_NOEXCEPT;
619 
647 extern const char *
648 bt_event_class_get_uid(const bt_event_class *event_class) __BT_NOEXCEPT;
649 
674 extern const char *bt_event_class_get_name(
675  const bt_event_class *event_class) __BT_NOEXCEPT;
676 
687 
693 
699 
705 
711 
717 
723 
730 
737 
744 
751 
758 
764 
770 
777 
796 extern void bt_event_class_set_log_level(bt_event_class *event_class,
797  bt_event_class_log_level log_level) __BT_NOEXCEPT;
798 
824  const bt_event_class *event_class,
825  bt_event_class_log_level *log_level) __BT_NOEXCEPT;
826 
837 
842  BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
844 
870  bt_event_class *event_class, const char *emf_uri) __BT_NOEXCEPT;
871 
898 extern const char *bt_event_class_get_emf_uri(
899  const bt_event_class *event_class) __BT_NOEXCEPT;
900 
912 
917  BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
919 
961  bt_field_class *field_class) __BT_NOEXCEPT;
962 
987  bt_event_class *event_class) __BT_NOEXCEPT;
988 
997  const bt_event_class *event_class) __BT_NOEXCEPT;
998 
1041  bt_field_class *field_class) __BT_NOEXCEPT;
1042 
1068 extern bt_field_class *
1070  bt_event_class *event_class) __BT_NOEXCEPT;
1071 
1079 extern const bt_field_class *
1081  const bt_event_class *event_class) __BT_NOEXCEPT;
1082 
1112  bt_event_class *event_class, const bt_value *user_attributes)
1113  __BT_NOEXCEPT;
1114 
1140  bt_event_class *event_class) __BT_NOEXCEPT;
1141 
1150  const bt_event_class *event_class) __BT_NOEXCEPT;
1151 
1174 extern void bt_event_class_get_ref(
1175  const bt_event_class *event_class) __BT_NOEXCEPT;
1176 
1192 extern void bt_event_class_put_ref(
1193  const bt_event_class *event_class) __BT_NOEXCEPT;
1194 
1209 #define BT_EVENT_CLASS_PUT_REF_AND_RESET(_event_class) \
1210  do { \
1211  bt_event_class_put_ref(_event_class); \
1212  (_event_class) = NULL; \
1213  } while (0)
1214 
1240 #define BT_EVENT_CLASS_MOVE_REF(_dst, _src) \
1241  do { \
1242  bt_event_class_put_ref(_dst); \
1243  (_dst) = (_src); \
1244  (_src) = NULL; \
1245  } while (0)
1246 
1251 #ifdef __cplusplus
1252 }
1253 #endif
1254 
1255 #endif /* BABELTRACE2_TRACE_IR_EVENT_CLASS_H */
bt_value * bt_event_class_borrow_user_attributes(bt_event_class *event_class)
Borrows the user attributes of the event class event_class.
const bt_field_class * bt_event_class_borrow_specific_context_field_class_const(const bt_event_class *event_class)
Borrows the specific context field class from the event class event_class (const version).
void bt_event_class_get_ref(const bt_event_class *event_class)
Increments the reference count of the event class event_class.
bt_event_class_set_namespace_status bt_event_class_set_namespace(bt_event_class *event_class, const char *ns)
Sets the namespace of the event class event_class to a copy of ns.
Debugging-level message.
Definition: event-class.h:775
Warning conditions.
Definition: event-class.h:710
Out of memory.
Definition: event-class.h:917
Debugging information with function-level scope.
Definition: event-class.h:769
Critical conditions.
Definition: event-class.h:698
bt_event_class * bt_event_class_create_with_id(bt_stream_class *stream_class, uint64_t id)
Creates a default event class with the numeric ID id and adds it to the stream class stream_class...
void bt_event_class_set_log_level(bt_event_class *event_class, bt_event_class_log_level log_level)
Sets the log level of the event class event_class to log_level.
bt_event_class_set_field_class_status
Status codes for bt_event_class_set_payload_field_class() and bt_event_class_set_specific_context_fie...
Definition: event-class.h:906
bt_event_class_set_name_status
Status codes for bt_event_class_set_name().
Definition: event-class.h:527
bt_property_availability bt_event_class_get_log_level(const bt_event_class *event_class, bt_event_class_log_level *log_level)
Returns the log level of the event class event_class.
bt_event_class_set_emf_uri_status bt_event_class_set_emf_uri(bt_event_class *event_class, const char *emf_uri)
Sets the Eclipse Modeling Framework (EMF) URI of the event class event_class to a copy of emf_uri...
const char * bt_event_class_get_namespace(const bt_event_class *event_class)
Returns the namespace of the event class event_class.
Debugging information with program-level scope (set of processes).
Definition: event-class.h:736
uint64_t bt_event_class_get_id(const bt_event_class *event_class)
Returns the numeric ID of the event class event_class.
bt_event_class_set_field_class_status bt_event_class_set_payload_field_class(bt_event_class *event_class, bt_field_class *field_class)
Sets the payload field class of the event class event_class to field_class.
Success.
Definition: event-class.h:532
struct bt_field_class bt_field_class
Field class.
Definition: types.h:39
Success.
Definition: event-class.h:453
bt_property_availability
Availability of an object property.
Definition: types.h:159
Success.
Definition: event-class.h:836
const char * bt_event_class_get_name(const bt_event_class *event_class)
Returns the name of the event class event_class.
Normal, but significant, condition.
Definition: event-class.h:716
Error conditions.
Definition: event-class.h:704
const bt_value * bt_event_class_borrow_user_attributes_const(const bt_event_class *event_class)
Borrows the user attributes of the event class event_class (const version).
const bt_stream_class * bt_event_class_borrow_stream_class_const(const bt_event_class *event_class)
Borrows the stream class which contains the event class event_class (const version).
struct bt_value bt_value
Value.
Definition: types.h:93
Out of memory.
Definition: event-class.h:459
bt_event_class_set_uid_status bt_event_class_set_uid(bt_event_class *event_class, const char *uid)
Sets the unique identifier (UID) of the stream class event_class to a copy of uid.
struct bt_event_class bt_event_class
Event class.
Definition: types.h:37
Informational message.
Definition: event-class.h:722
bt_field_class * bt_event_class_borrow_payload_field_class(bt_event_class *event_class)
Borrows the payload field class from the event class event_class.
bt_event_class * bt_event_class_create(bt_stream_class *stream_class)
Creates a default event class and adds it to the stream class stream_class.
void bt_event_class_put_ref(const bt_event_class *event_class)
Decrements the reference count of the event class event_class.
Action must be taken immediately.
Definition: event-class.h:692
bt_event_class_set_namespace_status
Status codes for bt_event_class_set_namespace().
Definition: event-class.h:448
bt_field_class * bt_event_class_borrow_specific_context_field_class(bt_event_class *event_class)
Borrows the specific context field class from the event class event_class.
bt_stream_class * bt_event_class_borrow_stream_class(bt_event_class *event_class)
Borrows the stream class which contains the event class event_class.
Out of memory.
Definition: event-class.h:538
Success.
Definition: event-class.h:911
Debugging information with function-level scope.
Definition: event-class.h:763
const bt_field_class * bt_event_class_borrow_payload_field_class_const(const bt_event_class *event_class)
Borrows the payload field class from the event class event_class (const version). ...
Success.
Definition: event-class.h:579
Debugging information with process-level scope (set of modules).
Definition: event-class.h:743
Out of memory.
Definition: event-class.h:585
void bt_event_class_set_user_attributes(bt_event_class *event_class, const bt_value *user_attributes)
Sets the user attributes of the event class event_class to user_attributes.
const char * bt_event_class_get_emf_uri(const bt_event_class *event_class)
Returns the Eclipse Modeling Framework (EMF) URI of the event class event_class.
bt_event_class_set_emf_uri_status
Status codes for bt_event_class_set_emf_uri().
Definition: event-class.h:831
Debugging information with module (executable/library) scope (set of units).
Definition: event-class.h:750
bt_event_class_set_field_class_status bt_event_class_set_specific_context_field_class(bt_event_class *event_class, bt_field_class *field_class)
Sets the specific context field class of the event class event_class to field_class.
Debugging information with compilation unit scope (set of functions).
Definition: event-class.h:757
bt_event_class_log_level
Event class log level enumerators.
Definition: event-class.h:681
const char * bt_event_class_get_uid(const bt_event_class *event_class)
Returns the UID of the event class event_class.
bt_event_class_set_name_status bt_event_class_set_name(bt_event_class *event_class, const char *name)
Sets the name of the event class event_class to a copy of name.
struct bt_stream_class bt_stream_class
Stream class.
Definition: types.h:90
System is unusable.
Definition: event-class.h:686
Debugging information with system-level scope (set of programs).
Definition: event-class.h:729
Out of memory.
Definition: event-class.h:842
bt_event_class_set_uid_status
Status codes for bt_event_class_set_uid().
Definition: event-class.h:574