X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fust%2Fprobe.h;h=fe27da2b11e1c44aad99c10c0d8d22e89810bf13;hb=3c82ede91f6c984248977a5f81eed3f7d1badfce;hp=740f7eef8f227991e6a7a6f06d5012a54e213b86;hpb=822f167a2f08bc6a4f81fbf2484dfea5f9b55e7a;p=ust.git diff --git a/include/ust/probe.h b/include/ust/probe.h index 740f7ee..fe27da2 100644 --- a/include/ust/probe.h +++ b/include/ust/probe.h @@ -1,13 +1,12 @@ -#ifndef _UST_PROBE_H -#define _UST_PROBE_H - /* - * Copyright (C) 2009 Pierre-Marc Fournier + * Copyright (C) 2009 Steven Rostedt + * Copyright (C) 2010 Nils Carlson + * Copyright (C) 2011 Mathieu Desnoyers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * License as published by the Free Software Foundation; + * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,32 +16,81 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * */ -/* Maximum number of callbacks per marker */ -#define LTT_NR_CALLBACKS 10 +/* + * This whole file is currently a dummy. + */ + +#include + +#undef TRACEPOINT_EVENT +#define TRACEPOINT_EVENT(name, proto, args, fields) \ + TRACEPOINT_EVENT_CLASS(name, \ + TP_PARAMS(proto), \ + TP_PARAMS(args), \ + TP_PARAMS(fields)); \ + TRACEPOINT_EVENT_INSTANCE(name, name, TP_PARAMS(proto), \ + TP_PARAMS(args)); + +#undef TRACEPOINT_EVENT_NOARGS +#define TRACEPOINT_EVENT_NOARGS(name, fields) \ + TRACEPOINT_EVENT_CLASS_NOARGS(name, \ + TP_PARAMS(fields)); \ + TRACEPOINT_EVENT_INSTANCE_NOARGS(name, name); + +#undef tp_field +#define tp_field(type, item, src) type item; + +#undef TP_FIELDS +#define TP_FIELDS(args...) args -struct ltt_serialize_closure; +#undef TRACEPOINT_EVENT_INSTANCE +#define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) -typedef size_t (*ltt_serialize_cb)(struct ust_buffer *buf, size_t buf_offset, - struct ltt_serialize_closure *closure, - void *serialize_private, int *largest_align, - const char *fmt, va_list *args); +#undef TRACEPOINT_EVENT_INSTANCE_NOARGS +#define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) -struct ltt_available_probe { - const char *name; /* probe name */ - const char *format; - marker_probe_func *probe_func; - ltt_serialize_cb callbacks[LTT_NR_CALLBACKS]; - struct list_head node; /* registered probes list */ -}; +#undef TRACEPOINT_EVENT_CLASS +#define TRACEPOINT_EVENT_CLASS(name, proto, args, fields) \ + struct trace_raw_##name { \ + fields \ + }; \ + static void trace_printf_##name(void *dummy, proto) \ + { \ + } \ + struct trace_event __event_##name = { \ + __tpstrtab_##name, \ + }; \ + static struct trace_event * const __event_ptrs_##name \ + __attribute__((used, section("__trace_events_ptrs"))) = \ + &__event_##name; \ + \ + static void __attribute__((constructor)) init_##name() \ + { \ + void *dummy = NULL; \ + __register_tracepoint(name, trace_printf_##name, dummy);\ + } -extern int ltt_probe_register(struct ltt_available_probe *pdata); -extern int ltt_probe_unregister(struct ltt_available_probe *pdata); -extern int ltt_marker_connect(const char *channel, const char *mname, - const char *pname); -extern int ltt_marker_disconnect(const char *channel, const char *mname, - const char *pname); +#undef TRACEPOINT_EVENT_CLASS_NOARGS +#define TRACEPOINT_EVENT_CLASS_NOARGS(name, fields) \ + struct trace_raw_##name { \ + fields \ + }; \ + static void trace_printf_##name(void *dummy) \ + { \ + } \ + struct trace_event __event_##name = { \ + __tpstrtab_##name, \ + }; \ + static struct trace_event * const __event_ptrs_##name \ + __attribute__((used, section("__trace_events_ptrs"))) = \ + &__event_##name; \ + \ + static void __attribute__((constructor)) init_##name() \ + { \ + void *dummy = NULL; \ + __register_tracepoint(name, trace_printf_##name, dummy);\ + } -#endif /* _UST_PROBE_H */ +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)