Remove unused `src/lib/trace-ir/clock-snapshot-set.h`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 18 Oct 2019 17:38:44 +0000 (13:38 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:53 +0000 (15:14 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I43fb1d20ef0e88748e70c034f77ce34c7eed0b8d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2219
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/lib/trace-ir/Makefile.am
src/lib/trace-ir/clock-snapshot-set.h [deleted file]

index 11e1e542e93becee3dad24fe811b04ed1aaeecf5..5ce62239682411c91310868de258fd431e51f2cd 100644 (file)
@@ -7,7 +7,6 @@ libtrace_ir_la_SOURCES = \
        clock-class.h \
        clock-snapshot.c \
        clock-snapshot.h \
-       clock-snapshot-set.h \
        event.c \
        event-class.c \
        event-class.h \
diff --git a/src/lib/trace-ir/clock-snapshot-set.h b/src/lib/trace-ir/clock-snapshot-set.h
deleted file mode 100644 (file)
index 7c3e7eb..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-#ifndef BABELTRACE_GRAPH_CLOCK_SNAPSHOT_SET_H
-#define BABELTRACE_GRAPH_CLOCK_SNAPSHOT_SET_H
-
-/*
- * Copyright 2018 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.
- */
-
-/* Protection: this file uses BT_LIB_LOG*() macros directly */
-#ifndef BT_LIB_LOG_SUPPORTED
-# error Please include "lib/logging.h" before including this file.
-#endif
-
-#include <stdint.h>
-#include <glib.h>
-#include "common/assert.h"
-
-#include "clock-snapshot.h"
-#include "clock-class.h"
-
-/* Protection: this file uses BT_LIB_LOG*() macros directly */
-#ifndef BT_LIB_LOG_SUPPORTED
-# error Please include "lib/logging.h" before including this file.
-#endif
-
-struct bt_clock_snapshot_set {
-       /* Unique objects owned by this */
-       GPtrArray *clock_snapshots;
-
-       /* Weak; points to one of the clock snapshots above */
-       struct bt_clock_snapshot *default_cs;
-};
-
-static inline
-int bt_clock_snapshot_set_initialize(struct bt_clock_snapshot_set *cs_set)
-{
-       int ret = 0;
-
-       cs_set->clock_snapshots = g_ptr_array_sized_new(1);
-       if (!cs_set->clock_snapshots) {
-               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one GPtrArray.");
-               ret = -1;
-               goto end;
-       }
-
-       cs_set->default_cs = NULL;
-
-end:
-       return ret;
-}
-
-static inline
-void bt_clock_snapshot_set_reset(struct bt_clock_snapshot_set *cs_set)
-{
-       uint64_t i;
-
-       BT_ASSERT_DBG(cs_set);
-       BT_ASSERT_DBG(cs_set->clock_snapshots);
-
-       for (i = 0; i < cs_set->clock_snapshots->len; i++) {
-               struct bt_clock_snapshot *cs = cs_set->clock_snapshots->pdata[i];
-
-               BT_ASSERT_DBG(cs);
-               bt_clock_snapshot_reset(cs);
-       }
-
-       cs_set->default_cs = NULL;
-}
-
-static inline
-void bt_clock_snapshot_set_finalize(struct bt_clock_snapshot_set *cs_set)
-{
-       uint64_t i;
-
-       BT_ASSERT(cs_set);
-
-       if (cs_set->clock_snapshots) {
-               for (i = 0; i < cs_set->clock_snapshots->len; i++) {
-                       struct bt_clock_snapshot *cs =
-                               cs_set->clock_snapshots->pdata[i];
-
-                       BT_ASSERT(cs);
-                       bt_clock_snapshot_recycle(cs);
-               }
-
-               g_ptr_array_free(cs_set->clock_snapshots, TRUE);
-       }
-
-       cs_set->default_cs = NULL;
-}
-
-static inline
-int bt_clock_snapshot_set_set_clock_snapshot(struct bt_clock_snapshot_set *cs_set,
-               struct bt_clock_class *cc, uint64_t raw_value)
-{
-       int ret = 0;
-       struct bt_clock_snapshot *clock_snapshot = NULL;
-       uint64_t i;
-
-       BT_ASSERT_DBG(cs_set);
-       BT_ASSERT_DBG(cc);
-
-       /*
-        * Check if we already have a value for this clock class.
-        *
-        * TODO: When we have many clock classes, make this more
-        * efficient.
-        */
-       for (i = 0; i < cs_set->clock_snapshots->len; i++) {
-               struct bt_clock_snapshot *cs = cs_set->clock_snapshots->pdata[i];
-
-               BT_ASSERT_DBG(cs);
-
-               if (cs->clock_class == cc) {
-                       clock_snapshot = cs;
-                       break;
-               }
-       }
-
-       if (!clock_snapshot) {
-               clock_snapshot = bt_clock_snapshot_create(cc);
-               if (!clock_snapshot) {
-                       BT_LIB_LOGE_APPEND_CAUSE(
-                               "Cannot create a clock snapshot from a clock class: "
-                               "%![cc-]+K", cc);
-                       ret = -1;
-                       goto end;
-               }
-
-               g_ptr_array_add(cs_set->clock_snapshots, clock_snapshot);
-       }
-
-       bt_clock_snapshot_set_raw_value(clock_snapshot, raw_value);
-
-end:
-       return ret;
-}
-
-static inline
-void  bt_clock_snapshot_set_set_default_clock_snapshot(
-               struct bt_clock_snapshot_set *cs_set, uint64_t raw_value)
-{
-       BT_ASSERT_DBG(cs_set);
-       BT_ASSERT_DBG(cs_set->default_cs);
-       bt_clock_snapshot_set_raw_value(cs_set->default_cs, raw_value);
-}
-
-#endif /* BABELTRACE_GRAPH_CLOCK_SNAPSHOT_SET_H */
This page took 0.026443 seconds and 4 git commands to generate.