sessiond: Implement UST event notifier error counter
[lttng-tools.git] / src / bin / lttng-sessiond / event-notifier-error-accounting.h
CommitLineData
90aa04a1
FD
1/*
2 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef _EVENT_NOTIFIER_ERROR_ACCOUNTING_H
9#define _EVENT_NOTIFIER_ERROR_ACCOUNTING_H
10
11#include <stdint.h>
533a90fb 12
90aa04a1
FD
13#include <lttng/trigger/trigger.h>
14
533a90fb
FD
15#include "ust-app.h"
16
90aa04a1
FD
17enum 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,
533a90fb 23 EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_APP_DEAD,
90aa04a1
FD
24};
25
26enum event_notifier_error_accounting_status
27event_notifier_error_accounting_init(uint64_t nb_bucket);
28
29enum event_notifier_error_accounting_status
30event_notifier_error_accounting_register_kernel(
31 int kernel_event_notifier_group_fd);
32
533a90fb
FD
33#ifdef HAVE_LIBLTTNG_UST_CTL
34enum event_notifier_error_accounting_status
35event_notifier_error_accounting_register_app(struct ust_app *app);
36
37enum event_notifier_error_accounting_status
38event_notifier_error_accounting_unregister_app(struct ust_app *app);
39#else /* HAVE_LIBLTTNG_UST_CTL */
40static inline
41enum event_notifier_error_accounting_status
42event_notifier_error_accounting_register_app(struct ust_app *app)
43{
44 return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
45}
46
47static inline
48enum event_notifier_error_accounting_status
49event_notifier_error_accounting_unregister_app(struct ust_app *app)
50{
51 return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
52}
53#endif /* HAVE_LIBLTTNG_UST_CTL */
54
90aa04a1
FD
55enum event_notifier_error_accounting_status
56event_notifier_error_accounting_register_event_notifier(
57 const struct lttng_trigger *trigger,
58 uint64_t *error_counter_index);
59
60enum event_notifier_error_accounting_status
61event_notifier_error_accounting_get_count(
62 const struct lttng_trigger *trigger,
63 uint64_t *count);
64
65void event_notifier_error_accounting_unregister_event_notifier(
66 const struct lttng_trigger *trigger);
67
68void event_notifier_error_accounting_fini(void);
69
70#endif /* _EVENT_NOTIFIER_ERROR_ACCOUNTING_H */
This page took 0.025078 seconds and 4 git commands to generate.