LTTng control library C API
Loading...
Searching...
No Matches
lttng.h
1/*
2 * lttng.h
3 *
4 * Linux Trace Toolkit Control Library Header File
5 *
6 * SPDX-FileCopyrightText: 2011 EfficiOS Inc.
7 *
8 * SPDX-License-Identifier: LGPL-2.1-only
9 *
10 */
11
12#ifndef LTTNG_H
13#define LTTNG_H
14
15#include <lttng/lttng-export.h>
16
17/* Error codes that can be returned by API calls */
18#include <lttng/lttng-error.h>
19
20/* Include every LTTng ABI/API available. */
21#include <lttng/action/action.h>
22#include <lttng/action/increment-map-value.h>
23#include <lttng/action/key-template.h>
24#include <lttng/action/list.h>
25#include <lttng/action/notify.h>
26#include <lttng/action/path.h>
27#include <lttng/action/rate-policy.h>
28#include <lttng/action/rotate-session.h>
29#include <lttng/action/snapshot-session.h>
30#include <lttng/action/start-session.h>
31#include <lttng/action/stop-session.h>
32#include <lttng/channel.h>
33#include <lttng/clear-handle.h>
34#include <lttng/clear.h>
35#include <lttng/condition/buffer-usage.h>
36#include <lttng/condition/condition.h>
37#include <lttng/condition/evaluation.h>
38#include <lttng/condition/event-rule-matches.h>
39#include <lttng/condition/session-consumed-size.h>
40#include <lttng/condition/session-rotation.h>
41#include <lttng/constant.h>
42#include <lttng/destruction-handle.h>
43#include <lttng/domain.h>
44#include <lttng/endpoint.h>
45#include <lttng/error-query.h>
46#include <lttng/event-expr.h>
47#include <lttng/event-field-value.h>
48#include <lttng/event-rule/event-rule.h>
49#include <lttng/event-rule/jul-logging.h>
50#include <lttng/event-rule/kernel-kprobe.h>
51#include <lttng/event-rule/kernel-syscall.h>
52#include <lttng/event-rule/kernel-tracepoint.h>
53#include <lttng/event-rule/kernel-uprobe.h>
54#include <lttng/event-rule/log4j-logging.h>
55#include <lttng/event-rule/log4j2-logging.h>
56#include <lttng/event-rule/python-logging.h>
57#include <lttng/event-rule/user-tracepoint.h>
58#include <lttng/event.h>
59#include <lttng/handle.h>
60#include <lttng/health.h>
61#include <lttng/kernel-probe.h>
62#include <lttng/kernel.h>
63#include <lttng/load.h>
64#include <lttng/location.h>
65#include <lttng/log-level-rule.h>
66#include <lttng/lttng-error.h>
67#include <lttng/map/channel-buffer-ownership.h>
68#include <lttng/map/channel-descriptor-kernel.h>
69#include <lttng/map/channel-descriptor-user.h>
70#include <lttng/map/channel-descriptor.h>
71#include <lttng/map/channel-set.h>
72#include <lttng/map/channel-type.h>
73#include <lttng/map/channel-update-policy.h>
74#include <lttng/map/channel-user.h>
75#include <lttng/map/channel.h>
76#include <lttng/map/group-set.h>
77#include <lttng/map/group.h>
78#include <lttng/map/key-set-string.h>
79#include <lttng/map/key-set.h>
80#include <lttng/map/key-string.h>
81#include <lttng/map/key-type.h>
82#include <lttng/map/key.h>
83#include <lttng/map/value-type.h>
84#include <lttng/map/values-set.h>
85#include <lttng/map/values-signed-int.h>
86#include <lttng/map/values.h>
87#include <lttng/notification/channel.h>
88#include <lttng/notification/notification.h>
89#include <lttng/reclaim.h>
90#include <lttng/rotation.h>
91#include <lttng/save.h>
92#include <lttng/session-descriptor.h>
93#include <lttng/session.h>
94#include <lttng/snapshot.h>
95#include <lttng/stream-info.h>
96#include <lttng/tracker.h>
97#include <lttng/trigger/trigger.h>
98#include <lttng/userspace-probe.h>
99
100#ifdef __cplusplus
101extern "C" {
102#endif
103
104enum lttng_calibrate_type {
105 LTTNG_CALIBRATE_FUNCTION = 0,
106};
107
108/* Machine interface output type */
109enum lttng_mi_output_type {
110 LTTNG_MI_XML = 1 /* XML output */
111};
112
113#define LTTNG_CALIBRATE_PADDING1 16
114struct lttng_calibrate {
115 enum lttng_calibrate_type type;
116
117 char padding[LTTNG_CALIBRATE_PADDING1];
118};
119
154LTTNG_EXPORT extern int lttng_session_daemon_alive(void);
155
185LTTNG_EXPORT extern int lttng_set_tracing_group(const char *group);
186
187/*
188 * Deprecated: this function always returns -LTTNG_ERR_NOT_SUPPORTED.
189 *
190 * This call previously registered an "outside consumer" for a session and an
191 * lttng domain. It is no longer supported.
192 */
193LTTNG_EXPORT extern int lttng_register_consumer(struct lttng_handle *handle,
194 const char *socket_path);
195
232LTTNG_EXPORT extern int lttng_start_tracing(const char *session_name);
233
287LTTNG_EXPORT extern int lttng_stop_tracing(const char *session_name);
288
337LTTNG_EXPORT extern int lttng_stop_tracing_no_wait(const char *session_name);
338
339/*
340 * Deprecated: As of LTTng 2.9, this function always returns
341 * -LTTNG_ERR_UND.
342 */
343#pragma GCC diagnostic push
344#pragma GCC diagnostic ignored "-Wshadow"
345LTTNG_EXPORT extern int lttng_calibrate(struct lttng_handle *handle,
346 struct lttng_calibrate *calibrate);
347#pragma GCC diagnostic pop
348
349/*
350 * Set URL for a consumer for a session and domain.
351 *
352 * Both data and control URL must be defined. If both URLs are the same, only
353 * the control URL is used even for network streaming.
354 *
355 * Default port are 5342 and 5343 respectively for control and data which uses
356 * the TCP protocol.
357 *
358 * URL format: proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]
359 *
360 * Possible protocols are:
361 * > file://...
362 * Local filesystem full path.
363 *
364 * > net[6]://...
365 * This will use the default network transport layer which is TCP for both
366 * control (PORT1) and data port (PORT2).
367 *
368 * > tcp[6]://...
369 * TCP only streaming. For this one, both data and control URL must be given.
370 *
371 * Return 0 on success else a negative LTTng error code.
372 */
373LTTNG_EXPORT extern int
374lttng_set_consumer_url(struct lttng_handle *handle, const char *control_url, const char *data_url);
375
425LTTNG_EXPORT extern int lttng_data_pending(const char *session_name);
426
447LTTNG_EXPORT extern enum lttng_error_code
449
479LTTNG_DEPRECATED()
481LTTNG_EXPORT extern int lttng_metadata_regenerate(const char *session_name);
482
537LTTNG_EXPORT extern int lttng_regenerate_metadata(const char *session_name);
538
579LTTNG_EXPORT extern int lttng_regenerate_statedump(const char *session_name);
580
581#ifdef __cplusplus
582}
583#endif
584
585#endif /* LTTNG_H */
int lttng_set_tracing_group(const char *group)
Sets the current Unix tracing group of liblttng-ctl to group.
lttng_error_code
General error codes.
Definition lttng-error.h:49
int lttng_session_daemon_alive(void)
Returns whether or not liblttng-ctl is able to connect to a listening session daemon.
enum lttng_error_code lttng_get_kernel_tracer_status(enum lttng_kernel_tracer_status *status)
Sets *status to the current status of the LTTng kernel tracer.
lttng_kernel_tracer_status
The status of an LTTng kernel tracer.
Definition kernel.h:28
int lttng_stop_tracing_no_wait(const char *session_name)
Makes the recording session named session_name inactive, stopping all the tracers for its event recor...
int lttng_regenerate_metadata(const char *session_name)
Regenerates the metadata streams of the recording session named session_name.
int lttng_metadata_regenerate(const char *session_name)
Regenerates the metadata streams of the recording session named session_name.
int lttng_regenerate_statedump(const char *session_name)
Regenerates the state dump event records of the recording session named session_name.
int lttng_start_tracing(const char *session_name)
Makes the recording session named session_name active, starting all the tracers for its event record ...
int lttng_data_pending(const char *session_name)
Returns whether or not you may read the traces of the recording session named session_name.
int lttng_stop_tracing(const char *session_name)
Makes the recording session named session_name inactive, stopping all the tracers for its event recor...
Recording session handle.
Definition handle.h:44