2 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #ifndef _EVENT_NOTIFIER_ERROR_ACCOUNTING_H
9 #define _EVENT_NOTIFIER_ERROR_ACCOUNTING_H
13 #include <lttng/trigger/trigger.h>
17 enum event_notifier_error_accounting_status
{
18 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK
,
19 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_ERR
,
20 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_NOT_FOUND
,
21 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_NOMEM
,
22 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_NO_INDEX_AVAILABLE
,
23 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_APP_DEAD
,
26 enum event_notifier_error_accounting_status
27 event_notifier_error_accounting_init(uint64_t nb_bucket
);
29 enum event_notifier_error_accounting_status
30 event_notifier_error_accounting_register_kernel(
31 int kernel_event_notifier_group_fd
);
33 #ifdef HAVE_LIBLTTNG_UST_CTL
34 enum event_notifier_error_accounting_status
35 event_notifier_error_accounting_register_app(struct ust_app
*app
);
37 enum event_notifier_error_accounting_status
38 event_notifier_error_accounting_unregister_app(struct ust_app
*app
);
39 #else /* HAVE_LIBLTTNG_UST_CTL */
41 enum event_notifier_error_accounting_status
42 event_notifier_error_accounting_register_app(struct ust_app
*app
)
44 return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK
;
48 enum event_notifier_error_accounting_status
49 event_notifier_error_accounting_unregister_app(struct ust_app
*app
)
51 return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK
;
53 #endif /* HAVE_LIBLTTNG_UST_CTL */
55 enum event_notifier_error_accounting_status
56 event_notifier_error_accounting_register_event_notifier(
57 const struct lttng_trigger
*trigger
,
58 uint64_t *error_counter_index
);
60 enum event_notifier_error_accounting_status
61 event_notifier_error_accounting_get_count(
62 const struct lttng_trigger
*trigger
,
65 void event_notifier_error_accounting_unregister_event_notifier(
66 const struct lttng_trigger
*trigger
);
68 void event_notifier_error_accounting_fini(void);
70 #endif /* _EVENT_NOTIFIER_ERROR_ACCOUNTING_H */