*/
struct tracepoint_probe {
- void *func;
+ void (*func)(void);
void *data;
};
if (caa_unlikely(!__tp_probe)) \
goto end; \
do { \
- void *__tp_cb = __tp_probe->func; \
+ void (*__tp_cb)(void) = __tp_probe->func; \
void *__tp_data = __tp_probe->data; \
\
URCU_FORCE_CAST(void (*)(_TP_ARGS_DATA_PROTO(__VA_ARGS__)), __tp_cb) \
tp_rcu_read_unlock_bp(); \
} \
static inline void __tracepoint_register_##_provider##___##_name(char *name, \
- void *func, void *data) \
+ void (*func)(void), void *data) \
{ \
__tracepoint_probe_register(name, func, data, \
__tracepoint_##_provider##___##_name.signature); \
} \
static inline void __tracepoint_unregister_##_provider##___##_name(char *name, \
- void *func, void *data) \
+ void (*func)(void), void *data) \
{ \
__tracepoint_probe_unregister(name, func, data); \
}
-extern int __tracepoint_probe_register(const char *name, void *func, void *data,
- const char *signature);
-extern int __tracepoint_probe_unregister(const char *name, void *func, void *data);
+extern int __tracepoint_probe_register(const char *name, void (*func)(void),
+ void *data, const char *signature);
+extern int __tracepoint_probe_unregister(const char *name, void (*func)(void),
+ void *data);
/*
* tracepoint dynamic linkage handling (callbacks). Hidden visibility:
#define LTTNG_UST_EVENT_DESC_PADDING 40
struct lttng_event_desc {
const char *name;
- void *probe_callback;
+ void (*probe_callback)(void);
const struct lttng_event_ctx *ctx; /* context */
const struct lttng_event_field *fields; /* event payload */
unsigned int nr_fields;
};
struct ust_pending_probe;
+struct ltt_event;
/*
* ltt_event structure is referred to by the tracing fast path. It must be
struct ltt_channel *chan;
int enabled;
const struct lttng_event_desc *desc;
- void *filter;
+ void (*filter)(struct ltt_event *event);
struct lttng_ctx *ctx;
enum lttng_ust_instrumentation instrumentation;
union {
int ltt_event_create(struct ltt_channel *chan,
struct lttng_ust_event *event_param,
- void *filter,
+ void (*filter)(struct ltt_event *event),
struct ltt_event **event);
int ltt_channel_enable(struct ltt_channel *channel);
const struct lttng_event_desc __event_desc___##_provider##_##_name = { \
.fields = __event_fields___##_provider##___##_template, \
.name = #_provider ":" #_name, \
- .probe_callback = (void *) &__event_probe__##_provider##___##_template,\
+ .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\
.nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \
.loglevel = &__ref_loglevel___##_provider##___##_name, \
.signature = __tp_event_signature___##_provider##___##_template, \
*/
int ltt_event_create(struct ltt_channel *chan,
struct lttng_ust_event *event_param,
- void *filter,
+ void (*filter)(struct ltt_event *event),
struct ltt_event **_event)
{
const struct lttng_event_desc *desc = NULL; /* silence gcc */
};
extern int tracepoint_probe_register_noupdate(const char *name,
- void *callback, void *priv,
+ void (*callback)(void), void *priv,
const char *signature);
extern int tracepoint_probe_unregister_noupdate(const char *name,
- void *callback, void *priv);
+ void (*callback)(void), void *priv);
extern void tracepoint_probe_update_all(void);
/*
static void *
tracepoint_entry_add_probe(struct tracepoint_entry *entry,
- void *probe, void *data)
+ void (*probe)(void), void *data)
{
int nr_probes = 0;
struct tracepoint_probe *old, *new;
}
static void *
-tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe,
- void *data)
+tracepoint_entry_remove_probe(struct tracepoint_entry *entry,
+ void (*probe)(void), void *data)
{
int nr_probes = 0, nr_del = 0, i;
struct tracepoint_probe *old, *new;
}
static struct tracepoint_probe *
-tracepoint_add_probe(const char *name, void *probe, void *data,
+tracepoint_add_probe(const char *name, void (*probe)(void), void *data,
const char *signature)
{
struct tracepoint_entry *entry;
* The probe address must at least be aligned on the architecture pointer size.
* Called with the tracepoint mutex held.
*/
-int __tracepoint_probe_register(const char *name, void *probe, void *data,
- const char *signature)
+int __tracepoint_probe_register(const char *name, void (*probe)(void),
+ void *data, const char *signature)
{
void *old;
int ret = 0;
return ret;
}
-static void *tracepoint_remove_probe(const char *name, void *probe, void *data)
+static void *tracepoint_remove_probe(const char *name, void (*probe)(void),
+ void *data)
{
struct tracepoint_entry *entry;
void *old;
* @probe: probe function pointer
* @probe: probe data pointer
*/
-int __tracepoint_probe_unregister(const char *name, void *probe, void *data)
+int __tracepoint_probe_unregister(const char *name, void (*probe)(void),
+ void *data)
{
void *old;
int ret = 0;
*
* caller must call tracepoint_probe_update_all()
*/
-int tracepoint_probe_register_noupdate(const char *name, void *probe,
+int tracepoint_probe_register_noupdate(const char *name, void (*probe)(void),
void *data, const char *signature)
{
void *old;
* caller must call tracepoint_probe_update_all()
* Called with the tracepoint mutex held.
*/
-int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
+int tracepoint_probe_unregister_noupdate(const char *name, void (*probe)(void),
void *data)
{
void *old;