X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcounter%2Fcounter.c;h=60edad0c5b63b9ea2a1f3f92e9ca42e5ab400217;hb=a616fb4e0a0245ae2cbd4614910480df19aa23d6;hp=b71b43ae7c3828b2c317d4fd10d8036e827aa7bc;hpb=74cc1f594e05b5a3524529f018d85efaad53f9a3;p=lttng-ust.git diff --git a/src/common/counter/counter.c b/src/common/counter/counter.c index b71b43ae..60edad0c 100644 --- a/src/common/counter/counter.c +++ b/src/common/counter/counter.c @@ -118,7 +118,7 @@ int lttng_counter_set_cpu_shm(struct lib_counter *counter, int cpu, int fd) struct lib_counter_config *config = &counter->config; struct lib_counter_layout *layout; - if (cpu < 0 || cpu >= num_possible_cpus()) + if (cpu < 0 || cpu >= get_possible_cpus_array_len()) return -EINVAL; if (!(config->alloc & COUNTER_ALLOC_PER_CPU)) @@ -171,7 +171,7 @@ int validate_args(const struct lib_counter_config *config, int nr_counter_cpu_fds, const int *counter_cpu_fds) { - int nr_cpus = num_possible_cpus(); + int nr_cpus = get_possible_cpus_array_len(); if (CAA_BITS_PER_LONG != 64 && config->counter_size == COUNTER_SIZE_64_BIT) { WARN_ON_ONCE(1); @@ -210,7 +210,7 @@ struct lib_counter *lttng_counter_create(const struct lib_counter_config *config size_t dimension, nr_elem = 1; int cpu, ret; int nr_handles = 0; - int nr_cpus = num_possible_cpus(); + int nr_cpus = get_possible_cpus_array_len(); if (validate_args(config, nr_dimensions, max_nr_elem, global_sum_step, global_counter_fd, nr_counter_cpu_fds, @@ -309,7 +309,7 @@ int lttng_counter_get_cpu_shm(struct lib_counter *counter, int cpu, int *fd, siz struct lib_counter_layout *layout; int shm_fd; - if (cpu >= num_possible_cpus()) + if (cpu >= get_possible_cpus_array_len()) return -1; layout = &counter->percpu_counters[cpu]; shm_fd = layout->shm_fd; @@ -335,13 +335,13 @@ int lttng_counter_read(const struct lib_counter_config *config, switch (config->alloc) { case COUNTER_ALLOC_PER_CPU: - if (cpu < 0 || cpu >= num_possible_cpus()) + if (cpu < 0 || cpu >= get_possible_cpus_array_len()) return -EINVAL; layout = &counter->percpu_counters[cpu]; break; case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: if (cpu >= 0) { - if (cpu >= num_possible_cpus()) + if (cpu >= get_possible_cpus_array_len()) return -EINVAL; layout = &counter->percpu_counters[cpu]; } else { @@ -469,13 +469,13 @@ int lttng_counter_clear_cpu(const struct lib_counter_config *config, switch (config->alloc) { case COUNTER_ALLOC_PER_CPU: - if (cpu < 0 || cpu >= num_possible_cpus()) + if (cpu < 0 || cpu >= get_possible_cpus_array_len()) return -EINVAL; layout = &counter->percpu_counters[cpu]; break; case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: if (cpu >= 0) { - if (cpu >= num_possible_cpus()) + if (cpu >= get_possible_cpus_array_len()) return -EINVAL; layout = &counter->percpu_counters[cpu]; } else {