Move print.h header to upper level dir
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 30 Nov 2016 22:32:23 +0000 (17:32 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:42 +0000 (12:57 -0400)
Can be used by both fs and lttng-live.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/Makefile.am
plugins/ctf/fs-src/data-stream.c
plugins/ctf/fs-src/file.c
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/metadata.c
plugins/ctf/fs-src/print.h [deleted file]
plugins/ctf/print.h [new file with mode: 0644]

index 566577ae96705e92a88ac562bdfc4849b3701e5e..297106da2628576403832bcfee28468834bb2089 100644 (file)
@@ -2,6 +2,8 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
 SUBDIRS = common fs-src fs-sink lttng-live
 
+noinst_HEADERS = print.h
+
 plugindir = "$(PLUGINSDIR)"
 plugin_LTLIBRARIES = libbabeltrace-plugin-ctf.la
 
index 016e3fc5411713944ac016a7e833fddc5999e00c..bc0d12178f839dafbc7600085a7697e6fae2a497 100644 (file)
@@ -42,7 +42,8 @@
 
 #define PRINT_ERR_STREAM       ctf_fs->error_fp
 #define PRINT_PREFIX           "ctf-fs-data-stream"
-#include "print.h"
+#define PRINT_DBG_CHECK                ctf_fs_debug
+#include "../print.h"
 
 static inline
 size_t remaining_mmap_bytes(struct ctf_fs_stream *stream)
index 8b756496a9d82064981ce1351db6efd34b3ede1e..0d0ed7e0a21ddb66143260b05920c815028def25 100644 (file)
@@ -28,7 +28,8 @@
 
 #define PRINT_ERR_STREAM       ctf_fs->error_fp
 #define PRINT_PREFIX           "ctf-fs-file"
-#include "print.h"
+#define PRINT_DBG_CHECK                ctf_fs_debug
+#include "../print.h"
 
 #include "file.h"
 
index a20e7d6c1b21a84e111a86070fb5e8c9586460d5..d50966f7cbf28956f6a39bb459fe33233605dff3 100644 (file)
@@ -48,7 +48,8 @@
 
 #define PRINT_ERR_STREAM       ctf_fs->error_fp
 #define PRINT_PREFIX           "ctf-fs"
-#include "print.h"
+#define PRINT_DBG_CHECK                ctf_fs_debug
+#include "../print.h"
 #define METADATA_TEXT_SIG      "/* CTF 1.8"
 
 BT_HIDDEN
index 13cc816e124596c3b9560c4bc659decfdec1325d..2425273328bd9cf70ad5f77877f6c8a3bf4f6b33 100644 (file)
@@ -34,7 +34,8 @@
 
 #define PRINT_ERR_STREAM       ctf_fs->error_fp
 #define PRINT_PREFIX           "ctf-fs-metadata"
-#include "print.h"
+#define PRINT_DBG_CHECK                ctf_fs_debug
+#include "../print.h"
 
 #include "fs.h"
 #include "file.h"
diff --git a/plugins/ctf/fs-src/print.h b/plugins/ctf/fs-src/print.h
deleted file mode 100644 (file)
index 9daf7ea..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef CTF_FS_PRINT_H
-#define CTF_FS_PRINT_H
-
-/*
- * Define PRINT_PREFIX and PRINT_ERR_STREAM, then include this file.
- *
- * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdio.h>
-
-#define PERR(fmt, ...)                                                 \
-       do {                                                            \
-               if (PRINT_ERR_STREAM) {                                 \
-                       fprintf(PRINT_ERR_STREAM,                       \
-                               "Error: " PRINT_PREFIX ": " fmt,        \
-                               ##__VA_ARGS__);                         \
-               }                                                       \
-       } while (0)
-
-#define PWARN(fmt, ...)                                                        \
-       do {                                                            \
-               if (PRINT_ERR_STREAM) {                                 \
-                       fprintf(PRINT_ERR_STREAM,                       \
-                               "Warning: " PRINT_PREFIX ": " fmt,      \
-                               ##__VA_ARGS__);                         \
-               }                                                       \
-       } while (0)
-
-#define PDBG(fmt, ...)                                                 \
-       do {                                                            \
-               if (ctf_fs_debug) {                                     \
-                       fprintf(stderr,                                 \
-                               "Debug: " PRINT_PREFIX ": " fmt,        \
-                               ##__VA_ARGS__);                         \
-               }                                                       \
-       } while (0)
-
-#endif /* CTF_FS_PRINT_H */
diff --git a/plugins/ctf/print.h b/plugins/ctf/print.h
new file mode 100644 (file)
index 0000000..eb5b30c
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef CTF_PRINT_H
+#define CTF_PRINT_H
+
+/*
+ * Define PRINT_PREFIX, PRINT_DBG_CHECK, and PRINT_ERR_STREAM, then
+ * include this file.
+ *
+ * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+
+#define PERR(fmt, ...)                                                 \
+       do {                                                            \
+               if (PRINT_ERR_STREAM) {                                 \
+                       fprintf(PRINT_ERR_STREAM,                       \
+                               "Error: " PRINT_PREFIX ": " fmt,        \
+                               ##__VA_ARGS__);                         \
+               }                                                       \
+       } while (0)
+
+#define PWARN(fmt, ...)                                                        \
+       do {                                                            \
+               if (PRINT_ERR_STREAM) {                                 \
+                       fprintf(PRINT_ERR_STREAM,                       \
+                               "Warning: " PRINT_PREFIX ": " fmt,      \
+                               ##__VA_ARGS__);                         \
+               }                                                       \
+       } while (0)
+
+#define PDBG(fmt, ...)                                                 \
+       do {                                                            \
+               if (PRINT_DBG_CHECK) {                                  \
+                       fprintf(stderr,                                 \
+                               "Debug: " PRINT_PREFIX ": " fmt,        \
+                               ##__VA_ARGS__);                         \
+               }                                                       \
+       } while (0)
+
+#endif /* CTF_PRINT_H */
This page took 0.028525 seconds and 4 git commands to generate.