Add support for model.emf.uri event info
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 20 Sep 2012 16:39:47 +0000 (12:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 20 Sep 2012 16:39:47 +0000 (12:39 -0400)
Declared with:

TRACEPOINT_MODEL_EMF_URI(provider, event, "string")

this info is optional, can be added in the tracepoint probe.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event-reset.h
include/lttng/ust-tracepoint-event.h
liblttng-ust/ltt-events.c
tests/demo/ust_tests_demo.h

index e1de626cc6b54ff5db9f7935099b99c24017f4c2..8b08914418f0c98b047c46d53ed77637fb838073 100644 (file)
@@ -518,3 +518,9 @@ enum {
 #define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
 
 #endif /* #ifndef TRACEPOINT_LOGLEVEL */
+
+#ifndef TRACEPOINT_MODEL_EMF_URI
+
+#define TRACEPOINT_MODEL_EMF_URI(provider, name, uri)
+
+#endif /* #ifndef TRACEPOINT_MODEL_EMF_URI */
index daf589025fd0074031c0290f603ba03538c812e5..0e19ed2229ac9c7b417aee01be5113e0701351fe 100644 (file)
@@ -225,7 +225,12 @@ struct lttng_event_desc {
        unsigned int nr_fields;
        const int **loglevel;
        const char *signature;  /* Argument types/names received */
-       char padding[LTTNG_UST_EVENT_DESC_PADDING];
+       union {
+               struct {
+                       const char **model_emf_uri;
+               } ext;
+               char padding[LTTNG_UST_EVENT_DESC_PADDING];
+       } u;
 };
 
 #define LTTNG_UST_PROBE_DESC_PADDING   40
index e76072fc532d90fe98ecdc10e2f157e3a595990f..c3c9fce209c6940b9aff3ad05daeafb626ad0854 100644 (file)
@@ -32,6 +32,9 @@
 #undef TRACEPOINT_LOGLEVEL
 #define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
 
+#undef TRACEPOINT_MODEL_EMF_URI
+#define TRACEPOINT_MODEL_EMF_URI(provider, name, uri)
+
 #undef _ctf_integer_ext
 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, \
                        _nowrite)
index aaba93eab1ec0c819256186790f212bbc72e4057..8f0db41fc3c7c5490a38d5186661b7f68005c1af 100644 (file)
@@ -547,6 +547,21 @@ static const int *_loglevel___##__provider##___##__name =             \
 
 #include TRACEPOINT_INCLUDE
 
+/*
+ * Stage 6.1 of tracepoint event generation.
+ *
+ * Tracepoint UML URI info.
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+#undef TRACEPOINT_MODEL_EMF_URI
+#define TRACEPOINT_MODEL_EMF_URI(__provider, __name, __uri)               \
+static const char *_model_emf_uri___##__provider##___##__name = __uri;
+
+#include TRACEPOINT_INCLUDE
+
 /*
  * Stage 7.1 of tracepoint event generation.
  *
@@ -563,6 +578,9 @@ static const int *_loglevel___##__provider##___##__name =              \
 static const int *                                                            \
        __ref_loglevel___##_provider##___##_name                               \
        __attribute__((weakref ("_loglevel___" #_provider "___" #_name)));     \
+static const char *                                                           \
+       __ref_model_emf_uri___##_provider##___##_name                          \
+       __attribute__((weakref ("_model_emf_uri___" #_provider "___" #_name)));\
 const struct lttng_event_desc __event_desc___##_provider##_##_name = {        \
        .fields = __event_fields___##_provider##___##_template,                \
        .name = #_provider ":" #_name,                                         \
@@ -570,6 +588,7 @@ const struct lttng_event_desc __event_desc___##_provider##_##_name = {             \
        .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \
        .loglevel = &__ref_loglevel___##_provider##___##_name,                 \
        .signature = __tp_event_signature___##_provider##___##_template,       \
+       .u.ext.model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \
 };
 
 #include TRACEPOINT_INCLUDE
index ab099e1aba89afedb6a9456c0768509277500a8c..5d1475190d6ef82f49c418c52fa654ea2c070b29 100644 (file)
@@ -930,6 +930,14 @@ int _ltt_event_metadata_statedump(struct ltt_session *session,
        if (ret)
                goto end;
 
+       if (event->desc->u.ext.model_emf_uri) {
+               ret = lttng_metadata_printf(session,
+                       "       model.emf.uri = \"%s\";\n",
+                       *(event->desc->u.ext.model_emf_uri));
+               if (ret)
+                       goto end;
+       }
+
        if (event->ctx) {
                ret = lttng_metadata_printf(session,
                        "       context := struct {\n");
index 1b761f9fffba8a5d53585a19683ce3aae6aa2ba2..680b0e699ac400fcd07d6e4e4b9719c6f9890021 100644 (file)
@@ -32,6 +32,13 @@ TRACEPOINT_EVENT(ust_tests_demo, starting,
 )
 TRACEPOINT_LOGLEVEL(ust_tests_demo, starting, TRACE_CRIT)
 
+/*
+ * Dummy model information, just for example. TODO: we should check if
+ * EMF model URI have some standard format we should follow.
+ */
+TRACEPOINT_MODEL_EMF_URI(ust_tests_demo, starting,
+       "http://example.com/path_to_model?q=ust_tests_demo:starting")
+
 TRACEPOINT_EVENT(ust_tests_demo, done,
        TP_ARGS(int, value),
        TP_FIELDS(
@@ -40,6 +47,9 @@ TRACEPOINT_EVENT(ust_tests_demo, done,
 )
 TRACEPOINT_LOGLEVEL(ust_tests_demo, done, TRACE_CRIT)
 
+TRACEPOINT_MODEL_EMF_URI(ust_tests_demo, done,
+       "http://example.com/path_to_model?q=ust_tests_demo:done")
+
 #endif /* _TRACEPOINT_UST_TESTS_DEMO_H */
 
 #undef TRACEPOINT_INCLUDE_FILE
This page took 0.028989 seconds and 4 git commands to generate.