continue working on build system
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 30 Mar 2009 23:16:25 +0000 (19:16 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 30 Mar 2009 23:16:25 +0000 (19:16 -0400)
12 files changed:
Makefile.am
configure.ac
hello/Makefile.am
libust/marker.c
libust/serialize.c
libust/tracepoint.c
libust/tracepoint.h
libustcomm/ustcomm.c
share/kernelcompat.h
ustd/Makefile [deleted file]
ustd/Makefile.am [new file with mode: 0644]
ustd/ustd.c

index 996aedd386fbe7fc5f0d14cf3fca4247e412f300..11e18439a9af8b0f13ee2bb755625289803b023b 100644 (file)
@@ -1 +1 @@
-SUBDIRS = libust hello libmallocwrap
+SUBDIRS = libust hello libmallocwrap ustd
index 38d6b8b0e9de2dcff27acac10644e138a7de53d4..075fe521bff11761c206b291e43e024025601b77 100644 (file)
@@ -63,5 +63,5 @@ AC_SUBST(KCOMPAT_PATH)
 #                 ust/Makefile
 #                 ustd/Makefile])
 
-AC_CONFIG_FILES([Makefile libust/Makefile hello/Makefile libmallocwrap/Makefile])
+AC_CONFIG_FILES([Makefile libust/Makefile hello/Makefile libmallocwrap/Makefile ustd/Makefile])
 AC_OUTPUT
index 2a4e6b7d02602af601030651fba84dc8d0e03f16..f682130d220f1eef746fc454b1d212d71460e910 100644 (file)
@@ -1,4 +1,4 @@
-bin_PROGRAMS = hello
+noinst_PROGRAMS = hello
 hello_SOURCES = hello.c tp.c tp.h
 hello_LDADD = $(top_builddir)/libust/libust.la @URCU_PATH@/liburcu.so
 
index e417b62fbb76a384e6c2cbafd2ebecabc181ca84..ade2d9c1f1edcd3f5a754196f8f1f34a902d677d 100644 (file)
@@ -36,6 +36,7 @@
 #include "channels.h"
 #include "tracercore.h"
 #include "tracer.h"
+#include "urcu.h"
 
 extern struct marker __start___markers[] __attribute__((visibility("hidden")));
 extern struct marker __stop___markers[] __attribute__((visibility("hidden")));
@@ -501,8 +502,8 @@ static int remove_marker(const char *channel, const char *name)
        ret = ltt_channels_unregister(e->channel);
        WARN_ON(ret);
        /* Make sure the call_rcu has been executed */
-       if (e->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (e->rcu_pending)
+//ust//                rcu_barrier_sched();
        kfree(e);
        return 0;
 }
@@ -792,8 +793,8 @@ int marker_probe_register(const char *channel, const char *name,
         * If we detect that a call_rcu is pending for this marker,
         * make sure it's executed now.
         */
-       if (entry->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (entry->rcu_pending)
+//ust//                rcu_barrier_sched();
        old = marker_entry_add_probe(entry, probe, probe_private);
        if (IS_ERR(old)) {
                ret = PTR_ERR(old);
@@ -810,14 +811,14 @@ int marker_probe_register(const char *channel, const char *name,
        entry = get_marker(channel, name);
        if (!entry)
                goto end;
-       if (entry->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (entry->rcu_pending)
+//ust//                rcu_barrier_sched();
        entry->oldptr = old;
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
-       call_rcu_sched(&entry->rcu, free_old_closure);
-       /*synchronize_rcu(); free_old_closure();*/
+//ust//        call_rcu_sched(&entry->rcu, free_old_closure);
+       synchronize_rcu(); free_old_closure(&entry->rcu);
        goto end;
 
 error_unregister_channel:
@@ -856,8 +857,8 @@ int marker_probe_unregister(const char *channel, const char *name,
        entry = get_marker(channel, name);
        if (!entry)
                goto end;
-       if (entry->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (entry->rcu_pending)
+//ust//                rcu_barrier_sched();
        old = marker_entry_remove_probe(entry, probe, probe_private);
        mutex_unlock(&markers_mutex);
 
@@ -867,13 +868,14 @@ int marker_probe_unregister(const char *channel, const char *name,
        entry = get_marker(channel, name);
        if (!entry)
                goto end;
-       if (entry->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (entry->rcu_pending)
+//ust//                rcu_barrier_sched();
        entry->oldptr = old;
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
-       call_rcu_sched(&entry->rcu, free_old_closure);
+//ust//        call_rcu_sched(&entry->rcu, free_old_closure);
+       synchronize_rcu(); free_old_closure(&entry->rcu);
        remove_marker(channel, name);   /* Ignore busy error message */
        ret = 0;
 end:
@@ -940,8 +942,8 @@ int marker_probe_unregister_private_data(marker_probe_func *probe,
                ret = -ENOENT;
                goto end;
        }
-       if (entry->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (entry->rcu_pending)
+//ust//                rcu_barrier_sched();
        old = marker_entry_remove_probe(entry, NULL, probe_private);
        channel = kstrdup(entry->channel, GFP_KERNEL);
        name = kstrdup(entry->name, GFP_KERNEL);
@@ -953,13 +955,14 @@ int marker_probe_unregister_private_data(marker_probe_func *probe,
        entry = get_marker(channel, name);
        if (!entry)
                goto end;
-       if (entry->rcu_pending)
-               rcu_barrier_sched();
+//ust//        if (entry->rcu_pending)
+//ust//                rcu_barrier_sched();
        entry->oldptr = old;
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
-       call_rcu_sched(&entry->rcu, free_old_closure);
+//ust//        call_rcu_sched(&entry->rcu, free_old_closure);
+       synchronize_rcu(); free_old_closure(&entry->rcu);
        /* Ignore busy error message */
        remove_marker(channel, name);
 end:
index bef01780e6bfbdb70179ce30577e00bf863836b4..0056d0011b71d862f3c6d8dd1eb51208bd020adf 100644 (file)
@@ -23,6 +23,7 @@
 #include "tracer.h"
 #include "list.h"
 #include "usterr.h"
+#include "urcu.h"
 
 enum ltt_type {
        LTT_TYPE_SIGNED_INT,
@@ -593,7 +594,7 @@ notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
        if (unlikely(ltt_traces.num_active_traces == 0))
                return;
 
-       rcu_read_lock_sched_notrace();
+       rcu_read_lock(); //ust// rcu_read_lock_sched_notrace();
        cpu = smp_processor_id();
 //ust//        __get_cpu_var(ltt_nesting)++;
        ltt_nesting++;
@@ -676,7 +677,7 @@ notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
        }
 //ust//        __get_cpu_var(ltt_nesting)--;
        ltt_nesting--;
-       rcu_read_unlock_sched_notrace();
+       rcu_read_unlock(); //ust// rcu_read_unlock_sched_notrace();
 }
 EXPORT_SYMBOL_GPL(ltt_vtrace);
 
index ba4509b22d3911d284b0cb784fba228bdcde2395..8a9ed0131a8152289261f44892065544459336a8 100644 (file)
@@ -36,6 +36,7 @@
 #include "tracepoint.h"
 #include "usterr.h"
 #include "list.h"
+#include "urcu.h"
 
 //extern struct tracepoint __start___tracepoints[] __attribute__((visibility("hidden")));
 //extern struct tracepoint __stop___tracepoints[] __attribute__((visibility("hidden")));
index 6f14ea08a696f43428e615fccfb00eda12a90759..3b2470138bf882cb938ee977999ac81c2f390921 100644 (file)
@@ -28,6 +28,7 @@
 //#include <linux/types.h>
 //#include <linux/rcupdate.h>
 
+#include "urcu.h"
 #include "immediate.h"
 #include "kernelcompat.h"
 
@@ -58,14 +59,14 @@ struct tracepoint {
        do {                                                            \
                void **it_func;                                         \
                                                                        \
-               rcu_read_lock_sched_notrace();                          \
+               rcu_read_lock(); /*ust rcu_read_lock_sched_notrace();   */                      \
                it_func = rcu_dereference((tp)->funcs);                 \
                if (it_func) {                                          \
                        do {                                            \
                                ((void(*)(proto))(*it_func))(args);     \
                        } while (*(++it_func));                         \
                }                                                       \
-               rcu_read_unlock_sched_notrace();                        \
+               rcu_read_unlock(); /*ust rcu_read_unlock_sched_notrace(); */                    \
        } while (0)
 
 #define __CHECK_TRACE(name, generic, proto, args)                      \
index d6e5346d26e468a73addc6b6fc8eca369d6e58b3..e19118347ce3fd364aa1ec75cadb0f74fcf20550 100644 (file)
@@ -518,7 +518,7 @@ int ustcomm_init_ustd(struct ustcomm_ustd *handle)
 
        handle->server.listen_fd = init_named_socket(name, &handle->server.socketpath);
        if(handle->server.listen_fd < 0) {
-               ERR("error initializing named socket");
+               ERR("error initializing named socket at %s", name);
                goto free_name;
        }
        free(name);
index c0f4c9938c47a1959bcd5114036db63519ea1d3c..f141bc54e88555534cb2786665a51dbdd3191e97 100644 (file)
@@ -95,13 +95,13 @@ static inline long IS_ERR(const void *ptr)
 
 #define smp_mb__after_atomic_inc() do {} while(0)
 
-/* RCU */
-
-#include "urcu.h"
-#define call_rcu_sched(a,b) b(a); synchronize_rcu()
-#define rcu_barrier_sched() do {} while(0) /* this nop is ok if call_rcu_sched does a synchronize_rcu() */
-#define rcu_read_lock_sched_notrace() rcu_read_lock()
-#define rcu_read_unlock_sched_notrace() rcu_read_unlock()
+///* RCU */
+//
+//#include "urcu.h"
+//#define call_rcu_sched(a,b) b(a); synchronize_rcu()
+//#define rcu_barrier_sched() do {} while(0) /* this nop is ok if call_rcu_sched does a synchronize_rcu() */
+//#define rcu_read_lock_sched_notrace() rcu_read_lock()
+//#define rcu_read_unlock_sched_notrace() rcu_read_unlock()
 
 /* ATOMICITY */
 
diff --git a/ustd/Makefile b/ustd/Makefile
deleted file mode 100644 (file)
index fb5c0e3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-CFLAGS="-g -Wall"
-
-all: ustd
-
-lowlevel.o: lowlevel.c
-       gcc -g -Wall -I ../libustcomm -I. -I ../../../../libkcompat -I ../libtracing -I ../share -I ../../../../urcu -I ../libmarkers -lpthread -c lowlevel.c
-
-ustd.o: ustd.c
-       gcc -g -Wall -I ../libustcomm -I. -I ../../../../libkcompat -lpthread -c ustd.c
-
-ustcomm.o: ../libustcomm/ustcomm.c
-       gcc -g -Wall -I ../share ../libustcomm/ustcomm.c
-
-ustd: ustd.o lowlevel.o ustcomm.o
-       gcc -g -Wall -lpthread -o ustd ustd.o lowlevel.o ustcomm.o
-
-.PHONY: ustd
diff --git a/ustd/Makefile.am b/ustd/Makefile.am
new file mode 100644 (file)
index 0000000..f2cb959
--- /dev/null
@@ -0,0 +1,9 @@
+bin_PROGRAMS = ustd
+ustd_SOURCES = lowlevel.c localerr.h ustd.c ustd.h $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/libustcomm/ustcomm.h $(top_builddir)/share/kref.c
+ustd_LDFLAGS = -lpthread
+
+INCLUDES = -I$(top_builddir)/share
+#INCLUDES += -I@URCU_PATH@
+INCLUDES += -I@KCOMPAT_PATH@
+INCLUDES += -I$(top_builddir)/libust
+INCLUDES += -I$(top_builddir)/libustcomm
index ab4ec7aaac38c281f3c4cc6ac8f2c735453784ff..c5a3d8bed26b10bbfdcbd885efb189209d67b332 100644 (file)
@@ -273,6 +273,7 @@ int add_buffer(pid_t pid, char *bufname)
        result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 00600);
        if(result == -1) {
                PERROR("open");
+               ERR("failed opening trace file %s", tmp);
                return -1;
        }
        buf->file_fd = fd;
This page took 0.032391 seconds and 4 git commands to generate.