#define side_arg_list(...) __VA_ARGS__
-#define side_event_cond(_identifier) \
- if (side_unlikely(__atomic_load_n(&side_event_state__##_identifier.enabled, \
- __ATOMIC_RELAXED)))
+#define side_event_enabled(_identifier) \
+ side_unlikely(__atomic_load_n(&side_event_state__##_identifier.enabled, \
+ __ATOMIC_RELAXED))
#define _side_event_call(_call, _identifier, _sav) \
{ \
_side_event_call(side_call, _identifier, SIDE_PARAM(_sav))
#define side_event(_identifier, _sav) \
- side_event_cond(_identifier) \
+ if (side_event_enabled(_identifier)) \
side_event_call(_identifier, SIDE_PARAM(_sav))
#define _side_event_call_variadic(_call, _identifier, _sav, _var_fields, _attr...) \
_side_event_call_variadic(side_call_variadic, _identifier, SIDE_PARAM(_sav), SIDE_PARAM(_var_fields), SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list()))
#define side_event_variadic(_identifier, _sav, _var, _attr...) \
- side_event_cond(_identifier) \
+ if (side_event_enabled(_identifier)) \
side_event_call_variadic(_identifier, SIDE_PARAM(_sav), SIDE_PARAM(_var), SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list()))
#define _side_statedump_event_call(_call, _identifier, _key, _sav) \
static
void test_struct_literal(void)
{
- side_event_cond(my_provider_event_struct_literal) {
+ if (side_event_enabled(my_provider_event_struct_literal)) {
side_arg_define_vec(mystruct, side_arg_list(side_arg_u32(21), side_arg_s64(22)));
side_event_call(my_provider_event_struct_literal, side_arg_list(side_arg_struct(&mystruct), side_arg_u8(55)));
}
static
void test_struct(void)
{
- side_event_cond(my_provider_event_struct) {
+ if (side_event_enabled(my_provider_event_struct)) {
side_arg_define_vec(mystruct, side_arg_list(side_arg_u32(21), side_arg_s64(22)));
side_event_call(my_provider_event_struct, side_arg_list(side_arg_struct(&mystruct), side_arg_u8(55)));
}
static
void test_array(void)
{
- side_event_cond(my_provider_event_array) {
+ if (side_event_enabled(my_provider_event_array)) {
side_arg_define_vec(myarray, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
side_event_call(my_provider_event_array, side_arg_list(side_arg_array(&myarray), side_arg_s64(42)));
}
static
void test_vla(void)
{
- side_event_cond(my_provider_event_vla) {
+ if (side_event_enabled(my_provider_event_vla)) {
side_arg_define_vec(myvla, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
side_event_call(my_provider_event_vla, side_arg_list(side_arg_vla(&myvla), side_arg_s64(42)));
}
static
void test_vla_visitor(void)
{
- side_event_cond(my_provider_event_vla_visitor) {
+ if (side_event_enabled(my_provider_event_vla_visitor)) {
struct app_visitor_ctx ctx = {
.ptr = testarray,
.length = SIDE_ARRAY_SIZE(testarray),
static
void test_vla_visitor_2d(void)
{
- side_event_cond(my_provider_event_vla_visitor2d) {
+ if (side_event_enabled(my_provider_event_vla_visitor2d)) {
struct app_visitor_2d_outer_ctx ctx = {
.ptr = testarray2d,
.length = SIDE_ARRAY_SIZE(testarray2d),
static
void test_dynamic_vla_with_visitor(void)
{
- side_event_cond(my_provider_event_dynamic_vla_visitor) {
+ if (side_event_enabled(my_provider_event_dynamic_vla_visitor)) {
struct app_dynamic_vla_visitor_ctx ctx = {
.ptr = testarray_dynamic_vla,
.length = SIDE_ARRAY_SIZE(testarray_dynamic_vla),
static
void test_dynamic_struct_with_visitor(void)
{
- side_event_cond(my_provider_event_dynamic_struct_visitor) {
+ if (side_event_enabled(my_provider_event_dynamic_struct_visitor)) {
struct app_dynamic_struct_visitor_ctx ctx = {
.ptr = testarray_dynamic_struct,
.length = SIDE_ARRAY_SIZE(testarray_dynamic_struct),
static
void test_variadic_struct_attr(void)
{
- side_event_cond(my_provider_event_variadic_struct_attr) {
+ if (side_event_enabled(my_provider_event_variadic_struct_attr)) {
side_arg_dynamic_define_struct(mystruct,
side_arg_list(
side_arg_dynamic_field("a",
static
void test_enum_bitmap(void)
{
- side_event_cond(my_provider_event_enum_bitmap) {
+ if (side_event_enabled(my_provider_event_enum_bitmap)) {
side_arg_define_vec(myarray,
side_arg_list(
side_arg_u32(0),
static
void test_blob(void)
{
- side_event_cond(my_provider_event_blob) {
+ if (side_event_enabled(my_provider_event_blob)) {
side_arg_define_vec(myarray, side_arg_list(side_arg_byte(1), side_arg_byte(2), side_arg_byte(3)));
side_arg_dynamic_define_vec(myvla,
side_arg_list(
static
void test_fmt_string(void)
{
- side_event_cond(my_provider_event_format_string) {
+ if (side_event_enabled(my_provider_event_format_string)) {
side_arg_dynamic_define_vec(args,
side_arg_list(
side_arg_dynamic_string("blah"),
static
void test_struct_gather(void)
{
- side_event_cond(my_provider_event_structgather) {
+ if (side_event_enabled(my_provider_event_structgather)) {
struct test mystruct = {
.a = 55,
.b = 123,
static
void test_struct_gather_nest_ptr(void)
{
- side_event_cond(my_provider_event_structgather_nest) {
+ if (side_event_enabled(my_provider_event_structgather_nest)) {
struct testnest2 mystruct2 = {
.c = 77,
};
static
void test_struct_gather_float(void)
{
- side_event_cond(my_provider_event_structgatherfloat) {
+ if (side_event_enabled(my_provider_event_structgatherfloat)) {
struct testfloat mystruct = {
#if __HAVE_FLOAT16
.f16 = 1.1,
static
void test_array_gather(void)
{
- side_event_cond(my_provider_event_structgatherarray) {
+ if (side_event_enabled(my_provider_event_structgatherarray)) {
struct testarray mystruct = {
.a = 55,
.ptr = mygatherarray,
static
void test_gather_structnest(void)
{
- side_event_cond(my_provider_event_gatherstructnest) {
+ if (side_event_enabled(my_provider_event_gatherstructnest)) {
struct testgatherstructnest0 mystruct = {
.nest = {
.b = 66,
static
void test_gather_vla(void)
{
- side_event_cond(my_provider_event_gathervla) {
+ if (side_event_enabled(my_provider_event_gathervla)) {
struct testgathervla mystruct = {
.a = 55,
.len = SIDE_ARRAY_SIZE(gathervla),
static
void test_gather_vla_flex(void)
{
- side_event_cond(my_provider_event_gathervlaflex) {
+ if (side_event_enabled(my_provider_event_gathervlaflex)) {
struct testgathervlaflex *mystruct =
(struct testgathervlaflex *) malloc(sizeof(*mystruct) + VLAFLEXLEN * sizeof(uint64_t));
static
void test_gather_byte(void)
{
- side_event_cond(my_provider_event_gatherbyte) {
+ if (side_event_enabled(my_provider_event_gatherbyte)) {
uint8_t v = 0x44;
uint8_t array[3] = { 0x1, 0x2, 0x3 };
static
void test_gather_bool(void)
{
- side_event_cond(my_provider_event_structgatherarray) {
+ if (side_event_enabled(my_provider_event_structgatherarray)) {
bool v1 = true;
bool v2 = false;
uint16_t v3 = 1U << 1;
static
void test_gather_pointer(void)
{
- side_event_cond(my_provider_event_structgatherarray) {
+ if (side_event_enabled(my_provider_event_structgatherarray)) {
void *v = (void *)0x44;
void *array[3] = { (void *)0x1, (void *)0x2, (void *)0x3 };
static
void test_gather_string(void)
{
- side_event_cond(my_provider_event_gatherstring) {
+ if (side_event_enabled(my_provider_event_gatherstring)) {
const char *str1 = "abcdef";
const char *ptrarray[3] = {
"abc",
static
void test_variant(void)
{
- side_event_cond(my_provider_event_variant) {
+ if (side_event_enabled(my_provider_event_variant)) {
side_arg_define_variant(myvariant1, side_arg_u32(2), side_arg_u16(4));
side_arg_define_variant(myvariant2, side_arg_u32(5), side_arg_string("abc"));
static
void test_integer128(void)
{
- side_event_cond(my_provider_event_integer128) {
+ if (side_event_enabled(my_provider_event_integer128)) {
__int128 s_v128 = 0;
unsigned __int128 u_v128;
)
);
}
- side_event_cond(my_provider_event_integer128) {
+ if (side_event_enabled(my_provider_event_integer128)) {
__int128 s_v128 = 0;
unsigned __int128 u_v128;
)
);
}
- side_event_cond(my_provider_event_integer128) {
+ if (side_event_enabled(my_provider_event_integer128)) {
__int128 s_v128 = 0;
unsigned __int128 u_v128;