void *side_vla_app_visitor_ctx;
/* Gather basic types */
- void *side_bool_gather_ptr;
- void *side_byte_gather_ptr;
- void *side_integer_gather_ptr;
- void *side_float_gather_ptr;
- void *side_string_gather_ptr;
+ const void *side_bool_gather_ptr;
+ const void *side_byte_gather_ptr;
+ const void *side_integer_gather_ptr;
+ const void *side_float_gather_ptr;
+ const void *side_string_gather_ptr;
/* Gather compound types */
- void *side_array_gather_ptr;
- void *side_struct_gather_ptr;
+ const void *side_array_gather_ptr;
+ const void *side_struct_gather_ptr;
struct {
- void *ptr;
- void *length_ptr;
+ const void *ptr;
+ const void *length_ptr;
} SIDE_PACKED side_vla_gather;
} SIDE_PACKED;
* Explicit hooks to initialize/finalize the side instrumentation
* library. Those are also library constructor/destructor.
*/
-void side_init(void);
-void side_exit(void);
+void side_init(void) __attribute__((constructor));
+void side_exit(void) __attribute__((destructor));
/*
* The following constructors/destructors perform automatic registration
libside_la_SOURCES = \
list.h \
side.c \
- tracer.c \
- tracer.h
+ tracer.c
libside_la_LDFLAGS = -no-undefined -version-info $(SIDE_LIBRARY_VERSION)
libside_la_LIBADD = \
#include <side/trace.h>
#include <string.h>
-#include "tracer.h"
#include "rcu.h"
#include "list.h"
*/
const struct side_callback side_empty_callback = { };
-void side_init(void) __attribute__((constructor));
-void side_exit(void) __attribute__((destructor));
-
void side_call(const struct side_event_description *desc, const struct side_arg_vec *side_arg_vec)
{
struct side_rcu_read_state rcu_read_state;
return _side_tracer_callback_register(desc, (void *) call_variadic, priv);
}
-int _side_tracer_callback_unregister(struct side_event_description *desc,
+static int _side_tracer_callback_unregister(struct side_event_description *desc,
void *call, void *priv)
{
struct side_callback *old_cb, *new_cb;
#include <stddef.h>
#include <side/trace.h>
-#include "tracer.h"
/* User code example */
void test_gather_string(void)
{
side_event_cond(my_provider_event_gatherstring) {
- char *str1 = "abcdef";
- char *ptrarray[3] = {
+ const char *str1 = "abcdef";
+ const char *ptrarray[3] = {
"abc",
"def",
"ghi",
printf(" ]");
}
+static
void tracer_call(const struct side_event_description *desc,
const struct side_arg_vec *side_arg_vec,
void *priv __attribute__((unused)))
printf("\n");
}
+static
void tracer_call_variadic(const struct side_event_description *desc,
const struct side_arg_vec *side_arg_vec,
const struct side_arg_dynamic_struct *var_struct,
printf("\n");
}
+static
void tracer_event_notification(enum side_tracer_notification notif,
- struct side_event_description **events, uint32_t nr_events, void *priv)
+ struct side_event_description **events, uint32_t nr_events,
+ void *priv __attribute__((unused)))
{
uint32_t i;
int ret;
+++ /dev/null
-// SPDX-License-Identifier: MIT
-/*
- * Copyright 2022 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _TRACER_H
-#define _TRACER_H
-
-#include <side/trace.h>
-
-void tracer_call(const struct side_event_description *desc,
- const struct side_arg_vec *side_arg_vec,
- void *priv);
-void tracer_call_variadic(const struct side_event_description *desc,
- const struct side_arg_vec *side_arg_vec,
- const struct side_arg_dynamic_struct *var_struct,
- void *priv);
-
-#endif
$(top_builddir)/src/librcu.la \
$(top_builddir)/src/libsmp.la \
$(top_builddir)/src/libside.la \
- $(top_builddir)/tests/utils/libtap.la
+ $(top_builddir)/tests/utils/libtap.la \
+ $(RSEQ_LIBS)
# Currently no tap tests to run
TESTS =