1 #include <side/trace.h>
4 const char *mystr
[] = {
15 side_static_event(my_provider_event_dump1
, "myprovider", "myevent_dump1", SIDE_LOGLEVEL_DEBUG
,
16 side_field_list(side_field_string("mystatestring"))
19 side_static_event(my_provider_event_dump2
, "myprovider", "myevent_dump2", SIDE_LOGLEVEL_DEBUG
,
20 side_field_list(side_field_s32("mystateint"))
23 side_static_event(my_provider_event
, "myprovider", "myevent", SIDE_LOGLEVEL_DEBUG
,
24 side_field_list(side_field_s32("myfield"))
27 static struct side_statedump_request_handle
*statedump_request_handle
;
30 void statedump_cb(void)
34 printf("Executing application state dump callback\n");
35 side_event_cond(my_provider_event_dump1
) {
36 for (i
= 0; i
< SIDE_ARRAY_SIZE(mystr
); i
++) {
37 side_statedump_event_call(my_provider_event_dump1
,
38 side_arg_list(side_arg_string(mystr
[i
])));
41 side_event_cond(my_provider_event_dump2
) {
42 for (i
= 0; i
< SIDE_ARRAY_SIZE(myint
); i
++) {
43 side_statedump_event_call(my_provider_event_dump2
,
44 side_arg_list(side_arg_s32(myint
[i
])));
49 static void my_constructor(void)
50 __attribute((constructor
));
51 static void my_constructor(void)
53 side_event_description_ptr_init();
54 statedump_request_handle
= side_statedump_request_notification_register("mystatedump",
55 statedump_cb
, SIDE_STATEDUMP_MODE_AGENT_THREAD
);
56 if (!statedump_request_handle
)
60 static void my_destructor(void)
61 __attribute((destructor
));
62 static void my_destructor(void)
64 side_statedump_request_notification_unregister(statedump_request_handle
);
65 side_event_description_ptr_exit();
70 side_event(my_provider_event
, side_arg_list(side_arg_s32(42)));