From 0cb31e39840f9a8be916b0ad6447559d1a1b800e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sun, 9 Oct 2016 22:46:35 -0400 Subject: [PATCH] Rename correlator to muxer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- configure.ac | 2 +- plugins/Makefile.am | 2 +- plugins/{correlator => muxer}/Makefile.am | 8 ++-- .../correlator.c => muxer/muxer.c} | 44 +++++++++---------- plugins/muxer/muxer.h | 38 ++++++++++++++++ 5 files changed, 66 insertions(+), 28 deletions(-) rename plugins/{correlator => muxer}/Makefile.am (61%) rename plugins/{correlator/correlator.c => muxer/muxer.c} (72%) create mode 100644 plugins/muxer/muxer.h diff --git a/configure.ac b/configure.ac index ac7e4393..afc696d9 100644 --- a/configure.ac +++ b/configure.ac @@ -383,7 +383,7 @@ AC_CONFIG_FILES([ plugins/ctf/common/notif-iter/Makefile plugins/ctf/fs/Makefile plugins/ctf/lttng-live/Makefile - plugins/correlator/Makefile + plugins/muxer/Makefile plugins/text/Makefile babeltrace.pc babeltrace-ctf.pc diff --git a/plugins/Makefile.am b/plugins/Makefile.am index eee13497..6575b0be 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1 +1 @@ -SUBDIRS = ctf text correlator +SUBDIRS = ctf text muxer diff --git a/plugins/correlator/Makefile.am b/plugins/muxer/Makefile.am similarity index 61% rename from plugins/correlator/Makefile.am rename to plugins/muxer/Makefile.am index 43e26164..84fce07b 100644 --- a/plugins/correlator/Makefile.am +++ b/plugins/muxer/Makefile.am @@ -3,12 +3,12 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include SUBDIRS = . plugindir = "$(PLUGINSDIR)" -plugin_LTLIBRARIES = libbabeltrace-plugin-correlator.la +plugin_LTLIBRARIES = libbabeltrace-plugin-muxer.la -libbabeltrace_plugin_correlator_la_SOURCES = \ - correlator.h correlator.c +libbabeltrace_plugin_muxer_la_SOURCES = \ + muxer.h muxer.c -libbabeltrace_plugin_correlator_la_LDFLAGS = \ +libbabeltrace_plugin_muxer_la_LDFLAGS = \ -version-info $(BABELTRACE_LIBRARY_VERSION) libbabeltrace_plugin_ctf_text_la_LIBADD = \ diff --git a/plugins/correlator/correlator.c b/plugins/muxer/muxer.c similarity index 72% rename from plugins/correlator/correlator.c rename to plugins/muxer/muxer.c index c0c9dc72..ba78cfb0 100644 --- a/plugins/correlator/correlator.c +++ b/plugins/muxer/muxer.c @@ -1,7 +1,7 @@ /* - * correlator.c + * muxer.c * - * Babeltrace Trace Correlator + * Babeltrace Trace Muxer * * Copyright 2016 Jérémie Galarneau * @@ -32,71 +32,71 @@ #include #include #include -#include "correlator.h" +#include "muxer.h" static -void destroy_correlator_data(struct correlator *correlator) +void destroy_muxer_data(struct muxer *muxer) { - g_free(correlator); + g_free(muxer); } static -struct correlator *create_correlator(void) +struct muxer *create_muxer(void) { - struct correlator *correlator; + struct muxer *muxer; - correlator = g_new0(struct correlator, 1); - if (!correlator) { + muxer = g_new0(struct muxer, 1); + if (!muxer) { goto end; } end: - return correlator; + return muxer; } static -void destroy_correlator(struct bt_component *component) +void destroy_muxer(struct bt_component *component) { void *data = bt_component_get_private_data(component); - destroy_correlator_data(data); + destroy_muxer_data(data); } -enum bt_component_status correlator_component_init( +enum bt_component_status muxer_component_init( struct bt_component *component, struct bt_value *params) { enum bt_component_status ret; - struct correlator *correlator = create_correlator(); + struct muxer *muxer = create_muxer(); - if (!correlator) { + if (!muxer) { ret = BT_COMPONENT_STATUS_NOMEM; goto end; } ret = bt_component_set_destroy_cb(component, - destroy_correlator); + destroy_muxer); if (ret != BT_COMPONENT_STATUS_OK) { goto error; } - ret = bt_component_set_private_data(component, correlator); + ret = bt_component_set_private_data(component, muxer); if (ret != BT_COMPONENT_STATUS_OK) { goto error; } end: return ret; error: - destroy_correlator_data(correlator); + destroy_muxer_data(muxer); return ret; } /* Initialize plug-in entry points. */ -BT_PLUGIN_NAME("correlator"); -BT_PLUGIN_DESCRIPTION("Babeltrace Trace Correlator Plug-In."); +BT_PLUGIN_NAME("muxer"); +BT_PLUGIN_DESCRIPTION("Babeltrace Trace Muxer Plug-In."); BT_PLUGIN_AUTHOR("Jérémie Galarneau"); BT_PLUGIN_LICENSE("MIT"); BT_PLUGIN_COMPONENT_CLASSES_BEGIN -BT_PLUGIN_FILTER_COMPONENT_CLASS_ENTRY("correlator", +BT_PLUGIN_FILTER_COMPONENT_CLASS_ENTRY("muxer", "Time-correlate multiple traces.", - correlator_component_init) + muxer_component_init) BT_PLUGIN_COMPONENT_CLASSES_END diff --git a/plugins/muxer/muxer.h b/plugins/muxer/muxer.h new file mode 100644 index 00000000..77937523 --- /dev/null +++ b/plugins/muxer/muxer.h @@ -0,0 +1,38 @@ +#ifndef BABELTRACE_PLUGIN_MUXER_H +#define BABELTRACE_PLUGIN_MUXER_H + +/* + * BabelTrace - Trace Muxer Plug-in + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 +#include +#include + +struct muxer { + GHashTable *trace_clocks; +}; + +#endif /* BABELTRACE_PLUGIN_MUXER_H */ -- 2.34.1