X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libcounter%2Fcounter.c;h=fae7266cde315364ff6ca1d61c47bc666e625392;hb=33b563d60bb08300f2879a7c67f5f6483ccf3943;hp=4010d5dd7f152b8c29d300d4e15ac751a6c04cc5;hpb=ebabbf580131acd1fe246c4d31fc5c044d36a038;p=lttng-ust.git diff --git a/libcounter/counter.c b/libcounter/counter.c index 4010d5dd..fae7266c 100644 --- a/libcounter/counter.c +++ b/libcounter/counter.c @@ -5,18 +5,18 @@ * Copyright (C) 2020 Mathieu Desnoyers */ -#define _GNU_SOURCE #include #include "counter.h" #include "counter-internal.h" -#include #include #include #include -#include -#include +#include #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) { @@ -75,9 +75,9 @@ static int lttng_counter_layout_init(struct lib_counter *counter, int cpu, int s 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. */ @@ -188,7 +188,7 @@ int validate_args(const struct lib_counter_config *config, 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;