Fix tracepoint test with deprecated API
authorYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 17 Oct 2011 15:00:20 +0000 (11:00 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Oct 2011 15:00:20 +0000 (11:00 -0400)
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/runtests
tests/tracepoint/Makefile.am
tests/tracepoint/run
tests/tracepoint/tracepoint_test.c
tests/tracepoint/tracepoint_test.h

index e669210e27ae8fb6c046e75cc4524be48016e4a3..86cb91047632acd84154cb88e3b0d6bab7860680 100755 (executable)
@@ -44,7 +44,7 @@ simple_harness_run dlopen/dlopen.sh
 simple_harness_run same_line_marker/same_line_marker.sh
 
 # This testcase is currently broken, do not run.
-simple_harness_run tracepoint/run
+simple_harness_run tracepoint/run
 
 simple_harness_run libustctl_function_tests/libustctl_function_tests
 
index 3c3fe90d2db36a983bbc1c862843d6ab045468e3..90ff28761642b32fc1d5b3c866abee5943def50e 100644 (file)
@@ -2,13 +2,10 @@ SUBDIRS = benchmark
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
 
-#noinst_PROGRAMS = tracepoint_test
-#tracepoint_test_SOURCES = tracepoint_test.c tracepoint_test.h
-#tracepoint_test_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
+noinst_PROGRAMS = tracepoint_test
+tracepoint_test_SOURCES = tracepoint_test.c tracepoint_test.h
+tracepoint_test_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
 
-#FIXME: this test is broken:
-#ust/tests/tracepoint/tracepoint_test.c:64: undefined reference to
-#`register_trace_ust_event_msg'
-#CFLAGS_tracepoint_test.o = -I$(src)
+CFLAGS_tracepoint_test.o = -I$(src)
 noinst_SCRIPTS = run
 EXTRA_DIST = run
index d63f42de89841b9bb386da10b280e02f58452784..b7e5029b96a41889e3b93933abeea5c91fcae19d 100755 (executable)
@@ -10,7 +10,7 @@ fi
 source $TESTDIR/test_functions.sh
 source $TESTDIR/tap.sh
 
-starttest "Testing Tracepoints"
+starttest "Testing Deprecated Tracepoints"
 plan_tests 6
 USTTRACE="$TESTDIR/../usttrace"
 
index 34cdb115dd32e8bfbe88927eab7263294d5fbe8c..88cb3792f4529aec3e04f98cf482c39761d77930 100644 (file)
@@ -32,8 +32,8 @@
 #include <ust/marker.h>
 #include "tracepoint_test.h"
 
-DEFINE_TRACEPOINT(ust_event);
-DEFINE_TRACEPOINT(ust_event2);
+DEFINE_TRACE(ust_event);
+DEFINE_TRACE(ust_event2);
 
 static struct message msg_probe3 = {
        .payload = "probe3",
@@ -47,7 +47,7 @@ void tp_probe4(void *data, unsigned int p4)
 {
        int i;
        for (i = 0; i < 100; i++) {
-               ust_marker_tp(event2, ust_event2, tp_probe4, "probe4 %u", p4);
+               ust_marker(event2, "probe4 %u", p4);
        }
 }
 
@@ -60,8 +60,8 @@ void tp_probe3(void *data, unsigned int p3)
 {
        struct message *msg;
        msg = (struct message*) data;
-       ust_marker_tp(event_msg, ust_event_msg,
-                       tp_probe3, "probe %s", msg->payload);
+       ust_marker(event_msg,
+                        "probe %s", msg->payload);
 }
 
 /*
@@ -72,7 +72,7 @@ void tp_probe2(void *data, unsigned int p2)
 {
        int i;
        for (i = 0; i < 5; i++) {
-               ust_marker_tp(event, ust_event, tp_probe2, "probe %u", 13);
+               ust_marker(event, "probe %u", 13);
        }
 }
 
@@ -84,16 +84,16 @@ void tp_probe(void *data, unsigned int p1)
 {
        int i;
        for (i = 0; i < 5; i++) {
-               ust_marker_tp(event, ust_event, tp_probe, "probe %u", p1);
+               ust_marker(event,  "probe %u", p1);
        }
 }
 
 static void __attribute__((constructor)) init()
 {
-       register_tracepoint(ust_event, tp_probe, NULL);
-       register_tracepoint(ust_event, tp_probe2, NULL);
-       register_tracepoint(ust_event, tp_probe3, &msg_probe3);
-       register_tracepoint(ust_event2, tp_probe4, NULL);
+       __register_tracepoint(ust_event, tp_probe, NULL);
+       __register_tracepoint(ust_event, tp_probe2, NULL);
+       __register_tracepoint(ust_event, tp_probe3, &msg_probe3);
+       __register_tracepoint(ust_event2, tp_probe4, NULL);
 }
 
 int main(int argc, char **argv) {
index 1899fe4e8c16bb2ed965c80281a531845f56790c..6b4dcdbce6850f9d05d633c5c047506312cfaec4 100644 (file)
@@ -1,7 +1,7 @@
 #include <ust/tracepoint.h>
 
-DECLARE_TRACEPOINT(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
-DECLARE_TRACEPOINT(ust_event2, TP_PROTO(unsigned int v), TP_ARGS(v));
+DECLARE_TRACE(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
+DECLARE_TRACE(ust_event2, TP_PROTO(unsigned int v), TP_ARGS(v));
 
 struct message {
        char *payload;
This page took 0.028173 seconds and 4 git commands to generate.