Save/load: support session trace format
[lttng-tools.git] / include / lttng / trace-format-descriptor.h
CommitLineData
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
17extern "C" {
18#endif
19
20struct lttng_trace_format_descriptor;
026a8516 21enum lttng_domain_type;
55b1df44
JR
22
23enum lttng_trace_format_descriptor_status {
24 LTTNG_TRACE_FORMAT_DESCRIPTOR_STATUS_INVALID = -1,
25 LTTNG_TRACE_FORMAT_DESCRIPTOR_STATUS_OK = 0,
26};
27
28enum 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
34LTTNG_EXPORT extern enum lttng_trace_format_descriptor_type lttng_trace_format_get_type(
35 const struct lttng_trace_format_descriptor *descriptor);
36
37LTTNG_EXPORT extern struct lttng_trace_format_descriptor *
38lttng_trace_format_ctf_1_descriptor_create(void);
39
40LTTNG_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
45LTTNG_EXPORT extern struct lttng_trace_format_descriptor *
46lttng_trace_format_ctf_2_descriptor_create(void);
47
48LTTNG_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
53LTTNG_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 */
58LTTNG_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 */
75LTTNG_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 */
This page took 0.028763 seconds and 5 git commands to generate.