* Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
-#define _GNU_SOURCE
#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>
-#include <helper.h>
-#include <lttng/align.h>
+#include <ust-helper.h>
#include "smp.h"
#include "shm.h"
+#include "ust-compat.h"
+
+#include "ust-bitmap.h"
static size_t lttng_counter_get_dimension_nr_elements(struct lib_counter_dimension *dimension)
{
return dimension->max_nr_elem;
}
-static int lttng_counter_init_stride(const struct lib_counter_config *config,
- struct lib_counter *counter)
+static int lttng_counter_init_stride(
+ const struct lib_counter_config *config __attribute__((unused)),
+ struct lib_counter *counter)
{
size_t nr_dimensions = counter->nr_dimensions;
size_t stride = 1;
counters_offset = shm_length;
shm_length += counter_size * nr_elem;
overflow_offset = shm_length;
- shm_length += ALIGN(nr_elem, 8) / 8;
+ shm_length += LTTNG_UST_ALIGN(nr_elem, 8) / 8;
underflow_offset = shm_length;
- shm_length += ALIGN(nr_elem, 8) / 8;
+ shm_length += LTTNG_UST_ALIGN(nr_elem, 8) / 8;
layout->shm_len = shm_length;
if (counter->is_daemon) {
/* Allocate and clear shared memory. */
static
int validate_args(const struct lib_counter_config *config,
- size_t nr_dimensions,
+ size_t nr_dimensions __attribute__((unused)),
const size_t *max_nr_elem,
int64_t global_sum_step,
int global_counter_fd,
return -1;
if (!(config->alloc & COUNTER_ALLOC_PER_CPU) && counter_cpu_fds)
return -1;
- if (!(config->alloc & COUNTER_ALLOC_PER_CPU) && counter_cpu_fds >= 0)
+ if (!(config->alloc & COUNTER_ALLOC_PER_CPU) && nr_counter_cpu_fds >= 0)
return -1;
if (counter_cpu_fds && nr_cpus != nr_counter_cpu_fds)
return -1;