Markers: API change: rename trace_mark() to ust_marker()
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Apr 2011 17:46:23 +0000 (13:46 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Apr 2011 17:46:23 +0000 (13:46 -0400)
Given that the markers will stay as debug-only "quick and dirty"
tracing interface, make them UST-specific. Make it clear by turning the
API to ust_marker().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
22 files changed:
doc/info/ust.texi
include/ust/marker.h
java/UST.c
libust/marker.c
libust/tracectl.c
libustinstr-malloc/mallocwrap.c
tests/basic/basic.c
tests/basic_long/basic_long.c
tests/benchmark/bench.c
tests/dlopen/dlopen.c
tests/dlopen/libdummy.c
tests/fork/fork.c
tests/fork/fork2.c
tests/hello/hello.c
tests/hello2/hello2.c
tests/libustctl_function_tests/libustctl_function_tests.c
tests/make_shared_lib/basic_lib.c
tests/make_shared_lib/prog.c
tests/same_line_marker/same_line_marker.c
tests/test-nevents/prog.c
tests/tracepoint/benchmark/tracepoint_benchmark.c
tests/tracepoint/tracepoint_test.c

index 83c91e022802011803201e523afa949e76722975..60c73c1804a08bd8658aa0ac46fc8e3c6c691f10 100644 (file)
@@ -162,10 +162,10 @@ int main(int argc, char **argv)
        /* ... set values of v and st ... */
 
        /* a marker: */
-       trace_mark(ust, myevent, "firstarg %d secondarg %s", v, st);
+       ust_marker(ust, myevent, "firstarg %d secondarg %s", v, st);
 
        /* a marker without arguments: */
-       trace_mark(ust, myotherevent, MARK_NOARGS);
+       ust_marker(ust, myotherevent, MARK_NOARGS);
 
        return 0;
 }
@@ -240,17 +240,17 @@ int main(int argc, char **argv)
        /* ... set values of v and st ... */
 
        /* a marker: */
-       trace_mark(main, myevent, "firstarg %d secondarg %s", v, st);
+       ust_marker(main, myevent, "firstarg %d secondarg %s", v, st);
 
        /* another marker without arguments: */
-       trace_mark(main, myotherevent, MARK_NOARGS);
+       ust_marker(main, myotherevent, MARK_NOARGS);
 
        return 0;
 }
 @end verbatim
 @end example
 
-The invocation of the trace_mark() macro requires at least 3 arguments. The
+The invocation of the ust_marker() macro requires at least 3 arguments. The
 first, here "main", is the name of the event category. It is also the name of
 the channel the event will go in. The second, here "myevent" is the name of the
 event. The third is a format string that announces the names and the types of
@@ -318,7 +318,7 @@ DEFINE_TRACE(mychannel_myevent);
 
 void mychannel_myevent_probe(int v, char *st)
 {
-       trace_mark(mychannel, myevent, "v %d st %s", v, st);
+       ust_marker(mychannel, myevent, "v %d st %s", v, st);
 }
 
 static void __attribute__((constructor)) init()
