2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_TRIGGER_INTERNAL_H
9 #define LTTNG_TRIGGER_INTERNAL_H
11 #include <lttng/trigger/trigger.h>
12 #include <common/credentials.h>
13 #include <common/macros.h>
14 #include <common/optional.h>
17 #include <sys/types.h>
21 struct lttng_payload_view
;
23 struct lttng_trigger
{
24 /* Reference counting is only exposed to internal users. */
27 struct lttng_condition
*condition
;
28 struct lttng_action
*action
;
30 /* For now only the uid portion of the credentials is used. */
31 struct lttng_credentials creds
;
34 * The unique token passed to the tracer to identify an event-rule
37 LTTNG_OPTIONAL(uint64_t) tracer_token
;
40 struct lttng_trigger_comm
{
42 * Credentials, only the uid portion is used for now.
43 * Used as an override when desired by the root user.
47 * Length of the variable length payload (name, condition, and
51 /* Includes '\0' terminator. */
53 /* A null-terminated name, a condition, and an action follow. */
58 ssize_t
lttng_trigger_create_from_payload(struct lttng_payload_view
*view
,
59 struct lttng_trigger
**trigger
);
62 int lttng_trigger_serialize(struct lttng_trigger
*trigger
,
63 struct lttng_payload
*payload
);
66 const struct lttng_condition
*lttng_trigger_get_const_condition(
67 const struct lttng_trigger
*trigger
);
70 const struct lttng_action
*lttng_trigger_get_const_action(
71 const struct lttng_trigger
*trigger
);
74 bool lttng_trigger_validate(struct lttng_trigger
*trigger
);
77 int lttng_trigger_assign_name(
78 struct lttng_trigger
*dst
, const struct lttng_trigger
*src
);
81 void lttng_trigger_set_tracer_token(
82 struct lttng_trigger
*trigger
, uint64_t token
);
85 uint64_t lttng_trigger_get_tracer_token(const struct lttng_trigger
*trigger
);
88 int lttng_trigger_generate_name(struct lttng_trigger
*trigger
,
92 bool lttng_trigger_is_equal(
93 const struct lttng_trigger
*a
, const struct lttng_trigger
*b
);
96 void lttng_trigger_get(struct lttng_trigger
*trigger
);
99 void lttng_trigger_put(struct lttng_trigger
*trigger
);
102 const struct lttng_credentials
*lttng_trigger_get_credentials(
103 const struct lttng_trigger
*trigger
);
106 void lttng_trigger_set_credentials(struct lttng_trigger
*trigger
,
107 const struct lttng_credentials
*creds
);
109 #endif /* LTTNG_TRIGGER_INTERNAL_H */
This page took 0.030614 seconds and 4 git commands to generate.