Build fix: POD static_assert check fails on lttng_event_exclusions
[lttng-tools.git] / src / common / sessiond-comm / agent.hpp
1 /*
2 * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
3 * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 */
8
9 #ifndef AGENT_COMM
10 #define AGENT_COMM
11
12 #include <stdint.h>
13
14 #include <common/compiler.hpp>
15 #include <common/macros.hpp>
16 #include <lttng/lttng.h>
17
18 /*
19 * Command value passed in the header.
20 */
21 enum lttcomm_agent_command {
22 AGENT_CMD_LIST = 1,
23 AGENT_CMD_ENABLE = 2,
24 AGENT_CMD_DISABLE = 3,
25 AGENT_CMD_REG_DONE = 4, /* End registration process. */
26 AGENT_CMD_APP_CTX_ENABLE = 5,
27 AGENT_CMD_APP_CTX_DISABLE = 6,
28 };
29
30 /*
31 * Return codes from the agent.
32 */
33 enum lttcomm_agent_ret_code {
34 /* Success, assumed to be the first entry */
35 AGENT_RET_CODE_SUCCESS = 1,
36 /* Invalid command */
37 AGENT_RET_CODE_INVALID = 2,
38 /* Unknown logger name */
39 AGENT_RET_CODE_UNKNOWN_NAME = 3,
40 AGENT_RET_CODE_NR,
41 };
42
43 /*
44 * Agent application communication header.
45 */
46 struct lttcomm_agent_hdr {
47 uint64_t data_size; /* data size following this header */
48 uint32_t cmd; /* Enum of agent command. */
49 uint32_t cmd_version; /* command version */
50 } LTTNG_PACKED;
51
52 /*
53 * Enable event command payload. Will be immediately followed by the
54 * variable-length string representing the filter expression.
55 */
56 struct lttcomm_agent_enable_event {
57 uint32_t loglevel_value;
58 uint32_t loglevel_type;
59 char name[LTTNG_SYMBOL_NAME_LEN];
60 uint32_t filter_expression_length;
61 } LTTNG_PACKED;
62
63 /*
64 * Disable event command payload.
65 */
66 struct lttcomm_agent_disable_event {
67 char name[LTTNG_SYMBOL_NAME_LEN];
68 } LTTNG_PACKED;
69
70 /*
71 * Generic reply coming from the agent.
72 */
73 struct lttcomm_agent_generic_reply {
74 uint32_t ret_code;
75 } LTTNG_PACKED;
76
77 /*
78 * List command reply header.
79 */
80 struct lttcomm_agent_list_reply_hdr {
81 uint32_t ret_code;
82 uint32_t data_size;
83 } LTTNG_PACKED;
84
85 /*
86 * List command reply payload coming from the agent.
87 */
88 struct lttcomm_agent_list_reply {
89 uint32_t nb_event;
90 /* List of event name each of them ending by a NULL byte. */
91 char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH];
92 } LTTNG_PACKED;
93
94 #endif /* AGENT_COMM */
This page took 0.031055 seconds and 4 git commands to generate.