a978436f95ae6ecc6e99b1a4397bb24a1dfada6f
1 // SPDX-License-Identifier: MIT
3 * Copyright 2022-2023 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 #ifndef SIDE_ABI_EVENT_DESCRIPTION_H
7 #define SIDE_ABI_EVENT_DESCRIPTION_H
10 #include <side/macros.h>
11 #include <side/endian.h>
14 * SIDE ABI event description.
16 * The extensibility scheme for the SIDE ABI event description is as
19 * * Changing the semantic of the existing event description fields is a
20 * breaking ABI change: the SIDE_EVENT_DESCRIPTION_ABI_VERSION should
21 * be increased to reflect this.
23 * * Event descriptions can be extended by adding fields at the end of
24 * the structure. The "struct side_event_description" is a structure
25 * with flexible size which must not be used within arrays.
28 #define SIDE_EVENT_DESCRIPTION_ABI_VERSION 0
30 enum side_event_flags
{
31 SIDE_EVENT_FLAG_VARIADIC
= (1 << 0),
35 SIDE_LOGLEVEL_EMERG
= 0,
36 SIDE_LOGLEVEL_ALERT
= 1,
37 SIDE_LOGLEVEL_CRIT
= 2,
38 SIDE_LOGLEVEL_ERR
= 3,
39 SIDE_LOGLEVEL_WARNING
= 4,
40 SIDE_LOGLEVEL_NOTICE
= 5,
41 SIDE_LOGLEVEL_INFO
= 6,
42 SIDE_LOGLEVEL_DEBUG
= 7,
45 struct side_event_description
{
46 uint32_t struct_size
; /* Size of this structure. */
47 uint32_t version
; /* Event description ABI version. */
49 side_ptr_t(struct side_event_state
) state
;
50 side_ptr_t(const char) provider_name
;
51 side_ptr_t(const char) event_name
;
52 side_ptr_t(const struct side_event_field
) fields
;
53 side_ptr_t(const struct side_attr
) attr
;
54 uint64_t flags
; /* Bitwise OR of enum side_event_flags */
55 uint16_t nr_side_type_label
;
56 uint16_t nr_side_attr_type
;
57 side_enum_t(enum side_loglevel
, uint32_t) loglevel
;
60 uint32_t nr_callbacks
;
61 #define side_event_description_orig_abi_last nr_callbacks
62 /* End of fields supported in the original ABI. */
64 char end
[]; /* End with a flexible array to account for extensibility. */
67 #endif /* SIDE_ABI_EVENT_DESCRIPTION_H */
This page took 0.03006 seconds and 4 git commands to generate.