bool *overflow, bool *underflow);
int (*counter_clear)(struct lttng_kernel_channel_counter *counter,
const size_t *dimension_indexes);
+ int (*counter_get_nr_dimensions)(struct lttng_kernel_channel_counter *counter,
+ size_t *nr_dimensions);
+ int (*counter_get_max_nr_elem)(struct lttng_kernel_channel_counter *counter,
+ size_t *max_nr_elem); /* array of size nr_dimensions */
};
struct lttng_kernel_channel_counter_private {
bool *overflow, bool *underflow);
int lttng_kernel_counter_clear(struct lttng_kernel_channel_counter *counter,
const size_t *dimension_indexes);
+int lttng_kernel_counter_get_nr_dimensions(struct lttng_kernel_channel_counter *counter,
+ size_t *nr_dimensions);
+int lttng_kernel_counter_get_max_nr_elem(struct lttng_kernel_channel_counter *counter,
+ size_t *max_nr_elem);
struct lttng_event_notifier_group *lttng_event_notifier_group_create(void);
int lttng_event_notifier_group_create_error_counter(
struct file *event_notifier_group_file,
return lttng_counter_clear(&client_config, counter->priv->counter, dimension_indexes);
}
+static int counter_get_nr_dimensions(struct lttng_kernel_channel_counter *counter, size_t *nr_dimensions)
+{
+ return lttng_counter_get_nr_dimensions(&client_config, counter->priv->counter, nr_dimensions);
+}
+
+static int counter_get_max_nr_elem(struct lttng_kernel_channel_counter *counter, size_t *max_nr_elem)
+{
+ return lttng_counter_get_max_nr_elem(&client_config, counter->priv->counter, max_nr_elem);
+}
+
static struct lttng_counter_transport lttng_counter_transport = {
.name = "counter-per-cpu-32-modular",
.owner = THIS_MODULE,
.counter_read = counter_read,
.counter_aggregate = counter_aggregate,
.counter_clear = counter_clear,
+ .counter_get_nr_dimensions = counter_get_nr_dimensions,
+ .counter_get_max_nr_elem = counter_get_max_nr_elem,
}),
.event_counter_add = event_counter_add,
},
return lttng_counter_clear(&client_config, counter->priv->counter, dimension_indexes);
}
+static int counter_get_nr_dimensions(struct lttng_kernel_channel_counter *counter, size_t *nr_dimensions)
+{
+ return lttng_counter_get_nr_dimensions(&client_config, counter->priv->counter, nr_dimensions);
+}
+
+static int counter_get_max_nr_elem(struct lttng_kernel_channel_counter *counter, size_t *max_nr_elem)
+{
+ return lttng_counter_get_max_nr_elem(&client_config, counter->priv->counter, max_nr_elem);
+}
+
static struct lttng_counter_transport lttng_counter_transport = {
.name = "counter-per-cpu-64-modular",
.owner = THIS_MODULE,
.counter_read = counter_read,
.counter_aggregate = counter_aggregate,
.counter_clear = counter_clear,
+ .counter_get_nr_dimensions = counter_get_nr_dimensions,
+ .counter_get_max_nr_elem = counter_get_max_nr_elem,
}),
.event_counter_add = event_counter_add,
},
struct lttng_event_counter_enabler *event_counter_enabler =
container_of(event_enabler, struct lttng_event_counter_enabler, parent.parent);
struct lttng_kernel_channel_counter *chan = event_counter_enabler->chan;
- struct lib_counter *counter = chan->priv->counter;
size_t nr_dimensions, max_nr_elem;
- if (lttng_counter_get_nr_dimensions(&counter->config, counter, &nr_dimensions))
+ if (lttng_kernel_counter_get_nr_dimensions(chan, &nr_dimensions))
return false;
WARN_ON_ONCE(nr_dimensions != 1);
if (nr_dimensions != 1)
return false;
- if (lttng_counter_get_max_nr_elem(&counter->config, counter, &max_nr_elem))
+ if (lttng_kernel_counter_get_max_nr_elem(chan, &max_nr_elem))
return false;
switch (itype) {
case LTTNG_KERNEL_ABI_TRACEPOINT:
return counter->ops->priv->counter_clear(counter, dim_indexes);
}
+int lttng_kernel_counter_get_nr_dimensions(struct lttng_kernel_channel_counter *counter,
+ size_t *nr_dimensions)
+{
+ return counter->ops->priv->counter_get_nr_dimensions(counter, nr_dimensions);
+}
+
+int lttng_kernel_counter_get_max_nr_elem(struct lttng_kernel_channel_counter *counter,
+ size_t *max_nr_elem)
+{
+ return counter->ops->priv->counter_get_max_nr_elem(counter, max_nr_elem);
+}
+
/* Only used for tracepoints and system calls for now. */
static
void register_event(struct lttng_kernel_event_common *event)