counters: add coalesce_hits to control API and protocol
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Mar 2021 14:20:36 +0000 (09:20 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Mar 2021 14:20:36 +0000 (09:20 -0500)
This will be required by an upcoming feature in a subsequent release, so
plan ahead with a coalesce_hits field. It is currently unused by
liblttng-ust.

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

include/lttng/ust-abi.h
include/lttng/ust-ctl.h
liblttng-ust-ctl/ustctl.c

index 1c11f371f6a5ce328ebcef8ef16885e95e5b8cc3..95d289da11519b24a51b2eced795464983ad4b41 100644 (file)
@@ -85,6 +85,7 @@ struct lttng_ust_stream {
         */
 } LTTNG_PACKED;
 
+#define LTTNG_UST_COUNTER_DIMENSION_MAX 8
 
 enum lttng_ust_counter_arithmetic {
        LTTNG_UST_COUNTER_ARITHMETIC_MODULAR = 0,
@@ -104,13 +105,15 @@ struct lttng_ust_counter_dimension {
        uint8_t has_overflow;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_COUNTER_DIMENSION_MAX 8
+#define LTTNG_UST_COUNTER_CONF_PADDING1 67
 struct lttng_ust_counter_conf {
        uint32_t arithmetic;    /* enum lttng_ust_counter_arithmetic */
        uint32_t bitness;       /* enum lttng_ust_counter_bitness */
        uint32_t number_dimensions;
        int64_t global_sum_step;
        struct lttng_ust_counter_dimension dimensions[LTTNG_UST_COUNTER_DIMENSION_MAX];
+       uint8_t coalesce_hits;
+       char padding[LTTNG_UST_COUNTER_CONF_PADDING1];
 } LTTNG_PACKED;
 
 struct lttng_ust_counter_value {
index 3260400602f26018ac7a3bd24eb59aefd87ee439..6bea1160f2aad5b0a7670ce884bf14ae7da0a6f0 100644 (file)
@@ -622,7 +622,8 @@ struct ustctl_daemon_counter *
                const int *counter_cpu_fds,
                enum ustctl_counter_bitness bitness,
                enum ustctl_counter_arithmetic arithmetic,
-               uint32_t alloc_flags);
+               uint32_t alloc_flags,
+               bool coalesce_hits);
 
 int ustctl_create_counter_data(struct ustctl_daemon_counter *counter,
                struct lttng_ust_object_data **counter_data);
index 14299b23fd344613dd707d0aedd709b51cce909a..041434bda666a524814749c5ee8390474e520d89 100644 (file)
@@ -72,6 +72,7 @@ struct ustctl_counter_attr {
        uint32_t nr_dimensions;
        int64_t global_sum_step;
        struct ustctl_counter_dimension dimensions[USTCTL_COUNTER_ATTR_DIMENSION_MAX];
+       bool coalesce_hits;
 };
 
 /*
@@ -2568,7 +2569,8 @@ struct ustctl_daemon_counter *
                const int *counter_cpu_fds,
                enum ustctl_counter_bitness bitness,
                enum ustctl_counter_arithmetic arithmetic,
-               uint32_t alloc_flags)
+               uint32_t alloc_flags,
+               bool coalesce_hits)
 {
        const char *transport_name;
        struct ustctl_daemon_counter *counter;
@@ -2634,6 +2636,7 @@ struct ustctl_daemon_counter *
        counter->attr->arithmetic = arithmetic;
        counter->attr->nr_dimensions = nr_dimensions;
        counter->attr->global_sum_step = global_sum_step;
+       counter->attr->coalesce_hits = coalesce_hits;
        for (i = 0; i < nr_dimensions; i++)
                counter->attr->dimensions[i] = dimensions[i];
 
@@ -2689,6 +2692,7 @@ int ustctl_create_counter_data(struct ustctl_daemon_counter *counter,
        }
        counter_conf.number_dimensions = counter->attr->nr_dimensions;
        counter_conf.global_sum_step = counter->attr->global_sum_step;
+       counter_conf.coalesce_hits = counter->attr->coalesce_hits;
        for (i = 0; i < counter->attr->nr_dimensions; i++) {
                counter_conf.dimensions[i].size = counter->attr->dimensions[i].size;
                counter_conf.dimensions[i].underflow_index = counter->attr->dimensions[i].underflow_index;
This page took 0.027708 seconds and 4 git commands to generate.