-#define tracepoint(name, args...) __trace_##name(args)
+#define tracepoint(provider, name, args...) \
+ __trace_##provider##___##name(args)
- if (caa_unlikely(__tracepoint_##name.state)) \
- __DO_TRACE(&__tracepoint_##name, \
+ if (caa_unlikely(__tracepoint_##provider##___##name.state)) \
+ __DO_TRACE(&__tracepoint_##provider##___##name, \
* not add unwanted padding between the beginning of the section and the
* structure. Force alignment to the same alignment as the section start.
*/
* 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_TRACEPOINT(name, proto, args, data_proto, data_args) \
- extern struct tracepoint __tracepoint_##name; \
- static inline void __trace_##name(proto) \
+#define __DECLARE_TRACEPOINT(provider, name, proto, args, data_proto, data_args) \
+ extern struct tracepoint __tracepoint_##provider##___##name; \
+ static inline void __trace_##provider##___##name(proto) \
- __CHECK_TRACE(name, TP_PROTO(data_proto), \
+ __CHECK_TRACE(provider, name, TP_PROTO(data_proto), \
* DECLARE_TRACEPOINT() passes "proto" as the tracepoint protoype and
* "void *__tp_cb_data, proto" as the callback prototype.
*/
* DECLARE_TRACEPOINT() passes "proto" as the tracepoint protoype and
* "void *__tp_cb_data, proto" as the callback prototype.
*/
-#define _DECLARE_TRACEPOINT_NOARGS(name) \
- __DECLARE_TRACEPOINT(name, void, , void *__tp_cb_data, __tp_cb_data)
+#define _DECLARE_TRACEPOINT_NOARGS(provider, name) \
+ __DECLARE_TRACEPOINT(provider, name, void, , void *__tp_cb_data, __tp_cb_data)
-#define _DECLARE_TRACEPOINT(name, proto, args) \
- __DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args), \
+#define _DECLARE_TRACEPOINT(provider, name, proto, args) \
+ __DECLARE_TRACEPOINT(provider, name, TP_PARAMS(proto), TP_PARAMS(args), \
TP_PARAMS(void *__tp_cb_data, proto), \
TP_PARAMS(__tp_cb_data, args))
TP_PARAMS(void *__tp_cb_data, proto), \
TP_PARAMS(__tp_cb_data, args))
* __tracepoints_ptrs section is not const (read-only) to let the linker update
* the pointer, allowing PIC code.
*/
* __tracepoints_ptrs section is not const (read-only) to let the linker update
* the pointer, allowing PIC code.
*/
-#define _DEFINE_TRACEPOINT(name) \
- static const char __tpstrtab_##name[] \
- __attribute__((section("__tracepoints_strings"))) = #name; \
- struct tracepoint __tracepoint_##name \
+#define _DEFINE_TRACEPOINT(provider, name) \
+ static const char __tpstrtab_##provider##___##name[] \
+ __attribute__((section("__tracepoints_strings"))) = \
+ #provider ":" #name; \
+ struct tracepoint __tracepoint_##provider##___##name \
- { __tpstrtab_##name, 0, NULL }; \
- static struct tracepoint * __tracepoint_ptr_##name \
+ { __tpstrtab_##provider##___##name, 0, NULL }; \
+ static struct tracepoint * __tracepoint_ptr_##provider##___##name \
-#define __register_tracepoint(name, probe, data) \
- __register_trace_##name(probe, data)
-#define __unregister_tracepoint(name, probe, data) \
- __unregister_trace_##name(probe, data)
+#define __register_tracepoint(provider, name, probe, data) \
+ __register_trace_##provider##___##name(probe, data)
+#define __unregister_tracepoint(provider, name, probe, data) \
+ __unregister_trace_##provider##___##name(probe, data)
* TP_PROTO(int arg0, void *arg1, char *string, size_t strlen,
* long *arg4, size_t arg4_len),
* TP_ARGS(arg0, arg1, string, strlen, arg4, arg4_len),
* TP_PROTO(int arg0, void *arg1, char *string, size_t strlen,
* long *arg4, size_t arg4_len),
* TP_ARGS(arg0, arg1, string, strlen, arg4, arg4_len),
- * Firstly, name your tracepoint via TRACEPOINT_EVENT(name,
+ * Firstly, name your tracepoint via TRACEPOINT_EVENT(provider, name,
- * The name should be a proper C99 identifier.
- * The "name" MUST follow these rules to ensure no namespace clash
- * occurs:
+ * The provider and name should be a proper C99 identifier.
+ * The "provider" and "name" MUST follow these rules to ensure no
+ * namespace clash occurs:
*
* For projects (applications and libraries) for which an entity
* specific to the project controls the source code and thus its
* tracepoints (typically with a scope larger than a single company):
*
* either:
*
* For projects (applications and libraries) for which an entity
* specific to the project controls the source code and thus its
* tracepoints (typically with a scope larger than a single company):
*
* either:
*
* Where "project" is the name of the project,
* "component" is the name of the project component (which may
*
* Where "project" is the name of the project,
* "component" is the name of the project component (which may
*
* Where "company" is the name of the company,
* "project" is the name of the project,
*
* Where "company" is the name of the company,
* "project" is the name of the project,
*
* As an example, let's consider a user-space application "someproject"
* that would have an internal thread scheduler:
*
*
* As an example, let's consider a user-space application "someproject"
* that would have an internal thread scheduler:
*
-#define TRACEPOINT_EVENT(name, proto, args, fields) \
- _DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args))
+#define TRACEPOINT_EVENT(provider, name, proto, args, fields) \
+ _DECLARE_TRACEPOINT(provider, name, TP_PARAMS(proto), TP_PARAMS(args))
-#define TRACEPOINT_EVENT_CLASS(name, proto, args, fields)
-#define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
- _DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args))
+#define TRACEPOINT_EVENT_CLASS(provider, name, proto, args, fields)
+#define TRACEPOINT_EVENT_INSTANCE(provider, template, name, proto, args)\
+ _DECLARE_TRACEPOINT(provider, name, TP_PARAMS(proto), TP_PARAMS(args))
-#define TRACEPOINT_EVENT_NOARGS(name, fields) \
- _DECLARE_TRACEPOINT_NOARGS(name)
+#define TRACEPOINT_EVENT_NOARGS(provider, name, fields) \
+ _DECLARE_TRACEPOINT_NOARGS(provider, name)
-#define TRACEPOINT_EVENT_CLASS_NOARGS(name, fields)
-#define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
- _DECLARE_TRACEPOINT_NOARGS(name)
+#define TRACEPOINT_EVENT_CLASS_NOARGS(provider, name, fields)
+#define TRACEPOINT_EVENT_INSTANCE_NOARGS(provider, template, name) \
+ _DECLARE_TRACEPOINT_NOARGS(provider, name)