Commit | Line | Data |
---|---|---|
1239a312 | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2014 David Goulet <dgoulet@efficios.com> |
1239a312 | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
1239a312 | 5 | * |
1239a312 DG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_DOMAIN_H | |
9 | #define LTTNG_DOMAIN_H | |
10 | ||
11 | #ifdef __cplusplus | |
12 | extern "C" { | |
13 | #endif | |
14 | ||
15 | #include <lttng/constant.h> | |
4bd69c5f | 16 | #include <lttng/lttng-export.h> |
1239a312 DG |
17 | |
18 | /* | |
19 | * Domain types: the different possible tracers. | |
20 | */ | |
21 | enum lttng_domain_type { | |
28f23191 JG |
22 | LTTNG_DOMAIN_NONE = 0, /* No associated domain. */ |
23 | LTTNG_DOMAIN_KERNEL = 1, /* Linux Kernel tracer. */ | |
24 | LTTNG_DOMAIN_UST = 2, /* Global Userspace tracer. */ | |
25 | LTTNG_DOMAIN_JUL = 3, /* Java Util Logging. */ | |
26 | LTTNG_DOMAIN_LOG4J = 4, /* Java Log4j Framework. */ | |
27 | LTTNG_DOMAIN_PYTHON = 5, /* Python logging Framework. */ | |
1239a312 DG |
28 | }; |
29 | ||
30 | /* Buffer type for a specific domain. */ | |
31 | enum lttng_buffer_type { | |
28f23191 JG |
32 | LTTNG_BUFFER_PER_PID, /* Only supported by UST being the default. */ |
33 | LTTNG_BUFFER_PER_UID, /* Only supported by UST. */ | |
34 | LTTNG_BUFFER_GLOBAL, /* Only supported by the Kernel. */ | |
1239a312 DG |
35 | }; |
36 | ||
37 | /* | |
38 | * The structures should be initialized to zero before use. | |
39 | */ | |
28f23191 JG |
40 | #define LTTNG_DOMAIN_PADDING1 12 |
41 | #define LTTNG_DOMAIN_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32 | |
1239a312 DG |
42 | struct lttng_domain { |
43 | enum lttng_domain_type type; | |
44 | enum lttng_buffer_type buf_type; | |
45 | char padding[LTTNG_DOMAIN_PADDING1]; | |
46 | ||
47 | union { | |
48 | pid_t pid; | |
36d2e35d | 49 | char exec_name[LTTNG_NAME_MAX]; |
1239a312 DG |
50 | char padding[LTTNG_DOMAIN_PADDING2]; |
51 | } attr; | |
52 | }; | |
53 | ||
54 | /* | |
55 | * List the registered domain(s) of a session. | |
56 | * | |
57 | * Session name CAN NOT be NULL. | |
58 | * | |
59 | * Return the size (number of entries) of the "lttng_domain" array. Caller | |
60 | * must free domains. On error, a negative LTTng error code is returned. | |
61 | */ | |
28f23191 | 62 | LTTNG_EXPORT extern int lttng_list_domains(const char *session_name, struct lttng_domain **domains); |
1239a312 DG |
63 | |
64 | #ifdef __cplusplus | |
65 | } | |
66 | #endif | |
67 | ||
68 | #endif /* LTTNG_DOMAIN_H */ |