From 2e2bda80bddcd0c27c662bafef4dce6526e132c1 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 12 Apr 2022 16:39:09 -0400 Subject: [PATCH] Cleanup: reorganize ust-abi.h declarations Signed-off-by: Mathieu Desnoyers Change-Id: Ifaab194b0cd11bf16270ef8809d87faa7894dfba --- include/lttng/ust-abi.h | 120 ++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/include/lttng/ust-abi.h b/include/lttng/ust-abi.h index 936d31c7..e9d77c74 100644 --- a/include/lttng/ust-abi.h +++ b/include/lttng/ust-abi.h @@ -76,50 +76,6 @@ struct lttng_ust_abi_stream { */ } __attribute__((packed)); -#define LTTNG_UST_ABI_COUNTER_DIMENSION_MAX 4 - -enum lttng_ust_abi_counter_arithmetic { - LTTNG_UST_ABI_COUNTER_ARITHMETIC_MODULAR = 0, - LTTNG_UST_ABI_COUNTER_ARITHMETIC_SATURATION = 1, -}; - -enum lttng_ust_abi_counter_bitness { - LTTNG_UST_ABI_COUNTER_BITNESS_32 = 0, - LTTNG_UST_ABI_COUNTER_BITNESS_64 = 1, -}; - -enum lttng_ust_abi_counter_dimension_flags { - LTTNG_UST_ABI_COUNTER_DIMENSION_FLAG_UNDERFLOW = (1 << 0), - LTTNG_UST_ABI_COUNTER_DIMENSION_FLAG_OVERFLOW = (1 << 1), -}; - -struct lttng_ust_abi_counter_dimension { - uint32_t flags; /* enum lttng_ust_abi_counter_dimension_flags */ - uint64_t size; /* dimension size */ - uint64_t underflow_index; - uint64_t overflow_index; -} __attribute__((packed)); - -enum lttng_ust_abi_counter_conf_flags { - LTTNG_UST_ABI_COUNTER_CONF_FLAG_COALESCE_HITS = (1 << 0), -}; - -struct lttng_ust_abi_counter_conf { - uint32_t len; /* Length of fields before var. len. data. */ - uint32_t flags; /* enum lttng_ust_abi_counter_conf_flags */ - uint32_t arithmetic; /* enum lttng_ust_abi_counter_arithmetic */ - uint32_t bitness; /* enum lttng_ust_abi_counter_bitness */ - int64_t global_sum_step; - uint32_t number_dimensions; - uint32_t elem_len; /* array stride (size of lttng_ust_abi_counter_dimension) */ -} __attribute__((packed)); - -struct lttng_ust_abi_counter_value { - uint32_t number_dimensions; - uint64_t dimension_indexes[LTTNG_UST_ABI_COUNTER_DIMENSION_MAX]; - int64_t value; -} __attribute__((packed)); - #define LTTNG_UST_ABI_EVENT_PADDING1 8 #define LTTNG_UST_ABI_EVENT_PADDING2 (LTTNG_UST_ABI_SYM_NAME_LEN + 32) struct lttng_ust_abi_event { @@ -151,22 +107,7 @@ struct lttng_ust_abi_event_notifier_notification { char padding[LTTNG_UST_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING]; } __attribute__((packed)); -#define LTTNG_UST_ABI_COUNTER_DATA_MAX_LEN 4096U -struct lttng_ust_abi_counter { - uint64_t len; - char data[]; /* variable sized data */ -} __attribute__((packed)); - -struct lttng_ust_abi_counter_global { - uint32_t len; /* Length of this structure */ - uint64_t shm_len; /* shm len */ -} __attribute__((packed)); - -struct lttng_ust_abi_counter_cpu { - uint32_t len; /* Length of this structure */ - uint64_t shm_len; /* shm len */ - uint32_t cpu_nr; -} __attribute__((packed)); +#define LTTNG_UST_ABI_COUNTER_DIMENSION_MAX 4 enum lttng_ust_abi_key_token_type { LTTNG_UST_ABI_KEY_TOKEN_STRING = 0, /* arg: strtab_offset. */ @@ -174,6 +115,16 @@ enum lttng_ust_abi_key_token_type { LTTNG_UST_ABI_KEY_TOKEN_PROVIDER_NAME = 2, /* no arg. */ }; +enum lttng_ust_abi_counter_arithmetic { + LTTNG_UST_ABI_COUNTER_ARITHMETIC_MODULAR = 0, + LTTNG_UST_ABI_COUNTER_ARITHMETIC_SATURATION = 1, +}; + +enum lttng_ust_abi_counter_bitness { + LTTNG_UST_ABI_COUNTER_BITNESS_32 = 0, + LTTNG_UST_ABI_COUNTER_BITNESS_64 = 1, +}; + #define LTTNG_UST_ABI_KEY_ARG_PADDING1 256 #define LTTNG_UST_ABI_KEY_TOKEN_STRING_LEN_MAX 256 struct lttng_ust_abi_key_token { @@ -203,6 +154,55 @@ struct lttng_ust_abi_counter_event { char padding[LTTNG_UST_ABI_COUNTER_EVENT_PADDING1]; } __attribute__((packed)); +enum lttng_ust_abi_counter_dimension_flags { + LTTNG_UST_ABI_COUNTER_DIMENSION_FLAG_UNDERFLOW = (1 << 0), + LTTNG_UST_ABI_COUNTER_DIMENSION_FLAG_OVERFLOW = (1 << 1), +}; + +struct lttng_ust_abi_counter_dimension { + uint32_t flags; /* enum lttng_ust_abi_counter_dimension_flags */ + uint64_t size; /* dimension size */ + uint64_t underflow_index; + uint64_t overflow_index; +} __attribute__((packed)); + +enum lttng_ust_abi_counter_conf_flags { + LTTNG_UST_ABI_COUNTER_CONF_FLAG_COALESCE_HITS = (1 << 0), +}; + +struct lttng_ust_abi_counter_conf { + uint32_t len; /* Length of fields before var. len. data. */ + uint32_t flags; /* enum lttng_ust_abi_counter_conf_flags */ + uint32_t arithmetic; /* enum lttng_ust_abi_counter_arithmetic */ + uint32_t bitness; /* enum lttng_ust_abi_counter_bitness */ + int64_t global_sum_step; + uint32_t number_dimensions; + uint32_t elem_len; /* array stride (size of lttng_ust_abi_counter_dimension) */ +} __attribute__((packed)); + +struct lttng_ust_abi_counter_value { + uint32_t number_dimensions; + uint64_t dimension_indexes[LTTNG_UST_ABI_COUNTER_DIMENSION_MAX]; + int64_t value; +} __attribute__((packed)); + +#define LTTNG_UST_ABI_COUNTER_DATA_MAX_LEN 4096U +struct lttng_ust_abi_counter { + uint64_t len; + char data[]; /* variable sized data */ +} __attribute__((packed)); + +struct lttng_ust_abi_counter_global { + uint32_t len; /* Length of this structure */ + uint64_t shm_len; /* shm len */ +} __attribute__((packed)); + +struct lttng_ust_abi_counter_cpu { + uint32_t len; /* Length of this structure */ + uint64_t shm_len; /* shm len */ + uint32_t cpu_nr; +} __attribute__((packed)); + enum lttng_ust_abi_field_type { LTTNG_UST_ABI_FIELD_OTHER = 0, LTTNG_UST_ABI_FIELD_INTEGER = 1, -- 2.34.1