Commit | Line | Data |
---|---|---|
55b1df44 JR |
1 | /* |
2 | * Copyright (C) 2022 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef LTTNG_TRACE_FORMAT_DESCRIPTOR_H | |
9 | #define LTTNG_TRACE_FORMAT_DESCRIPTOR_H | |
10 | ||
11 | #include <inttypes.h> | |
026a8516 JR |
12 | #include <lttng/domain.h> |
13 | #include <lttng/lttng-error.h> | |
55b1df44 JR |
14 | #include <lttng/lttng-export.h> |
15 | ||
16 | #ifdef __cplusplus | |
17 | extern "C" { | |
18 | #endif | |
19 | ||
20 | struct lttng_trace_format_descriptor; | |
026a8516 | 21 | enum lttng_domain_type; |
55b1df44 JR |
22 | |
23 | enum lttng_trace_format_descriptor_status { | |
24 | LTTNG_TRACE_FORMAT_DESCRIPTOR_STATUS_INVALID = -1, | |
25 | LTTNG_TRACE_FORMAT_DESCRIPTOR_STATUS_OK = 0, | |
26 | }; | |
27 | ||
28 | enum lttng_trace_format_descriptor_type { | |
29 | LTTNG_TRACE_FORMAT_DESCRIPTOR_TYPE_UNKNOWN = -1, | |
30 | LTTNG_TRACE_FORMAT_DESCRIPTOR_TYPE_CTF_1 = 0, | |
31 | LTTNG_TRACE_FORMAT_DESCRIPTOR_TYPE_CTF_2 = 1, | |
32 | }; | |
33 | ||
34 | LTTNG_EXPORT extern enum lttng_trace_format_descriptor_type lttng_trace_format_get_type( | |
35 | const struct lttng_trace_format_descriptor *descriptor); | |
36 | ||
37 | LTTNG_EXPORT extern struct lttng_trace_format_descriptor * | |
38 | lttng_trace_format_ctf_1_descriptor_create(void); | |
39 | ||
40 | LTTNG_EXPORT extern enum lttng_trace_format_descriptor_status lttng_trace_format_ctf_1_get_version( | |
41 | const struct lttng_trace_format_descriptor *descriptor, | |
42 | uint64_t *major, | |
43 | uint64_t *minor); | |
44 | ||
45 | LTTNG_EXPORT extern struct lttng_trace_format_descriptor * | |
46 | lttng_trace_format_ctf_2_descriptor_create(void); | |
47 | ||
48 | LTTNG_EXPORT extern enum lttng_trace_format_descriptor_status lttng_trace_format_ctf_2_get_version( | |
49 | const struct lttng_trace_format_descriptor *descriptor, | |
50 | uint64_t *major, | |
51 | uint64_t *minor); | |
52 | ||
53 | LTTNG_EXPORT void lttng_trace_format_descriptor_destroy( | |
54 | struct lttng_trace_format_descriptor *descriptor); | |
026a8516 JR |
55 | /* |
56 | * Check if the passed trace format is supported for the passed domain. | |
57 | */ | |
58 | LTTNG_EXPORT extern enum lttng_error_code lttng_domain_supports_trace_format( | |
59 | const struct lttng_endpoint *session_daemon_endpoint, | |
60 | enum lttng_domain_type domain_type, | |
61 | const struct lttng_trace_format_descriptor *trace_format_descriptor); | |
62 | ||
63 | /* | |
64 | * For network destinations targeting a relay daemon, the session daemon will | |
65 | * establish a connection to check for the capability at the time of the call. | |
66 | * Note that the relay daemon at the destination address may be replaced by | |
67 | * the time tracing starts. | |
68 | * | |
69 | * When destination url is a network destination (relayd), the following | |
70 | * URL format is expected: | |
71 | * NETPROTO://(HOST | IPADDR)[:CTRLPORT[:DATAPORT]][/TRACEPATH] | |
72 | * | |
73 | * Always returns LTTNG_OK for local destinations. | |
74 | */ | |
75 | LTTNG_EXPORT extern enum lttng_error_code lttng_destination_supports_trace_format( | |
76 | const struct lttng_endpoint *session_daemon_endpoint, | |
77 | const char *destination_url, | |
78 | const struct lttng_trace_format_descriptor *trace_format_descriptor); | |
55b1df44 JR |
79 | |
80 | #ifdef __cplusplus | |
81 | } | |
82 | #endif | |
83 | ||
84 | #endif /* LTTNG_TRACE_FORMAT_DESCRIPTOR_H */ |