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_HANDLE_H | |
9 | #define LTTNG_HANDLE_H | |
10 | ||
11 | #include <lttng/domain.h> | |
4bd69c5f | 12 | #include <lttng/lttng-export.h> |
1239a312 DG |
13 | |
14 | #ifdef __cplusplus | |
15 | extern "C" { | |
16 | #endif | |
17 | ||
048f01ef PP |
18 | /*! |
19 | @addtogroup api_session | |
20 | @{ | |
21 | */ | |
22 | ||
1239a312 DG |
23 | /* |
24 | * Handle used as a context for commands. | |
25 | * | |
26 | * The structures should be initialized to zero before use. | |
27 | */ | |
28f23191 | 28 | #define LTTNG_HANDLE_PADDING1 16 |
048f01ef PP |
29 | |
30 | /*! | |
31 | @brief | |
32 | Recording session handle. | |
33 | ||
34 | Such a structure is a pair of a \ref api_session "recording session" | |
35 | name and a \ref api-channel-domain "tracing domain" summary. | |
36 | ||
37 | Some functions which accept a recording session handle parameter ignore | |
38 | the recording session name or the tracing domain summary. | |
39 | ||
40 | Create a recording session handle with lttng_create_handle(). | |
41 | ||
42 | Destroy a recording session handle with lttng_destroy_handle(). | |
43 | */ | |
1239a312 | 44 | struct lttng_handle { |
048f01ef | 45 | /// \ref api_session "Recording session" name. |
36d2e35d | 46 | char session_name[LTTNG_NAME_MAX]; |
048f01ef PP |
47 | |
48 | /// \ref api-channel-domain "Tracing domain" summary. | |
1239a312 DG |
49 | struct lttng_domain domain; |
50 | ||
51 | char padding[LTTNG_HANDLE_PADDING1]; | |
52 | }; | |
53 | ||
048f01ef PP |
54 | /*! |
55 | @brief | |
56 | Creates and returns a recording session handle from the | |
57 | \ref api_session "recording session" name | |
58 | \lt_p{session_name} and the optional | |
59 | \ref api-channel-domain "tracing domain" summary \lt_p{domain}. | |
60 | ||
61 | @param[in] session_name | |
62 | @parblock | |
63 | Recording session name part of the recording session handle to | |
64 | create. | |
65 | ||
66 | May be \c NULL. | |
67 | @endparblock | |
68 | @param[in] domain | |
69 | @parblock | |
70 | Tracing domain summary part of the recording session handle to | |
71 | create. | |
72 | ||
73 | May be \c NULL. | |
74 | @endparblock | |
75 | ||
76 | @returns | |
77 | @parblock | |
78 | New recording session handle. | |
79 | ||
80 | Destroy the returned handle with lttng_destroy_handle(). | |
81 | @endparblock | |
82 | ||
83 | @sa lttng_destroy_handle() -- | |
84 | Destroys a recording session handle. | |
85 | */ | |
4bd69c5f | 86 | LTTNG_EXPORT extern struct lttng_handle *lttng_create_handle(const char *session_name, |
28f23191 | 87 | struct lttng_domain *domain); |
1239a312 | 88 | |
048f01ef PP |
89 | /*! |
90 | @brief | |
91 | Destroys the recording session handle \lt_p{handle}. | |
92 | ||
93 | @note | |
94 | @parblock | |
95 | This function doesn't destroy the recording session named | |
96 | \lt_p{handle->session_name}, but only the handle itself. | |
97 | ||
98 | Use lttng_destroy_session_ext() to destroy a recording session. | |
99 | @endparblock | |
100 | ||
101 | @param[in] handle | |
102 | @parblock | |
103 | Recording session handle to destroy. | |
104 | ||
105 | May be \c NULL. | |
106 | @endparblock | |
107 | */ | |
4bd69c5f | 108 | LTTNG_EXPORT extern void lttng_destroy_handle(struct lttng_handle *handle); |
1239a312 | 109 | |
048f01ef PP |
110 | /// @} |
111 | ||
1239a312 DG |
112 | #ifdef __cplusplus |
113 | } | |
114 | #endif | |
115 | ||
116 | #endif /* LTTNG_HANDLE_H */ |