* modules must be used.
*/
-#ifdef CREATE_TRACE_POINTS
+#ifdef TRACEPOINT_CREATE_PROBES
/* Prevent recursion */
-#undef CREATE_TRACE_POINTS
+#undef TRACEPOINT_CREATE_PROBES
#include <ust/kcompat/stringify.h>
-#undef TRACE_EVENT
-#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
- DEFINE_TRACE(name)
+#undef TRACEPOINT_EVENT
+#define TRACEPOINT_EVENT(name, proto, args, tstruct, assign, print) \
+ DEFINE_TRACEPOINT(name)
-#undef TRACE_EVENT_FN
-#define TRACE_EVENT_FN(name, proto, args, tstruct, \
+#undef TRACEPOINT_EVENT_FN
+#define TRACEPOINT_EVENT_FN(name, proto, args, tstruct, \
assign, print, reg, unreg) \
- DEFINE_TRACE_FN(name, reg, unreg)
+ DEFINE_TRACEPOINT_FN(name, reg, unreg)
-#undef DEFINE_TRACE_EVENT
-#define DEFINE_TRACE_EVENT(template, name, proto, args) \
- DEFINE_TRACE(name)
+#undef DEFINE_TRACEPOINT_EVENT
+#define DEFINE_TRACEPOINT_EVENT(template, name, proto, args) \
+ DEFINE_TRACEPOINT(name)
-#undef DEFINE_TRACE_EVENT_PRINT
-#define DEFINE_TRACE_EVENT_PRINT(template, name, proto, args, print) \
- DEFINE_TRACE(name)
+#undef DEFINE_TRACEPOINT_EVENT_PRINT
+#define DEFINE_TRACEPOINT_EVENT_PRINT(template, name, proto, args, print) \
+ DEFINE_TRACEPOINT(name)
-#undef DECLARE_TRACE
-#define DECLARE_TRACE(name, proto, args) \
- DEFINE_TRACE(name)
+#undef DECLARE_TRACEPOINT
+#define DECLARE_TRACEPOINT(name, proto, args) \
+ DEFINE_TRACEPOINT(name)
#undef TRACE_INCLUDE
#undef __TRACE_INCLUDE
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
-/* Make all open coded DECLARE_TRACE nops */
-#undef DECLARE_TRACE
-#define DECLARE_TRACE(name, proto, args)
+/* Make all open coded DECLARE_TRACEPOINT nops */
+#undef DECLARE_TRACEPOINT
+#define DECLARE_TRACEPOINT(name, proto, args)
#ifndef CONFIG_NO_EVENT_TRACING
#include <ust/ust_trace.h>
#endif
-#undef TRACE_EVENT
-#undef TRACE_EVENT_FN
-#undef DECLARE_TRACE_EVENT_CLASS
-#undef DEFINE_TRACE_EVENT
-#undef DEFINE_TRACE_EVENT_PRINT
+#undef TRACEPOINT_EVENT
+#undef TRACEPOINT_EVENT_FN
+#undef DECLARE_TRACEPOINT_EVENT_CLASS
+#undef DEFINE_TRACEPOINT_EVENT
+#undef DEFINE_TRACEPOINT_EVENT_PRINT
#undef TRACE_HEADER_MULTI_READ
-#undef DECLARE_TRACE
+#undef DECLARE_TRACEPOINT
/* Only undef what we defined in this file */
#ifdef UNDEF_TRACE_INCLUDE_FILE
#endif
/* We may be processing more files */
-#define CREATE_TRACE_POINTS
+#define TRACEPOINT_CREATE_PROBES
-#endif /* CREATE_TRACE_POINTS */
+#endif /* TRACEPOINT_CREATE_PROBES */
* not add unwanted padding between the beginning of the section and the
* structure. Force alignment to the same alignment as the section start.
*/
-#define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \
+#define __DECLARE_TRACEPOINT(name, proto, args, data_proto, data_args) \
extern struct tracepoint __tracepoint_##name; \
static inline void __trace_##name(proto) \
{ \
data); \
}
-#define DEFINE_TRACE_FN(name, reg, unreg) \
+#define DEFINE_TRACEPOINT_FN(name, reg, unreg) \
static const char __tpstrtab_##name[] \
__attribute__((section("__tracepoints_strings"))) = #name; \
struct tracepoint __tracepoint_##name \
__attribute__((used, section("__tracepoints_ptrs"))) = \
&__tracepoint_##name;
-#define DEFINE_TRACE(name) \
- DEFINE_TRACE_FN(name, NULL, NULL)
+#define DEFINE_TRACEPOINT(name) \
+ DEFINE_TRACEPOINT_FN(name, NULL, NULL)
extern void tracepoint_update_probe_range(struct tracepoint * const *begin,
struct tracepoint * const *end);
#else /* !CONFIG_TRACEPOINTS */
-#define __DECLARE_TRACE(name, proto, args) \
+#define __DECLARE_TRACEPOINT(name, proto, args) \
static inline void trace_##name(proto) \
{ } \
static inline void _trace_##name(proto) \
return -ENOSYS; \
}
-#define DEFINE_TRACE(name)
+#define DEFINE_TRACEPOINT(name)
#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
#define EXPORT_TRACEPOINT_SYMBOL(name)
#endif /* CONFIG_TRACEPOINTS */
/*
- * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype
+ * The need for the DECLARE_TRACEPOINT_NOARGS() is to handle the prototype
* (void). "void" is a special value in a function prototype and can
- * not be combined with other arguments. Since the DECLARE_TRACE()
+ * not be combined with other arguments. Since the DECLARE_TRACEPOINT()
* macro adds a data element at the beginning of the prototype,
* we need a way to differentiate "(void *data, proto)" from
* "(void *data, void)". The second prototype is invalid.
*
- * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype
+ * DECLARE_TRACEPOINT_NOARGS() passes "void" as the tracepoint prototype
* and "void *__tp_cb_data" as the callback prototype.
*
- * DECLARE_TRACE() passes "proto" as the tracepoint protoype and
+ * DECLARE_TRACEPOINT() passes "proto" as the tracepoint protoype and
* "void *__tp_cb_data, proto" as the callback prototype.
*/
-#define DECLARE_TRACE_NOARGS(name) \
- __DECLARE_TRACE(name, void, , void *__tp_cb_data, __tp_cb_data)
+#define DECLARE_TRACEPOINT_NOARGS(name) \
+ __DECLARE_TRACEPOINT(name, void, , void *__tp_cb_data, __tp_cb_data)
-#define DECLARE_TRACE(name, proto, args) \
- __DECLARE_TRACE(name, TP_PARAMS(proto), TP_PARAMS(args),\
+#define DECLARE_TRACEPOINT(name, proto, args) \
+ __DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args),\
TP_PARAMS(void *__tp_cb_data, proto), \
TP_PARAMS(__tp_cb_data, args))
}
-#ifndef TRACE_EVENT
+#ifndef TRACEPOINT_EVENT
/*
- * For use with the TRACE_EVENT macro:
+ * For use with the TRACEPOINT_EVENT macro:
*
* We define a tracepoint, its arguments, its printf format
* and its 'fast binary record' layout.
*
- * Firstly, name your tracepoint via TRACE_EVENT(name : the
+ * Firstly, name your tracepoint via TRACEPOINT_EVENT(name : the
* 'subsystem_event' notation is fine.
*
* Think about this whole construct as the
* 'trace_sched_switch() function' from now on.
*
*
- * TRACE_EVENT(sched_switch,
+ * TRACEPOINT_EVENT(sched_switch,
*
* *
* * A function has a regular function arguments
* tracing setup.
*
* A set of (un)registration functions can be passed to the variant
- * TRACE_EVENT_FN to perform any (un)registration work.
+ * TRACEPOINT_EVENT_FN to perform any (un)registration work.
*/
struct trace_event {
extern int trace_event_unregister_lib(struct trace_event * const *start_trace_events);
-#define TRACE_EVENT_LIB \
+#define TRACEPOINT_EVENT_LIB \
extern struct trace_event * const __start___trace_events_ptrs[] \
__attribute__((weak, visibility("hidden"))); \
extern struct trace_event * const __stop___trace_events_ptrs[] \
trace_event_unregister_lib(__start___trace_events_ptrs);\
}
-#define DECLARE_TRACE_EVENT_CLASS(name, proto, args, tstruct, assign, print)
-#define DEFINE_TRACE_EVENT(template, name, proto, args) \
- DECLARE_TRACE(name, TP_PARAMS(proto), TP_PARAMS(args))
-#define DEFINE_TRACE_EVENT_PRINT(template, name, proto, args, print) \
- DECLARE_TRACE(name, TP_PARAMS(proto), TP_PARAMS(args))
+#define DECLARE_TRACEPOINT_EVENT_CLASS(name, proto, args, tstruct, assign, print)
+#define DEFINE_TRACEPOINT_EVENT(template, name, proto, args) \
+ DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args))
+#define DEFINE_TRACEPOINT_EVENT_PRINT(template, name, proto, args, print)\
+ DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args))
-#define TRACE_EVENT(name, proto, args, struct, assign, print) \
- DECLARE_TRACE(name, TP_PARAMS(proto), TP_PARAMS(args))
-#define TRACE_EVENT_FN(name, proto, args, struct, \
+#define TRACEPOINT_EVENT(name, proto, args, struct, assign, print) \
+ DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args))
+#define TRACEPOINT_EVENT_FN(name, proto, args, struct, \
assign, print, reg, unreg) \
- DECLARE_TRACE(name, TP_PARAMS(proto), TP_PARAMS(args))
+ DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args))
-#endif /* ifdef TRACE_EVENT (see note above) */
+#endif /* ifdef TRACEPOINT_EVENT (see note above) */
#endif /* _UST_TRACEPOINT_H */
/*
* Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
* Copyright (C) 2010 Nils Carlson <nils.carlson@ericsson.com>
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* 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
- *
*/
/*
- * This whole file is currently a dummy, mapping a TRACE_EVENT
+ * This whole file is currently a dummy, mapping a TRACEPOINT_EVENT
* to a printf
*/
* Stage 1. Create a struct and a printf calling function
* that is connected to the tracepoint at load time.
*/
-#undef TRACE_EVENT
-#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
- DECLARE_TRACE_EVENT_CLASS(name, \
+#undef TRACEPOINT_EVENT
+#define TRACEPOINT_EVENT(name, proto, args, tstruct, assign, print) \
+ DECLARE_TRACEPOINT_EVENT_CLASS(name, \
TP_PARAMS(proto), \
TP_PARAMS(args), \
TP_PARAMS(tstruct), \
TP_PARAMS(assign), \
TP_PARAMS(print)); \
- DEFINE_TRACE_EVENT(name, name, TP_PARAMS(proto), TP_PARAMS(args));
+ DEFINE_TRACEPOINT_EVENT(name, name, TP_PARAMS(proto), TP_PARAMS(args));
#undef __field
#define __field(type, item) type item;
#undef TP_fast_assign
#define TP_fast_assign(args...) args
-#undef DEFINE_TRACE_EVENT
-#define DEFINE_TRACE_EVENT(template, name, proto, args)
+#undef DEFINE_TRACEPOINT_EVENT
+#define DEFINE_TRACEPOINT_EVENT(template, name, proto, args)
-#undef DECLARE_TRACE_EVENT_CLASS
-#define DECLARE_TRACE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \
+#undef DECLARE_TRACEPOINT_EVENT_CLASS
+#define DECLARE_TRACEPOINT_EVENT_CLASS(name, proto, args, tstruct, assign, print) \
struct trace_raw_##name { \
tstruct \
}; \
UST_MARKER_LIB;
TRACEPOINT_LIB;
-TRACE_EVENT_LIB;
+TRACEPOINT_EVENT_LIB;
#undef TRACE_SYSTEM
#define TRACE_SYSTEM ust_dummy
-#if !defined(_TRACE_EVENT_TEST_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_EVENT_TEST_H
+#if !defined(_TRACEPOINT_EVENT_TEST_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACEPOINT_EVENT_TEST_H
#include <ust/tracepoint.h>
-TRACE_EVENT(ust_dummy_event,
+TRACEPOINT_EVENT(ust_dummy_event,
TP_PROTO(int dummy_int),
TP_printf("dummy=%d", __entry->dummy)
);
-#endif /* _TRACE_EVENT_TEST_H */
+#endif /* _TRACEPOINT_EVENT_TEST_H */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
.message = "ehlo\n",
};
-DEFINE_TRACE(hello_tptest);
+DEFINE_TRACEPOINT(hello_tptest);
void tptest_probe(void *data, int anint)
{
#include <ust/tracepoint.h>
-DECLARE_TRACE(hello_tptest,
- TP_PROTO(int anint),
- TP_ARGS(anint));
+DECLARE_TRACEPOINT(hello_tptest,
+ TP_PROTO(int anint),
+ TP_ARGS(anint));
-DECLARE_TRACE_NOARGS(hello_tptest2);
+DECLARE_TRACEPOINT_NOARGS(hello_tptest2);
#include "usterr.h"
#include "tp.h"
-DEFINE_TRACE(hello_tptest);
+DEFINE_TRACEPOINT(hello_tptest);
struct hello_trace_struct {
#include <ust/tracepoint.h>
-DECLARE_TRACE(hello_tptest,
- TP_PROTO(int anint),
- TP_ARGS(anint));
+DECLARE_TRACEPOINT(hello_tptest,
+ TP_PROTO(int anint),
+ TP_ARGS(anint));
#include <stdio.h>
#include <ust/clock.h>
-#define CREATE_TRACE_POINTS
+#define TRACEPOINT_CREATE_PROBES
#include "trace_event_test.h"
int main(int argc, char * argv[])
#undef TRACE_SYSTEM
#define TRACE_SYSTEM trace_event_test
-#if !defined(_TRACE_EVENT_TEST_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_EVENT_TEST_H
+#if !defined(_TRACEPOINT_EVENT_TEST_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACEPOINT_EVENT_TEST_H
#include <ust/tracepoint.h>
-TRACE_EVENT(test,
+TRACEPOINT_EVENT(test,
TP_PROTO(unsigned long time, unsigned long count),
TP_printf("time=%lu count=%lu", __entry->time, __entry->count)
);
-#endif /* _TRACE_EVENT_TEST_H */
+#endif /* _TRACEPOINT_EVENT_TEST_H */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define NR_EVENTS 10000000
-DEFINE_TRACE(ust_event);
+DEFINE_TRACEPOINT(ust_event);
void tp_probe(void *data, unsigned int p1);
#include <ust/tracepoint.h>
-DECLARE_TRACE(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
+DECLARE_TRACEPOINT(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
#include <ust/marker.h>
#include "tracepoint_test.h"
-DEFINE_TRACE(ust_event);
-DEFINE_TRACE(ust_event2);
+DEFINE_TRACEPOINT(ust_event);
+DEFINE_TRACEPOINT(ust_event2);
static struct message msg_probe3 = {
.payload = "probe3",
#include <ust/tracepoint.h>
-DECLARE_TRACE(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
-DECLARE_TRACE(ust_event2, TP_PROTO(unsigned int v), TP_ARGS(v));
+DECLARE_TRACEPOINT(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
+DECLARE_TRACEPOINT(ust_event2, TP_PROTO(unsigned int v), TP_ARGS(v));
struct message {
char *payload;