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/list.h>
23#include <lttng/action/notify.h>
24#include <lttng/action/path.h>
25#include <lttng/action/rate-policy.h>
26#include <lttng/action/rotate-session.h>
27#include <lttng/action/snapshot-session.h>
28#include <lttng/action/start-session.h>
29#include <lttng/action/stop-session.h>
30#include <lttng/channel.h>
31#include <lttng/clear-handle.h>
32#include <lttng/clear.h>
33#include <lttng/condition/buffer-usage.h>
34#include <lttng/condition/condition.h>
35#include <lttng/condition/evaluation.h>
36#include <lttng/condition/event-rule-matches.h>
37#include <lttng/condition/session-consumed-size.h>
38#include <lttng/condition/session-rotation.h>
39#include <lttng/constant.h>
40#include <lttng/destruction-handle.h>
41#include <lttng/domain.h>
42#include <lttng/endpoint.h>
43#include <lttng/error-query.h>
44#include <lttng/event-expr.h>
45#include <lttng/event-field-value.h>
46#include <lttng/event-rule/event-rule.h>
47#include <lttng/event-rule/jul-logging.h>
48#include <lttng/event-rule/kernel-kprobe.h>
49#include <lttng/event-rule/kernel-syscall.h>
50#include <lttng/event-rule/kernel-tracepoint.h>
51#include <lttng/event-rule/kernel-uprobe.h>
52#include <lttng/event-rule/log4j-logging.h>
53#include <lttng/event-rule/log4j2-logging.h>
54#include <lttng/event-rule/python-logging.h>
55#include <lttng/event-rule/user-tracepoint.h>
56#include <lttng/event.h>
57#include <lttng/handle.h>
58#include <lttng/health.h>
59#include <lttng/kernel-probe.h>
60#include <lttng/kernel.h>
61#include <lttng/load.h>
62#include <lttng/location.h>
63#include <lttng/log-level-rule.h>
64#include <lttng/lttng-error.h>
65#include <lttng/notification/channel.h>
66#include <lttng/notification/notification.h>
67#include <lttng/rotation.h>
68#include <lttng/save.h>
69#include <lttng/session-descriptor.h>
70#include <lttng/session.h>
71#include <lttng/snapshot.h>
72#include <lttng/tracker.h>
73#include <lttng/trigger/trigger.h>
74#include <lttng/userspace-probe.h>
75
76#ifdef __cplusplus
77extern "C" {
78#endif
79
80enum lttng_calibrate_type {
81 LTTNG_CALIBRATE_FUNCTION = 0,
82};
83
84/* Machine interface output type */
85enum lttng_mi_output_type {
86 LTTNG_MI_XML = 1 /* XML output */
87};
88
89#define LTTNG_CALIBRATE_PADDING1 16
90struct lttng_calibrate {
91 enum lttng_calibrate_type type;
92
93 char padding[LTTNG_CALIBRATE_PADDING1];
94};
95
130LTTNG_EXPORT extern int lttng_session_daemon_alive(void);
131
161LTTNG_EXPORT extern int lttng_set_tracing_group(const char *group);
162
163/*
164 * This call registers an "outside consumer" for a session and an lttng domain.
165 * No consumer will be spawned and all fds/commands will go through the socket
166 * path given (socket_path).
167 *
168 * NOTE that this is not recommended unless you absolutely know what you are
169 * doing.
170 *
171 * Return 0 on success else a negative LTTng error code.
172 */
173LTTNG_EXPORT extern int lttng_register_consumer(struct lttng_handle *handle,
174 const char *socket_path);
175
212LTTNG_EXPORT extern int lttng_start_tracing(const char *session_name);
213
267LTTNG_EXPORT extern int lttng_stop_tracing(const char *session_name);
268
317LTTNG_EXPORT extern int lttng_stop_tracing_no_wait(const char *session_name);
318
319/*
320 * Deprecated: As of LTTng 2.9, this function always returns
321 * -LTTNG_ERR_UND.
322 */
323#pragma GCC diagnostic push
324#pragma GCC diagnostic ignored "-Wshadow"
325LTTNG_EXPORT extern int lttng_calibrate(struct lttng_handle *handle,
326 struct lttng_calibrate *calibrate);
327#pragma GCC diagnostic pop
328
329/*
330 * Set URL for a consumer for a session and domain.
331 *
332 * Both data and control URL must be defined. If both URLs are the same, only
333 * the control URL is used even for network streaming.
334 *
335 * Default port are 5342 and 5343 respectively for control and data which uses
336 * the TCP protocol.
337 *
338 * URL format: proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]
339 *
340 * Possible protocols are:
341 * > file://...
342 * Local filesystem full path.
343 *
344 * > net[6]://...
345 * This will use the default network transport layer which is TCP for both
346 * control (PORT1) and data port (PORT2).
347 *
348 * > tcp[6]://...
349 * TCP only streaming. For this one, both data and control URL must be given.
350 *
351 * Return 0 on success else a negative LTTng error code.
352 */
353LTTNG_EXPORT extern int
354lttng_set_consumer_url(struct lttng_handle *handle, const char *control_url, const char *data_url);
355
405LTTNG_EXPORT extern int lttng_data_pending(const char *session_name);
406
427LTTNG_EXPORT extern enum lttng_error_code
429
459LTTNG_DEPRECATED()
461LTTNG_EXPORT extern int lttng_metadata_regenerate(const char *session_name);
462
517LTTNG_EXPORT extern int lttng_regenerate_metadata(const char *session_name);
518
559LTTNG_EXPORT extern int lttng_regenerate_statedump(const char *session_name);
560
561#ifdef __cplusplus
562}
563#endif
564
565#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 channels wi...
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 channels.
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 channels,...
Recording session handle.
Definition handle.h:44