index da738d1f3254f67b566df5c54d1800ef161216f1..906d78de66b75bc9b9a9c01963b94ab9aa190675 100644 (file)
@@ -167,10 +167,10 @@ struct marker {
  * If generic is false, immediate values are used.
  */
 
-#define __trace_mark(generic, channel, name, call_private, format, args...) \
-       __trace_mark_counter(generic, channel, name, __LINE__, call_private, format, ## args)
+#define __ust_marker(generic, channel, name, call_private, format, args...) \
+       __ust_marker_counter(generic, channel, name, __LINE__, call_private, format, ## args)
 
-#define __trace_mark_counter(generic, channel, name, unique, call_private, format, args...) \
+#define __ust_marker_counter(generic, channel, name, unique, call_private, format, args...) \
        do {                                                            \
                struct marker *__marker_counter_ptr;                    \
                _DEFINE_MARKER(channel, name, NULL, NULL, format, unique, __marker_counter_ptr);        \
@@ -184,10 +184,10 @@ struct marker {
                }                                                       \
        } while (0)
 
-#define __trace_mark_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \
-       __trace_mark_tp_counter(channel, name, __LINE__, call_private, tp_name, tp_cb, format, ## args)
+#define __ust_marker_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \
+       __ust_marker_tp_counter(channel, name, __LINE__, call_private, tp_name, tp_cb, format, ## args)
 
-#define __trace_mark_tp_counter(channel, name, unique, call_private, tp_name, tp_cb, format, args...) \
+#define __ust_marker_tp_counter(channel, name, unique, call_private, tp_name, tp_cb, format, args...) \
        do {                                                            \
                struct registers __marker_regs;                         \
                void __check_tp_type(void)                              \
@@ -204,7 +204,7 @@ extern void marker_update_probe_range(struct marker * const *begin,
        struct marker * const *end);
 
 /**
- * trace_mark - Marker using code patching
+ * ust_marker - Marker using code patching
  * @name: marker name, not quoted.
  * @format: format string
  * @args...: variable argument list
@@ -212,11 +212,11 @@ extern void marker_update_probe_range(struct marker * const *begin,
  * Places a marker using optimized code patching technique (imv_read())
  * to be enabled when immediate values are present.
  */
-#define trace_mark(name, format, args...) \
-       __trace_mark(0, ust, name, NULL, format, ## args)
+#define ust_marker(name, format, args...) \
+       __ust_marker(0, ust, name, NULL, format, ## args)
 
 /**
- * _trace_mark - Marker using variable read
+ * _ust_marker - Marker using variable read
  * @name: marker name, not quoted.
  * @format: format string
  * @args...: variable argument list
@@ -225,11 +225,11 @@ extern void marker_update_probe_range(struct marker * const *begin,
  * enabled. Should be used for markers in code paths where instruction
  * modification based enabling is not welcome.
  */
-#define _trace_mark(name, format, args...) \
-       __trace_mark(1, ust, name, NULL, format, ## args)
+#define _ust_marker(name, format, args...) \
+       __ust_marker(1, ust, name, NULL, format, ## args)
 
 /**
- * trace_mark_tp - Marker in a tracepoint callback
+ * ust_marker_tp - Marker in a tracepoint callback
  * @name: marker name, not quoted.
  * @tp_name: tracepoint name, not quoted.
  * @tp_cb: tracepoint callback. Should have an associated global symbol so it
@@ -239,8 +239,8 @@ extern void marker_update_probe_range(struct marker * const *begin,
  *
  * Places a marker in a tracepoint callback.
  */
-#define trace_mark_tp(name, tp_name, tp_cb, format, args...)   \
-       __trace_mark_tp(ust, name, NULL, tp_name, tp_cb, format, ## args)
+#define ust_marker_tp(name, tp_name, tp_cb, format, args...)   \
+       __ust_marker_tp(ust, name, NULL, tp_name, tp_cb, format, ## args)
 
 /**
  * MARK_NOARGS - Format string for a marker with no argument.
index 7c807726d7d501e41030a5fc47fbb1eda5cfcb97..7e01e92f4f0cf9c4fe133d1bb9175b5cbfd03802 100644 (file)
@@ -7,7 +7,7 @@ JNIEXPORT void JNICALL Java_UST_ust_1java_1event (JNIEnv *env, jobject jobj, jst
        const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy);
        const char *args_cstr = (*env)->GetStringUTFChars(env, args, &iscopy);
 
-       trace_mark(ust, java_event, "name %s args %s", ev_name_cstr, args_cstr);
+       ust_marker(ust, java_event, "name %s args %s", ev_name_cstr, args_cstr);
 }
 
 MARKER_LIB
index 4b23e53d51363357e06f79fee32b5840aa77dd08..0aa3d60e6bccbd8dd958ea67147ee9b97013b329 100644 (file)
@@ -447,7 +447,7 @@ static struct marker_entry *add_marker(const char *channel, const char *name,
                        e->call = marker_probe_cb_noarg;
                else
                        e->call = marker_probe_cb;
-               __trace_mark(0, metadata, core_marker_format, NULL,
+               __ust_marker(0, metadata, core_marker_format, NULL,
                           "channel %s name %s format %s",
                           e->channel, e->name, e->format);
        } else {
@@ -514,7 +514,7 @@ static int marker_set_format(struct marker_entry *entry, const char *format)
                return -ENOMEM;
        entry->format_allocated = 1;
 
-       __trace_mark(0, metadata, core_marker_format, NULL,
+       __ust_marker(0, metadata, core_marker_format, NULL,
                   "channel %s name %s format %s",
                   entry->channel, entry->name, entry->format);
        return 0;
@@ -583,7 +583,7 @@ static int set_marker(struct marker_entry *entry, struct marker *elem,
                WARN_ON(!elem->tp_cb);
                /*
                 * It is ok to directly call the probe registration because type
-                * checking has been done in the __trace_mark_tp() macro.
+                * checking has been done in the __ust_marker_tp() macro.
                 */
 
                if (active) {
@@ -629,7 +629,7 @@ static void disable_marker(struct marker *elem)
                WARN_ON(!elem->tp_cb);
                /*
                 * It is ok to directly call the probe registration because type
-                * checking has been done in the __trace_mark_tp() macro.
+                * checking has been done in the __ust_marker_tp() macro.
                 */
                ret = tracepoint_probe_unregister_noupdate(elem->tp_name,
                        elem->tp_cb, NULL);
@@ -781,7 +781,7 @@ int marker_probe_register(const char *channel, const char *name,
                        goto error_unregister_channel;
                entry->event_id = ret;
                ret = 0;
-               __trace_mark(0, metadata, core_marker_id, NULL,
+               __ust_marker(0, metadata, core_marker_id, NULL,
                           "channel %s name %s event_id %hu "
                           "int #1u%zu long #1u%zu pointer #1u%zu "
                           "size_t #1u%zu alignment #1u%u",
@@ -1296,7 +1296,7 @@ void ltt_dump_marker_state(struct ust_trace *trace)
        for (i = 0; i < MARKER_TABLE_SIZE; i++) {
                head = &marker_table[i];
                cds_hlist_for_each_entry(entry, node, head, hlist) {
-                       __trace_mark(0, metadata, core_marker_id,
+                       __ust_marker(0, metadata, core_marker_id,
                                &call_data,
                                "channel %s name %s event_id %hu "
                                "int #1u%zu long #1u%zu pointer #1u%zu "
@@ -1308,7 +1308,7 @@ void ltt_dump_marker_state(struct ust_trace *trace)
                                sizeof(void *), sizeof(size_t),
                                ltt_get_alignment());
                        if (entry->format)
-                               __trace_mark(0, metadata,
+                               __ust_marker(0, metadata,
                                        core_marker_format,
                                        &call_data,
                                        "channel %s name %s format %s",
index e84a35aecf4e3f979d4cb85163b89e3204ccf45c..4d93cc6f7c8ec7e6886d0bc85332ae9a29dfa60d 100644 (file)
@@ -1576,7 +1576,7 @@ static void __attribute__((destructor)) keepalive()
 
 void ust_potential_exec(void)
 {
-       trace_mark(potential_exec, MARK_NOARGS);
+       ust_marker(potential_exec, MARK_NOARGS);
 
        DBG("test");
 
index c473567da1f46a5a9b35b6fd6f29976b19225921..28cd4e326555ae878fcf472b967051970863d5df 100644 (file)
@@ -53,7 +53,7 @@ __I_FUNC_TYPE __I_FUNC_NAME(__I_FUNC_ARGS)                                            \
                }                                                                       \
        }                                                                               \
                                                                                        \
-       trace_mark(ust, __I_FUNC_NAME, __I_TRACE_FMT, __I_TRACE_ARGS);                  \
+       ust_marker(ust, __I_FUNC_NAME, __I_TRACE_FMT, __I_TRACE_ARGS);                  \
                                                                                        \
        return plibc_ ## __I_FUNC_NAME (__I_CALL_ARGS);                                 \
 }
@@ -75,7 +75,7 @@ void *malloc(size_t size)
 
        retval = plibc_malloc(size);
 
-       trace_mark(malloc, "size %d ptr %p", (int)size, retval);
+       ust_marker(malloc, "size %d ptr %p", (int)size, retval);
 
        return retval;
 }
@@ -92,7 +92,7 @@ void free(void *ptr)
                }
        }
 
-       trace_mark(free, "ptr %p", ptr);
+       ust_marker(free, "ptr %p", ptr);
 
        plibc_free(ptr);
 }
index 293febaca2246655d3fb37de4cec90682fe7f8ea..e1832cd098eec642b5dcc4a26e61acfb3c867a18 100644 (file)
@@ -29,8 +29,8 @@ int main()
        printf("Basic test program\n");
 
        for(i=0; i<50; i++) {
-               trace_mark(bar, "str %s", "FOOBAZ");
-               trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+               ust_marker(bar, "str %s", "FOOBAZ");
+               ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
                usleep(100000);
        }
 
index 06ee2f58fb2469af8e28917b30e5ec7edddc652e..746e9f5192aef934112f83ad79274a06dfe704f8 100644 (file)
@@ -25,8 +25,8 @@ int main()
        printf("Basic test program\n");
 
        for(;;) {
-               trace_mark(bar, "str %s", "FOOBAZ");
-               trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+               ust_marker(bar, "str %s", "FOOBAZ");
+               ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
                usleep(1000000);
        }
 
index 4e9c355126cb07eab69b62003d64f03afbd29c91..ce476f9bd996c4b3ac2859c3b669c084db7e7dec 100644 (file)
@@ -29,7 +29,7 @@ void do_stuff(void)
        time(NULL);
 
 #ifdef MARKER
-       trace_mark(event, "event %d", v);
+       ust_marker(event, "event %d", v);
 #endif
 
 }
index d367580c3698cf86641cb2e7399def4d542837f6..ae209028ac059f0fc3c886cd5c6094372eab79ae 100644 (file)
@@ -28,7 +28,7 @@ int main()
 {
        int (*fptr)();
 
-       trace_mark(from_main_before_lib, "%s", "Event occured in the main program before"
+       ust_marker(from_main_before_lib, "%s", "Event occured in the main program before"
                                                " the opening of the library\n");
        void *lib_handle = dlopen("libdummy.so", RTLD_LAZY);
 
@@ -47,7 +47,7 @@ int main()
        (*fptr)();
        dlclose(lib_handle);
 
-       trace_mark(from_main_after_lib,"%s", "Event occured in the main program after "
+       ust_marker(from_main_after_lib,"%s", "Event occured in the main program after "
                                                "the library has been closed\n");
 
        return 0;
index 16f7b4dc7f1152cef73fb7c0d906193312fd19f6..dd694c282b2b1f9aa88535991676e782743edb59 100644 (file)
@@ -19,5 +19,5 @@
 
 void exported_function()
 {
-  trace_mark(from_library, "%s", "Event occured in library function");
+  ust_marker(from_library, "%s", "Event occured in library function");
 }
index 3b84644325948310ed29a6f22f8ca7751185c5d1..f2b3f18155ddcfff5618869e48af6b0ecfc18da8 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv, char *env[])
        }
 
        printf("Fork test program, parent pid is %d\n", getpid());
-       trace_mark(before_fork, MARK_NOARGS);
+       ust_marker(before_fork, MARK_NOARGS);
 
        /* Sleep here to make sure the consumer is initialized before we fork */
        sleep(1);
@@ -47,9 +47,9 @@ int main(int argc, char **argv, char *env[])
 
                printf("Child pid is %d\n", getpid());
 
-               trace_mark(after_fork_child, MARK_NOARGS);
+               ust_marker(after_fork_child, MARK_NOARGS);
 
-               trace_mark(before_exec, "pid %d", getpid());
+               ust_marker(before_exec, "pid %d", getpid());
 
                result = execve(argv[1], args, env);
                if(result == -1) {
@@ -57,10 +57,10 @@ int main(int argc, char **argv, char *env[])
                        return 1;
                }
 
-               trace_mark(after_exec, "pid %d", getpid());
+               ust_marker(after_exec, "pid %d", getpid());
        }
        else {
-               trace_mark(after_fork_parent, MARK_NOARGS);
+               ust_marker(after_fork_parent, MARK_NOARGS);
        }
 
        return 0;
index 8a14e1a20c22c04a1ffa203f6dc407e7fa468951..c77a7051dd59de971b40566ab20099a2a52f391e 100644 (file)
@@ -24,7 +24,7 @@ int main()
 {
        printf("IN FORK2\n");
 
-       trace_mark(after_exec, MARK_NOARGS);
+       ust_marker(after_exec, MARK_NOARGS);
 
        return 0;
 }
index 6ba2e61e06963f2ea1478147569725263e2f3cc9..09a35b98aba42bb54885ce6be4c08672428f31a8 100644 (file)
@@ -71,8 +71,8 @@ int main()
 
        sleep(1);
        for(i=0; i<50; i++) {
-               trace_mark(bar, "str %s", "FOOBAZ");
-               trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+               ust_marker(bar, "str %s", "FOOBAZ");
+               ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
                trace_hello_tptest(i);
                usleep(100000);
        }
index 175a14006a8258e1d1910cea7fbce2c8bd541483..7308b30de64783b7879eb8a39f32468408ff62ec 100644 (file)
@@ -37,8 +37,8 @@ int main()
        printf("Hello, World!\n");
 
        for(i=0; i<500; i++) {
-               trace_mark(bar, "str %d", i);
-               trace_mark(bar2, "number1 %d number2 %d", (int)53, (int)9800);
+               ust_marker(bar, "str %d", i);
+               ust_marker(bar2, "number1 %d number2 %d", (int)53, (int)9800);
        }
 
 //     ltt_trace_stop("auto");
index cf184e6272be7c4c3885f074362fb01dafcb02a2..45894208cc5d7fc82f52a89f3650aceeade9047f 100644 (file)
@@ -179,8 +179,8 @@ int main(int argc, char **argv)
        child_pid = fork();
        if (child_pid) {
                for(i=0; i<10; i++) {
-                       trace_mark(bar, "str %s", "FOOBAZ");
-                       trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+                       ust_marker(bar, "str %s", "FOOBAZ");
+                       ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
                        usleep(100000);
                }
 
index 97874f32a2435f4198f5f1781a8ccd6b362f17da..3feaac1eff1214ac9299aa590149f9ae6d7ee896 100644 (file)
@@ -3,7 +3,7 @@
 
 void myfunc(void)
 {
-       trace_mark(in_lib, MARK_NOARGS);
+       ust_marker(in_lib, MARK_NOARGS);
        printf("testfunc\n");
 }
 
index 777f4c6420cf486a2b748d049a6c56a79f0249fc..7b7357adcdc33715e4ba7a613664da96e9dc287c 100644 (file)
@@ -5,6 +5,6 @@ extern myfunc(void);
 int main(void)
 {
        myfunc();
-       trace_mark(in_prog, MARK_NOARGS);
+       ust_marker(in_prog, MARK_NOARGS);
        return 0;
 }
index 51cf5c39041b07b9bb8301e0574daf1ef540819b..ef59a2c9396a768adfd8d27332561b7991f1ad2e 100644 (file)
@@ -19,6 +19,6 @@
 
 int main()
 {
-  trace_mark(same_line_event, "%s","An event occured in the same line"); trace_mark(same_line_event, "%s","An event occured in the same line");
+       ust_marker(same_line_event, "%s","An event occured in the same line"); ust_marker(same_line_event, "%s","An event occured in the same line");
        return 0;
 }
index 4e709156491112c543972ca857ad2ebbcda27634..21e01f026b994ad276f90bd22bf74aab5486f956 100644 (file)
@@ -30,8 +30,8 @@ int main()
        int i;
 
        for(i=0; i<N_ITER; i++) {
-               trace_mark(an_event, "%d", i);
-               trace_mark(another_event, "%s", "Hello, World!");
+               ust_marker(an_event, "%d", i);
+               ust_marker(another_event, "%s", "Hello, World!");
        }
 
        return 0;
index c8ba8c15ac0d1c8762c536e8fe98efad1776eaf9..4d354bb1be96b2097ce31bb2721e49e8497090a6 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 /*
- * This test is aimed at testing tracepoint *with* trace_mark :
+ * This test is aimed at testing tracepoint *with* ust_marker :
  *
  * 1) tracepoint named : "ust_event"
  *     -) Probe 1 registered and recording the value 42
index 6a5f691498a0be344c31a52bde1eb9bae5f787db..88fa10b00916877b328ec4240e26ea96e0937483 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /*
- * This test is aimed at testing tracepoint *with* trace_mark :
+ * This test is aimed at testing tracepoint *with* ust_marker :
  *
  * 1) tracepoint named : "ust_event"
  *     -) Probe 1 registered and recording the value 13 (x5)
@@ -47,7 +47,7 @@ void tp_probe4(void *data, unsigned int p4)
 {
        int i;
        for (i = 0; i < 100; i++) {
-               trace_mark_tp(event2, ust_event2, tp_probe4, "probe4 %u", p4);
+               ust_marker_tp(event2, ust_event2, tp_probe4, "probe4 %u", p4);
        }
 }
 
@@ -60,7 +60,7 @@ void tp_probe3(void *data, unsigned int p3)
 {
        struct message *msg;
        msg = (struct message*) data;
-       trace_mark_tp(event_msg, ust_event_msg,
+       ust_marker_tp(event_msg, ust_event_msg,
                        tp_probe3, "probe %s", msg->payload);
 }
 
@@ -72,7 +72,7 @@ void tp_probe2(void *data, unsigned int p2)
 {
        int i;
        for (i = 0; i < 5; i++) {
-               trace_mark_tp(event, ust_event, tp_probe2, "probe %u", 13);
+               ust_marker_tp(event, ust_event, tp_probe2, "probe %u", 13);
        }
 }
 
@@ -84,7 +84,7 @@ void tp_probe(void *data, unsigned int p1)
 {
        int i;
        for (i = 0; i < 5; i++) {
-               trace_mark_tp(event, ust_event, tp_probe, "probe %u", p1);
+               ust_marker_tp(event, ust_event, tp_probe, "probe %u", p1);
        }
 }
 
This page took 0.036803 seconds and 4 git commands to generate.