Fix: libcounter: __lttng_counter_add global sum step alloc vs sync mixup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 2 Sep 2022 20:13:46 +0000 (16:13 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Jul 2024 20:58:48 +0000 (16:58 -0400)
The global sum step needs to be handled on per-cpu allocated counters,
not per-cpu sync.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9b6ef221fb099c9fc602dfdb9a93d70ae2192500

include/counter/counter-api.h

index c9f2b141d80e405166364ee9dc98b9d41a2349b5..be372f45c32a89f862eaa358e75a319da9c54d15 100644 (file)
@@ -56,8 +56,8 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                int8_t global_sum_step = counter->global_sum_step.s8;
 
                res = *int_p;
-               switch (sync) {
-               case COUNTER_SYNC_PER_CPU:
+               switch (alloc) {
+               case COUNTER_ALLOC_PER_CPU:
                {
                        do {
                                move_sum = 0;
@@ -72,7 +72,7 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                        } while (old != res);
                        break;
                }
-               case COUNTER_SYNC_GLOBAL:
+               case COUNTER_ALLOC_GLOBAL:
                {
                        do {
                                old = res;
@@ -97,8 +97,8 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                int16_t global_sum_step = counter->global_sum_step.s16;
 
                res = *int_p;
-               switch (sync) {
-               case COUNTER_SYNC_PER_CPU:
+               switch (alloc) {
+               case COUNTER_ALLOC_PER_CPU:
                {
                        do {
                                move_sum = 0;
@@ -113,7 +113,7 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                        } while (old != res);
                        break;
                }
-               case COUNTER_SYNC_GLOBAL:
+               case COUNTER_ALLOC_GLOBAL:
                {
                        do {
                                old = res;
@@ -138,8 +138,8 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                int32_t global_sum_step = counter->global_sum_step.s32;
 
                res = *int_p;
-               switch (sync) {
-               case COUNTER_SYNC_PER_CPU:
+               switch (alloc) {
+               case COUNTER_ALLOC_PER_CPU:
                {
                        do {
                                move_sum = 0;
@@ -154,7 +154,7 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                        } while (old != res);
                        break;
                }
-               case COUNTER_SYNC_GLOBAL:
+               case COUNTER_ALLOC_GLOBAL:
                {
                        do {
                                old = res;
@@ -180,8 +180,8 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                int64_t global_sum_step = counter->global_sum_step.s64;
 
                res = *int_p;
-               switch (sync) {
-               case COUNTER_SYNC_PER_CPU:
+               switch (alloc) {
+               case COUNTER_ALLOC_PER_CPU:
                {
                        do {
                                move_sum = 0;
@@ -196,7 +196,7 @@ static __always_inline int __lttng_counter_add(const struct lib_counter_config *
                        } while (old != res);
                        break;
                }
-               case COUNTER_SYNC_GLOBAL:
+               case COUNTER_ALLOC_GLOBAL:
                {
                        do {
                                old = res;
This page took 0.027896 seconds and 4 git commands to generate.