add usertrace-fast
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 7 Mar 2006 15:40:53 +0000 (15:40 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 7 Mar 2006 15:40:53 +0000 (15:40 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1605 04897980-b3bd-0310-b5e0-8ef037075253

usertrace-fast/ltt-usertrace-fast.c [new file with mode: 0644]
usertrace-fast/ltt-usertrace-fast.h [new file with mode: 0644]
usertrace-fast/lttng_usertrace.c [deleted file]
usertrace-fast/lttng_usertrace.h [deleted file]

diff --git a/usertrace-fast/ltt-usertrace-fast.c b/usertrace-fast/ltt-usertrace-fast.c
new file mode 100644 (file)
index 0000000..f910e06
--- /dev/null
@@ -0,0 +1,77 @@
+
+/* LTTng user-space "fast" tracing code
+ *
+ * Copyright 2006 Mathieu Desnoyers
+ *
+ */
+
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include <syscall.h>
+#include <features.h>
+#include <pthread.h>
+#include <malloc.h>
+#include <string.h>
+
+#include "ltt_usertrace.h"
+
+/* TLS for the trace buffer
+ * http://www.dis.com/gnu/gcc/C--98-Thread-Local-Edits.html
+ *
+ * Add after paragraph 4
+ *
+ *     The storage for an object of thread storage duration shall be statically
+ *     initialized before the first statement of the thread startup function. An
+ *     object of thread storage duration shall not require dynamic
+ *     initialization.
+ */
+
+__thread struct lttng_trace_info lttng_trace_info =
+{
+       .init = 0,
+       .filter = 0,
+       .nesting = ATOMIC_INIT(0),
+       .channel.facilities = 
+               {       ATOMIC_INIT(0),
+                       ATOMIC_INIT(0),
+                       ATOMIC_INIT(0),
+                       ATOMIC_INIT(0)
+               },
+       .channel.cpu = 
+               { ATOMIC_INIT(0),
+                       ATOMIC_INIT(0),
+                       ATOMIC_INIT(0),
+                       ATOMIC_INIT(0)
+               },
+};
+
+
+static void ltt_cleanup_thread(void *arg)
+{
+       /* Flush the data in the lttng_trace_info */
+
+}
+
+
+void ltt_thread_init(void)
+{
+       _pthread_cleanup_push(&lttng_trace_info.cleanup,
+                       ltt_cleanup_thread, NULL);
+}
+
+
+void __attribute__((constructor)) __ltt_usertrace_fast_init(void)
+{
+       int err;
+
+  printf("LTTng usertrace-fast init\n");
+
+
+
+}
+
diff --git a/usertrace-fast/ltt-usertrace-fast.h b/usertrace-fast/ltt-usertrace-fast.h
new file mode 100644 (file)
index 0000000..a740a83
--- /dev/null
@@ -0,0 +1,46 @@
+
+/* LTTng user-space "fast" tracing header
+ *
+ * Copyright 2006 Mathieu Desnoyers
+ *
+ */
+
+#ifndef _LTT_USERTRACE_FAST_H
+#define _LTT_USERTRACE_FAST_H
+
+#include <errno.h>
+#include <asm/atomic.h>
+
+#ifndef        LTT_BUF_SIZE_CPU
+#define LTT_BUF_SIZE_CPU 1048576
+#endif //LTT_BUF_SIZE_CPU
+
+#ifndef        LTT_BUF_SIZE_FACILITIES
+#define LTT_BUF_SIZE_FACILITIES 4096
+#endif //LTT_BUF_SIZE_FACILITIES
+
+struct ltt_buf {
+       atomic_t        offset;
+       atomic_t        reserve_count;
+       atomic_t        commit_count;
+
+       atomic_t        events_lost;
+};
+
+struct lttng_trace_info {
+       struct _pthread_cleanup_buffer cleanup;
+       int filter;
+       atomic_t nesting;
+       struct {
+               struct ltt_buf facilities;
+               char facilities_buf[LTT_BUF_SIZE_FACILITIES] __attribute__ ((aligned (8)));
+               struct ltt_buf cpu;
+               char cpu_buf[LTT_BUF_SIZE_CPU] __attribute__ ((aligned (8)));
+       } channel;
+};
+
+extern __thread struct lttng_trace_info lttng_trace_info;
+
+void ltt_thread_init(void);
+
+#endif //_LTT_USERTRACE_FAST_H
diff --git a/usertrace-fast/lttng_usertrace.c b/usertrace-fast/lttng_usertrace.c
deleted file mode 100644 (file)
index 9b4b303..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-
-/* LTTng user-space tracing code
- *
- * Copyright 2006 Mathieu Desnoyers
- *
- */
-
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <signal.h>
-#include <syscall.h>
-#include <features.h>
-#include <pthread.h>
-#include <malloc.h>
-#include <string.h>
-
-#include "lttng_usertrace.h"
-
-/* TLS for the trace buffer
- * http://www.dis.com/gnu/gcc/C--98-Thread-Local-Edits.html
- *
- * Add after paragraph 4
- *
- *     The storage for an object of thread storage duration shall be statically
- *     initialized before the first statement of the thread startup function. An
- *     object of thread storage duration shall not require dynamic
- *     initialization.
- */
-
-__thread struct lttng_trace_info lttng_trace_info =
-{
-       .init = 0,
-       .filter = 0,
-       .nesting = ATOMIC_INIT(0),
-       .channel.facilities = 
-               {       ATOMIC_INIT(0),
-                       ATOMIC_INIT(0),
-                       ATOMIC_INIT(0),
-                       ATOMIC_INIT(0)
-               },
-       .channel.cpu = 
-               { ATOMIC_INIT(0),
-                       ATOMIC_INIT(0),
-                       ATOMIC_INIT(0),
-                       ATOMIC_INIT(0)
-               },
-};
-
-
-static void ltt_cleanup_thread(void *arg)
-{
-       /* Flush the data in the lttng_trace_info */
-
-}
-
-
-void ltt_thread_init(void)
-{
-       _pthread_cleanup_push(&lttng_trace_info.cleanup,
-                       ltt_cleanup_thread, NULL);
-}
-
-
-void __attribute__((constructor)) __lttng_user_init(void)
-{
-       int err;
-
-  printf("LTTng usertrace-fast init\n");
-
-
-
-}
-
diff --git a/usertrace-fast/lttng_usertrace.h b/usertrace-fast/lttng_usertrace.h
deleted file mode 100644 (file)
index 51d0767..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-
-/* LTTng user-space tracing header
- *
- * Copyright 2006 Mathieu Desnoyers
- *
- */
-
-#ifndef _LTTNG_USERTRACE_H
-#define _LTTNG_USERTRACE_H
-
-#include <errno.h>
-#include <asm/atomic.h>
-
-#ifndef        LTT_BUF_SIZE_CPU
-#define LTT_BUF_SIZE_CPU 1048576
-#endif //LTT_BUF_SIZE_CPU
-
-#ifndef        LTT_BUF_SIZE_FACILITIES
-#define LTT_BUF_SIZE_FACILITIES 4096
-#endif //LTT_BUF_SIZE_FACILITIES
-
-struct ltt_buf {
-       atomic_t        offset;
-       atomic_t        reserve_count;
-       atomic_t        commit_count;
-
-       atomic_t        events_lost;
-};
-
-struct lttng_trace_info {
-       struct _pthread_cleanup_buffer cleanup;
-       int filter;
-       atomic_t nesting;
-       struct {
-               struct ltt_buf facilities;
-               char facilities_buf[LTT_BUF_SIZE_FACILITIES] __attribute__ ((aligned (8)));
-               struct ltt_buf cpu;
-               char cpu_buf[LTT_BUF_SIZE_CPU] __attribute__ ((aligned (8)));
-       } channel;
-};
-
-extern __thread struct lttng_trace_info lttng_trace_info;
-
-void ltt_thread_init(void);
-
-#endif //_LTTNG_USERTRACE_H
This page took 0.026556 seconds and 4 git commands to generate.