Make 'lttng/bitmap.h' a private header
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 25 Feb 2021 20:52:52 +0000 (15:52 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Mar 2021 19:24:07 +0000 (14:24 -0500)
This header only defines static inline utils functions, make it private.

Change-Id: I88bb29532bfb24e7e418ddec1e410850df3480b2
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/Makefile.am
include/lttng/bitmap.h [deleted file]
include/ust-bitmap.h [new file with mode: 0644]
libcounter/counter-api.h
libcounter/counter.c

index 9e03290cd06e30f21c9bb7050690c062c58d436d..101e8ac72b47236f1c8dc0ae6efb6e23beff85c3 100644 (file)
@@ -33,7 +33,6 @@ nobase_include_HEADERS = \
        lttng/ust-getcpu.h \
        lttng/ust-elf.h \
        lttng/counter-config.h \
-       lttng/bitmap.h \
        lttng/urcu/pointer.h \
        lttng/urcu/urcu-ust.h \
        lttng/urcu/static/pointer.h \
@@ -54,6 +53,7 @@ nobase_nodist_include_HEADERS = \
 noinst_HEADERS = \
        usterr-signal-safe.h \
        ust-snprintf.h \
+       ust-bitmap.h \
        ust-comm.h \
        ust-fd.h \
        ust-tid.h \
diff --git a/include/lttng/bitmap.h b/include/lttng/bitmap.h
deleted file mode 100644 (file)
index 29cc22e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * LTTng Bitmap API
- */
-
-#ifndef _LTTNG_BITMAP_H
-#define _LTTNG_BITMAP_H
-
-#include <urcu/compiler.h>
-#include <urcu/system.h>
-#include <urcu/uatomic.h>
-#include <stdbool.h>
-
-static inline void lttng_bitmap_index(unsigned int index, unsigned int *word,
-               unsigned int *bit)
-{
-       *word = index / CAA_BITS_PER_LONG;
-       *bit = index % CAA_BITS_PER_LONG;
-}
-
-static inline void lttng_bitmap_set_bit(unsigned int index, unsigned long *p)
-{
-       unsigned int word, bit;
-       unsigned long val;
-
-       lttng_bitmap_index(index, &word, &bit);
-       val = 1U << bit;
-       uatomic_or(p + word, val);
-}
-
-static inline void lttng_bitmap_clear_bit(unsigned int index, unsigned long *p)
-{
-       unsigned int word, bit;
-       unsigned long val;
-
-       lttng_bitmap_index(index, &word, &bit);
-       val = ~(1U << bit);
-       uatomic_and(p + word, val);
-}
-
-static inline bool lttng_bitmap_test_bit(unsigned int index, unsigned long *p)
-{
-       unsigned int word, bit;
-
-       lttng_bitmap_index(index, &word, &bit);
-       return (CMM_LOAD_SHARED(p[word]) >> bit) & 0x1;
-}
-
-#endif /* _LTTNG_BITMAP_H */
diff --git a/include/ust-bitmap.h b/include/ust-bitmap.h
new file mode 100644 (file)
index 0000000..29cc22e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * LTTng Bitmap API
+ */
+
+#ifndef _LTTNG_BITMAP_H
+#define _LTTNG_BITMAP_H
+
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+#include <urcu/uatomic.h>
+#include <stdbool.h>
+
+static inline void lttng_bitmap_index(unsigned int index, unsigned int *word,
+               unsigned int *bit)
+{
+       *word = index / CAA_BITS_PER_LONG;
+       *bit = index % CAA_BITS_PER_LONG;
+}
+
+static inline void lttng_bitmap_set_bit(unsigned int index, unsigned long *p)
+{
+       unsigned int word, bit;
+       unsigned long val;
+
+       lttng_bitmap_index(index, &word, &bit);
+       val = 1U << bit;
+       uatomic_or(p + word, val);
+}
+
+static inline void lttng_bitmap_clear_bit(unsigned int index, unsigned long *p)
+{
+       unsigned int word, bit;
+       unsigned long val;
+
+       lttng_bitmap_index(index, &word, &bit);
+       val = ~(1U << bit);
+       uatomic_and(p + word, val);
+}
+
+static inline bool lttng_bitmap_test_bit(unsigned int index, unsigned long *p)
+{
+       unsigned int word, bit;
+
+       lttng_bitmap_index(index, &word, &bit);
+       return (CMM_LOAD_SHARED(p[word]) >> bit) & 0x1;
+}
+
+#endif /* _LTTNG_BITMAP_H */
index cfce44d9dd9c2b61bc0012e102b3189b3f95e15f..540bd11f2e75216310af63f50fe187c12e799deb 100644 (file)
@@ -15,7 +15,7 @@
 #include "counter-internal.h"
 #include <urcu/compiler.h>
 #include <urcu/uatomic.h>
-#include <lttng/bitmap.h>
+#include "ust-bitmap.h"
 #include "../libringbuffer/getcpu.h"
 
 /*
index ca25bda6c80c69f3e3cbc42b2bdaa8d2255c20a9..c98589db8329c7b16145a73e11db9dbdd57def7a 100644 (file)
@@ -9,7 +9,6 @@
 #include <errno.h>
 #include "counter.h"
 #include "counter-internal.h"
-#include <lttng/bitmap.h>
 #include <urcu/system.h>
 #include <urcu/compiler.h>
 #include <stdbool.h>
@@ -18,6 +17,8 @@
 #include "smp.h"
 #include "shm.h"
 
+#include "ust-bitmap.h"
+
 static size_t lttng_counter_get_dimension_nr_elements(struct lib_counter_dimension *dimension)
 {
        return dimension->max_nr_elem;
This page took 0.028353 seconds and 4 git commands to generate.