Clean-up: tests: bt2 plug-ins: modernize the plug-ins
[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 <common/compiler.hpp>
13 #include <common/macros.hpp>
14
15 #include <lttng/lttng.h>
16
17 #include <stdint.h>
18
19 /*
20 * Command value passed in the header.
21 */
22 enum lttcomm_agent_command {
23 AGENT_CMD_LIST = 1,
24 AGENT_CMD_ENABLE = 2,
25 AGENT_CMD_DISABLE = 3,
26 AGENT_CMD_REG_DONE = 4, /* End registration process. */
27 AGENT_CMD_APP_CTX_ENABLE = 5,
28 AGENT_CMD_APP_CTX_DISABLE = 6,
29 };
30
31 /*
32 * Return codes from the agent.
33 */
34 enum lttcomm_agent_ret_code {
35 /* Success, assumed to be the first entry */
36 AGENT_RET_CODE_SUCCESS = 1,
37 /* Invalid command */
38 AGENT_RET_CODE_INVALID = 2,
39 /* Unknown logger name */
40 AGENT_RET_CODE_UNKNOWN_NAME = 3,
41 AGENT_RET_CODE_NR,
42 };
43
44 /*
45 * Agent application communication header.
46 */
47 struct lttcomm_agent_hdr {
48 uint64_t data_size; /* data size following this header */
49 uint32_t cmd; /* Enum of agent command. */
50 uint32_t cmd_version; /* command version */
51 } LTTNG_PACKED;
52
53 /*
54 * Enable event command payload. Will be immediately followed by the
55 * variable-length string representing the filter expression.
56 */
57 struct lttcomm_agent_enable_event {
58 uint32_t loglevel_value;
59 uint32_t loglevel_type;
60 char name[LTTNG_SYMBOL_NAME_LEN];
61 uint32_t filter_expression_length;
62 } LTTNG_PACKED;
63
64 /*
65 * Disable event command payload.
66 */
67 struct lttcomm_agent_disable_event {
68 char name[LTTNG_SYMBOL_NAME_LEN];
69 } LTTNG_PACKED;
70
71 /*
72 * Generic reply coming from the agent.
73 */
74 struct lttcomm_agent_generic_reply {
75 uint32_t ret_code;
76 } LTTNG_PACKED;
77
78 /*
79 * List command reply header.
80 */
81 struct lttcomm_agent_list_reply_hdr {
82 uint32_t ret_code;
83 uint32_t data_size;
84 } LTTNG_PACKED;
85
86 /*
87 * List command reply payload coming from the agent.
88 */
89 struct lttcomm_agent_list_reply {
90 uint32_t nb_event;
91 /* List of event name each of them ending by a NULL byte. */
92 char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH];
93 } LTTNG_PACKED;
94
95 #endif /* AGENT_COMM */
This page took 0.033665 seconds and 4 git commands to generate.