X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Flttng-event-notifier-notification.c;h=f681d9b79d24486ca03fa911967f6cc5fe7e3200;hb=a83d68311879e618ea79a0f2a9f3e53e05855c7e;hp=b67af11a77ecf0763801030346d6ceefc5f7ace1;hpb=e699ee6c837345eb408d600178cc6054ca131164;p=lttng-modules.git diff --git a/src/lttng-event-notifier-notification.c b/src/lttng-event-notifier-notification.c index b67af11a..f681d9b7 100644 --- a/src/lttng-event-notifier-notification.c +++ b/src/lttng-event-notifier-notification.c @@ -347,6 +347,27 @@ end: return ret; } +static +void record_error(struct lttng_event_notifier *event_notifier) +{ + + struct lttng_event_notifier_group *event_notifier_group = event_notifier->group; + size_t dimension_index[1]; + int ret; + + /* This group may not have an error counter attached to it. */ + if (!event_notifier_group->error_counter) + return; + + dimension_index[0] = event_notifier->error_counter_index; + + ret = event_notifier_group->error_counter->ops->counter_add( + event_notifier_group->error_counter->counter, + dimension_index, 1); + if (ret) + WARN_ON_ONCE(1); +} + static void notification_send(struct lttng_event_notifier_notification *notif, struct lttng_event_notifier *event_notifier) @@ -375,9 +396,7 @@ void notification_send(struct lttng_event_notifier_notification *notif, lttng_alignof(kernel_notif), -1); ret = event_notifier_group->ops->event_reserve(&ctx, 0); if (ret < 0) { - //TODO: error handling with counter maps - //silently drop for now. - WARN_ON_ONCE(1); + record_error(event_notifier); return; }