From cd00e1d36ebc9d77c1c69ac679f8af79196508e7 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 30 Nov 2016 17:32:23 -0500 Subject: [PATCH] Move print.h header to upper level dir MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Can be used by both fs and lttng-live. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- plugins/ctf/Makefile.am | 2 ++ plugins/ctf/fs-src/data-stream.c | 3 ++- plugins/ctf/fs-src/file.c | 3 ++- plugins/ctf/fs-src/fs.c | 3 ++- plugins/ctf/fs-src/metadata.c | 3 ++- plugins/ctf/{fs-src => }/print.h | 11 ++++++----- 6 files changed, 16 insertions(+), 9 deletions(-) rename plugins/ctf/{fs-src => }/print.h (90%) diff --git a/plugins/ctf/Makefile.am b/plugins/ctf/Makefile.am index 566577ae..297106da 100644 --- a/plugins/ctf/Makefile.am +++ b/plugins/ctf/Makefile.am @@ -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 diff --git a/plugins/ctf/fs-src/data-stream.c b/plugins/ctf/fs-src/data-stream.c index 016e3fc5..bc0d1217 100644 --- a/plugins/ctf/fs-src/data-stream.c +++ b/plugins/ctf/fs-src/data-stream.c @@ -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) diff --git a/plugins/ctf/fs-src/file.c b/plugins/ctf/fs-src/file.c index 8b756496..0d0ed7e0 100644 --- a/plugins/ctf/fs-src/file.c +++ b/plugins/ctf/fs-src/file.c @@ -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" diff --git a/plugins/ctf/fs-src/fs.c b/plugins/ctf/fs-src/fs.c index a20e7d6c..d50966f7 100644 --- a/plugins/ctf/fs-src/fs.c +++ b/plugins/ctf/fs-src/fs.c @@ -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 diff --git a/plugins/ctf/fs-src/metadata.c b/plugins/ctf/fs-src/metadata.c index 13cc816e..24252733 100644 --- a/plugins/ctf/fs-src/metadata.c +++ b/plugins/ctf/fs-src/metadata.c @@ -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/print.h similarity index 90% rename from plugins/ctf/fs-src/print.h rename to plugins/ctf/print.h index 9daf7ea4..eb5b30c8 100644 --- a/plugins/ctf/fs-src/print.h +++ b/plugins/ctf/print.h @@ -1,8 +1,9 @@ -#ifndef CTF_FS_PRINT_H -#define CTF_FS_PRINT_H +#ifndef CTF_PRINT_H +#define CTF_PRINT_H /* - * Define PRINT_PREFIX and PRINT_ERR_STREAM, then include this file. + * Define PRINT_PREFIX, PRINT_DBG_CHECK, and PRINT_ERR_STREAM, then + * include this file. * * Copyright (c) 2016 Philippe Proulx * @@ -47,11 +48,11 @@ #define PDBG(fmt, ...) \ do { \ - if (ctf_fs_debug) { \ + if (PRINT_DBG_CHECK) { \ fprintf(stderr, \ "Debug: " PRINT_PREFIX ": " fmt, \ ##__VA_ARGS__); \ } \ } while (0) -#endif /* CTF_FS_PRINT_H */ +#endif /* CTF_PRINT_H */ -- 2.34.1