From: Mathieu Desnoyers Date: Thu, 24 Oct 2024 21:04:32 +0000 (-0400) Subject: static checker: add side_statedump_event_call and side_statedump_event_call_variadic X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=bd343d058b4d208c661a84f8a48b2f7cfa8acd12;p=libside.git static checker: add side_statedump_event_call and side_statedump_event_call_variadic Add side_statedump_event_call and side_statedump_event_call_variadic to the static checker. This will allow enabling the static checker by default (opt-out). Change-Id: Ie61a90af5911b7abe21037caa0e22630e1ae753c Signed-off-by: Mathieu Desnoyers --- diff --git a/include/side/static-check.h b/include/side/static-check.h index c4b7d45..88f5b14 100644 --- a/include/side/static-check.h +++ b/include/side/static-check.h @@ -2610,6 +2610,19 @@ SIDE_SC_DEFINE_TYPE(dynamic); SIDE_DEFAULT_ATTR(_, ##_attr, side_dynamic_attr_list())); \ SIDE_SC_CHECK_EVENT_CALL_VARIADIC(_identifier, _sav) +/* Dispatch: statedump_event_call */ +#undef side_statedump_event_call +#define side_statedump_event_call(_identifier, _key, _sav, _attr...) \ + _side_statedump_event_call(side_statedump_call, _identifier, _key, SIDE_SC_EMIT_##_sav); \ + SIDE_SC_CHECK_EVENT_CALL(_identifier, _sav) + +/* Dispatch: statedump_event_call */ +#undef side_statedump_event_call_variadic +#define side_statedump_event_call_variadic(_identifier, _key, _sav, _var_fields, _attr...) \ + _side_statedump_event_call_variadic(side_statedump_call_variadic, _identifier, _key, SIDE_SC_EMIT_##_sav, SIDE_SC_EMIT_##_var_fields, \ + SIDE_DEFAULT_ATTR(_, ##_attr, side_dynamic_attr_list())); \ + SIDE_SC_CHECK_EVENT_CALL_VARIADIC(_identifier, _sav) + /* Dispatch: event */ #undef side_event #define side_event(_identifier, _sav) \ @@ -2625,9 +2638,30 @@ SIDE_SC_DEFINE_TYPE(dynamic); #define side_event_variadic(_identifier, _sav, _var, _attr...) \ do { \ if (side_event_enabled(_identifier)) { \ - SIDE_SC_CHECK_EVENT_CALL_VARIADIC(_identifier, _sav); \ _side_event_call_variadic(side_call_variadic, _identifier, SIDE_SC_EMIT_##_sav, SIDE_SC_EMIT_##_var, \ SIDE_DEFAULT_ATTR(_, ##_attr, side_dynamic_attr_list())); \ + SIDE_SC_CHECK_EVENT_CALL_VARIADIC(_identifier, _sav); \ + } \ + } while(0) + +/* Dispatch: statedump_event */ +#undef side_statedump_event +#define side_statedump_event(_identifier, _key, _sav) \ + do { \ + if (side_event_enabled(_identifier)) { \ + _side_statedump_event_call(side_call, _identifier, _key, SIDE_SC_EMIT_##_sav); \ + SIDE_SC_CHECK_EVENT_CALL(_identifier, _sav); \ + } \ + } while(0) + +/* Dispatch: statedump_event_variadic */ +#undef side_statedump_event_variadic +#define side_statedump_event_variadic(_identifier, _key, _sav, _var, _attr...) \ + do { \ + if (side_event_enabled(_identifier)) { \ + _side_statedump_event_call_variadic(side_call_variadic, _identifier, _key, SIDE_SC_EMIT_##_sav, SIDE_SC_EMIT_##_var, \ + SIDE_DEFAULT_ATTR(_, ##_attr, side_dynamic_attr_list())); \ + SIDE_SC_CHECK_EVENT_CALL_VARIADIC(_identifier, _sav); \ } \ } while(0)