.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;
}
return ret;
}
+bool ust_app_supports_notifiers(const struct ust_app *app)
+{
+ return app->v_major >= 9;
+}
+
+bool ust_app_supports_counters(const struct ust_app *app)
+{
+ return app->v_major >= 9;
+}
+
/*
* Setup the base event notifier group.
*
assert(app);
+ if (!ust_app_supports_notifiers(app)) {
+ ret = -ENOSYS;
+ goto error;
+ }
+
/* Get the write side of the pipe. */
event_pipe_write_fd = lttng_pipe_get_writefd(
app->event_notifier_group.event_pipe);
event_notifier_error_accounting_status =
event_notifier_error_accounting_register_app(app);
- if (event_notifier_error_accounting_status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) {
- if (event_notifier_error_accounting_status == EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_APP_DEAD) {
- DBG3("Failed to setup event notifier error accounting (application is dead): app socket fd = %d",
- app->sock);
- ret = 0;
- goto error_accounting;
- }
-
+ switch (event_notifier_error_accounting_status) {
+ case EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK:
+ break;
+ case EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_UNSUPPORTED:
+ DBG3("Failed to setup event notifier error accounting (application does not support notifier error accounting): app socket fd = %d, app name = '%s', app ppid = %d",
+ app->sock, app->name, (int) app->ppid);
+ ret = 0;
+ goto error_accounting;
+ case EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_APP_DEAD:
+ DBG3("Failed to setup event notifier error accounting (application is dead): app socket fd = %d, app name = '%s', app ppid = %d",
+ app->sock, app->name, (int) app->ppid);
+ ret = 0;
+ goto error_accounting;
+ default:
ERR("Failed to setup event notifier error accounting for app");
ret = -1;
goto error_accounting;
struct ust_app_event_notifier_rule *event_notifier_rule;
unsigned int count, i;
+ if (!ust_app_supports_notifiers(app)) {
+ goto end;
+ }
+
/*
* Currrently, registering or unregistering a trigger with an
* event rule condition causes a full synchronization of the event
DBG2("UST application global event notifier rules update: app = '%s' (ppid: %d)",
app->name, app->ppid);
- if (!app->compatible) {
+ if (!app->compatible || !ust_app_supports_notifiers(app)) {
return;
}