Commit | Line | Data |
---|---|---|
f20baf8e | 1 | /* |
ab5be9fa MJ |
2 | * Copyright (C) 2013 David Goulet <dgoulet@efficios.com> |
3 | * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
f20baf8e | 4 | * |
ab5be9fa | 5 | * SPDX-License-Identifier: GPL-2.0-only |
f20baf8e | 6 | * |
f20baf8e DG |
7 | */ |
8 | ||
022d91ba DG |
9 | #ifndef AGENT_COMM |
10 | #define AGENT_COMM | |
f20baf8e | 11 | |
40ebe219 | 12 | #include <common/compiler.hpp> |
c9e313bc | 13 | #include <common/macros.hpp> |
28f23191 | 14 | |
f20baf8e DG |
15 | #include <lttng/lttng.h> |
16 | ||
28f23191 JG |
17 | #include <stdint.h> |
18 | ||
f20baf8e | 19 | /* |
2f2540d7 | 20 | * Command value passed in the header. |
f20baf8e | 21 | */ |
022d91ba | 22 | enum lttcomm_agent_command { |
28f23191 JG |
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, | |
f20baf8e DG |
29 | }; |
30 | ||
31 | /* | |
56cc432e | 32 | * Return codes from the agent. |
f20baf8e | 33 | */ |
022d91ba | 34 | enum lttcomm_agent_ret_code { |
aa277e3e | 35 | /* Success, assumed to be the first entry */ |
28f23191 | 36 | AGENT_RET_CODE_SUCCESS = 1, |
aa277e3e | 37 | /* Invalid command */ |
28f23191 | 38 | AGENT_RET_CODE_INVALID = 2, |
aa277e3e | 39 | /* Unknown logger name */ |
28f23191 | 40 | AGENT_RET_CODE_UNKNOWN_NAME = 3, |
23c2bd47 | 41 | AGENT_RET_CODE_NR, |
f20baf8e DG |
42 | }; |
43 | ||
44 | /* | |
022d91ba | 45 | * Agent application communication header. |
f20baf8e | 46 | */ |
022d91ba | 47 | struct lttcomm_agent_hdr { |
28f23191 JG |
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 */ | |
f20baf8e DG |
51 | } LTTNG_PACKED; |
52 | ||
53 | /* | |
a0ba721c AM |
54 | * Enable event command payload. Will be immediately followed by the |
55 | * variable-length string representing the filter expression. | |
f20baf8e | 56 | */ |
bdf64013 | 57 | struct lttcomm_agent_enable_event { |
2106efa0 | 58 | uint32_t loglevel_value; |
b2064f54 | 59 | uint32_t loglevel_type; |
f20baf8e | 60 | char name[LTTNG_SYMBOL_NAME_LEN]; |
a0ba721c | 61 | uint32_t filter_expression_length; |
f20baf8e DG |
62 | } LTTNG_PACKED; |
63 | ||
64 | /* | |
65 | * Disable event command payload. | |
66 | */ | |
bdf64013 | 67 | struct lttcomm_agent_disable_event { |
f20baf8e DG |
68 | char name[LTTNG_SYMBOL_NAME_LEN]; |
69 | } LTTNG_PACKED; | |
70 | ||
71 | /* | |
56cc432e | 72 | * Generic reply coming from the agent. |
f20baf8e | 73 | */ |
022d91ba | 74 | struct lttcomm_agent_generic_reply { |
f20baf8e DG |
75 | uint32_t ret_code; |
76 | } LTTNG_PACKED; | |
77 | ||
78 | /* | |
79 | * List command reply header. | |
80 | */ | |
022d91ba | 81 | struct lttcomm_agent_list_reply_hdr { |
f20baf8e DG |
82 | uint32_t ret_code; |
83 | uint32_t data_size; | |
84 | } LTTNG_PACKED; | |
85 | ||
86 | /* | |
56cc432e | 87 | * List command reply payload coming from the agent. |
f20baf8e | 88 | */ |
022d91ba | 89 | struct lttcomm_agent_list_reply { |
f20baf8e DG |
90 | uint32_t nb_event; |
91 | /* List of event name each of them ending by a NULL byte. */ | |
40ebe219 | 92 | char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; |
f20baf8e DG |
93 | } LTTNG_PACKED; |
94 | ||
28f23191 | 95 | #endif /* AGENT_COMM */ |