LTTng control library C API
Loading...
Searching...
No Matches
userspace-probe.h
1/*
2 * SPDX-FileCopyrightText: 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_USERSPACE_PROBE_H
9#define LTTNG_USERSPACE_PROBE_H
10
11#include <lttng/lttng-export.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
31
55
73 const struct lttng_userspace_probe_location_lookup_method *lookup_method);
74
89
105LTTNG_EXPORT extern struct lttng_userspace_probe_location_lookup_method *
107
122LTTNG_EXPORT extern struct lttng_userspace_probe_location_lookup_method *
124
133
145
163
178LTTNG_EXPORT extern enum lttng_userspace_probe_location_type
180
192LTTNG_EXPORT extern void
194
195enum lttng_userspace_probe_location_function_instrumentation_type {
196 LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_UNKNOWN = -1,
197 /* Only instrument the function's entry. */
198 LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_ENTRY = 0,
199};
200
235LTTNG_EXPORT extern struct lttng_userspace_probe_location *
237 const char *binary_path,
238 const char *function_name,
240
265 const struct lttng_userspace_probe_location *location);
266
291 const struct lttng_userspace_probe_location *location);
292
310 const struct lttng_userspace_probe_location *location);
311
312/*
313 * Get the instrumentation type of the function probe location.
314 */
315LTTNG_EXPORT extern enum lttng_userspace_probe_location_function_instrumentation_type
316lttng_userspace_probe_location_function_get_instrumentation_type(
317 const struct lttng_userspace_probe_location *location);
318
319/*
320 * Get the instrumentation type of the function probe location.
321 * Defaults to
322 * LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_ENTRY.
323 *
324 * Returns LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK on success,
325 * LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID if invalid parameters
326 * are provided.
327 */
328LTTNG_EXPORT extern enum lttng_userspace_probe_location_status
329lttng_userspace_probe_location_function_set_instrumentation_type(
330 const struct lttng_userspace_probe_location *location,
331 enum lttng_userspace_probe_location_function_instrumentation_type instrumentation_type);
332
353LTTNG_EXPORT extern const struct lttng_userspace_probe_location_lookup_method *
355 const struct lttng_userspace_probe_location *location);
356
395LTTNG_EXPORT extern struct lttng_userspace_probe_location *
397 const char *binary_path,
398 const char *probe_name,
399 const char *provider_name,
401
426 const struct lttng_userspace_probe_location *location);
427
452 const struct lttng_userspace_probe_location *location);
453
478 const struct lttng_userspace_probe_location *location);
479
497 const struct lttng_userspace_probe_location *location);
498
500
501#ifdef __cplusplus
502}
503#endif
504
505#endif /* LTTNG_USERSPACE_PROBE_H */
int lttng_userspace_probe_location_function_get_binary_fd(const struct lttng_userspace_probe_location *location)
Returns the file descriptor of the target binary of the function Linux user space probe location loca...
struct lttng_userspace_probe_location * lttng_userspace_probe_location_function_create(const char *binary_path, const char *function_name, struct lttng_userspace_probe_location_lookup_method *lookup_method)
Creates a Linux user space probe location at the entry of the function named function_name within the...
struct lttng_userspace_probe_location * lttng_userspace_probe_location_tracepoint_create(const char *binary_path, const char *probe_name, const char *provider_name, struct lttng_userspace_probe_location_lookup_method *lookup_method)
Creates a Linux user space probe location at the USDT probe named probe_name, for the provider named ...
lttng_userspace_probe_location_type
Linux user space probe location type.
Definition userspace-probe.h:153
lttng_userspace_probe_location_lookup_method_type
Linux user space probe location lookup method type.
Definition userspace-probe.h:39
struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_lookup_method_function_elf_create(void)
Creates an Executable and Linkable Format (ELF) Linux user space probe location lookup method.
const char * lttng_userspace_probe_location_tracepoint_get_probe_name(const struct lttng_userspace_probe_location *location)
Returns the probe name of the USDT Linux user space probe location location.
void lttng_userspace_probe_location_destroy(struct lttng_userspace_probe_location *location)
Destroys the Linux user space probe location location.
void lttng_userspace_probe_location_lookup_method_destroy(struct lttng_userspace_probe_location_lookup_method *lookup_method)
Destroys the Linux user space probe location lookup method lookup_method.
lttng_userspace_probe_location_status
Return type of Linux user space probe location API functions.
Definition userspace-probe.h:138
enum lttng_userspace_probe_location_type lttng_userspace_probe_location_get_type(const struct lttng_userspace_probe_location *location)
Returns the type of the Linux user space probe location location.
const char * lttng_userspace_probe_location_function_get_function_name(const struct lttng_userspace_probe_location *location)
Returns the function name of the function Linux user space probe location location.
const char * lttng_userspace_probe_location_tracepoint_get_binary_path(const struct lttng_userspace_probe_location *location)
Returns the binary path of the USDT Linux user space probe location location.
enum lttng_userspace_probe_location_lookup_method_type lttng_userspace_probe_location_lookup_method_get_type(const struct lttng_userspace_probe_location_lookup_method *lookup_method)
Returns the type of the Linux user space probe location lookup method lookup_method.
int lttng_userspace_probe_location_tracepoint_get_binary_fd(const struct lttng_userspace_probe_location *location)
Returns the file descriptor of the target binary of the USDT Linux user space probe location location...
struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create(void)
Creates an USDT probe Linux user space probe location lookup method.
const char * lttng_userspace_probe_location_tracepoint_get_provider_name(const struct lttng_userspace_probe_location *location)
Returns the provider name of the USDT Linux user space probe location location.
const char * lttng_userspace_probe_location_function_get_binary_path(const struct lttng_userspace_probe_location *location)
Returns the binary path of the function Linux user space probe location location.
const struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_get_lookup_method(const struct lttng_userspace_probe_location *location)
Returns the lookup method of the Linux user space probe location location.
@ LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION
Function.
Definition userspace-probe.h:155
@ LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT
USDT probe.
Definition userspace-probe.h:158
@ LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN
Unknown (error).
Definition userspace-probe.h:161
@ LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT
Definition userspace-probe.h:50
@ LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_DEFAULT
Default.
Definition userspace-probe.h:41
@ LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF
Executable and Linkable Format (ELF) function.
Definition userspace-probe.h:44
@ LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_UNKNOWN
Unknown (error).
Definition userspace-probe.h:53
@ LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID
Unsatisfied precondition.
Definition userspace-probe.h:143
@ LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK
Success.
Definition userspace-probe.h:140
Lookup method of a Linux user space probe location (opaque type).
Linux user space probe location (opaque type).