.has_overflow = false,
};
+ if (!ust_app_supports_counters(app)) {
+ DBG("Refusing to create accounting entry for application (unsupported feature): app name = '%s', app ppid = %d",
+ app->name, (int) app->ppid);
+ goto error;
+ }
+
entry = zmalloc(sizeof(struct ust_error_accounting_entry));
if (!entry) {
PERROR("Failed to allocate event notifier error acounting entry")
enum event_notifier_error_accounting_status status;
struct lttng_ust_abi_object_data **cpu_counters;
+ if (!ust_app_supports_counters(app)) {
+ status = EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_UNSUPPORTED;
+ goto end;
+ }
+
/*
* Check if we already have a error counter for the user id of this
* app. If not, create one.
app->event_notifier_group.nr_counter_cpu = entry->nr_counter_cpu_fds;
app->event_notifier_group.counter_cpu = cpu_counters;
cpu_counters = NULL;
- goto end;
+ goto end_unlock;
error_send_cpu_counter_data:
error_duplicate_cpu_counter:
ust_error_accounting_entry_put(entry);
error_creating_entry:
app->event_notifier_group.counter = NULL;
-end:
+end_unlock:
rcu_read_unlock();
+end:
return status;
}
int ret;
uint64_t error_counter_index;
enum event_notifier_error_accounting_status status;
- struct lttng_kernel_counter_clear counter_clear = {};
+ struct lttng_kernel_abi_counter_clear counter_clear = {};
status = get_error_counter_index_for_token(&kernel_state,
lttng_trigger_get_tracer_token(trigger),
{
int error_counter_fd = -1, ret;
enum event_notifier_error_accounting_status status;
- const struct lttng_kernel_counter_conf error_counter_conf = {
- .arithmetic = LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR,
+ const struct lttng_kernel_abi_counter_conf error_counter_conf = {
+ .arithmetic = LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR,
.bitness = sizeof(void *) == sizeof(uint32_t) ?
- LTTNG_KERNEL_COUNTER_BITNESS_32 :
- LTTNG_KERNEL_COUNTER_BITNESS_64,
+ LTTNG_KERNEL_ABI_COUNTER_BITNESS_32 :
+ LTTNG_KERNEL_ABI_COUNTER_BITNESS_64,
.global_sum_step = 0,
.number_dimensions = 1,
.dimensions[0].size = kernel_state.number_indices,
state = &kernel_state;
break;
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
state = &ust_state;
break;
default:
#ifdef HAVE_LIBLTTNG_UST_CTL
switch (lttng_trigger_get_underlying_domain_type_restriction(trigger)) {
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
pthread_mutex_lock(&the_event_notifier_counter.lock);
the_event_notifier_counter.count++;
if (the_event_notifier_counter.count == 1) {
event_notifier_error_accounting_kernel_get_count(
const struct lttng_trigger *trigger, uint64_t *count)
{
- struct lttng_kernel_counter_aggregate counter_aggregate = {};
+ struct lttng_kernel_abi_counter_aggregate counter_aggregate = {};
enum event_notifier_error_accounting_status status;
uint64_t error_counter_index;
int ret;
return event_notifier_error_accounting_kernel_get_count(
trigger, count);
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_get_count(trigger,
count);
case LTTNG_DOMAIN_KERNEL:
return event_notifier_error_accounting_kernel_clear(trigger);
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_clear(trigger);
#else
break;
#ifdef HAVE_LIBLTTNG_UST_CTL
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
state = &ust_state;
pthread_mutex_lock(&the_event_notifier_counter.lock);