2 * Copyright (C) 2020 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_KERNEL_PROBE_H
9 #define LTTNG_KERNEL_PROBE_H
11 #include <lttng/lttng-export.h>
18 struct lttng_kernel_probe_location
;
20 enum lttng_kernel_probe_location_status
{
21 LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK
= 0,
22 /* Invalid parameters provided. */
23 LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID
= -1,
26 enum lttng_kernel_probe_location_type
{
27 LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN
= -1,
28 /* Location derived from a symbol and an offset. */
29 LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET
= 0,
30 /* Location derived from an address. */
31 LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS
= 1,
35 * Get the type of the kernel probe location.
37 LTTNG_EXPORT
extern enum lttng_kernel_probe_location_type
38 lttng_kernel_probe_location_get_type(
39 const struct lttng_kernel_probe_location
*location
);
42 * Destroy the kernel probe location.
44 LTTNG_EXPORT
extern void lttng_kernel_probe_location_destroy(
45 struct lttng_kernel_probe_location
*location
);
48 * Create a symbol derived probe location.
49 * On failure, NULL is returned.
51 LTTNG_EXPORT
extern struct lttng_kernel_probe_location
*
52 lttng_kernel_probe_location_symbol_create(const char *symbol_name
,
56 * Get the symbol name of a symbol derived probe location.
58 LTTNG_EXPORT
extern const char *lttng_kernel_probe_location_symbol_get_name(
59 const struct lttng_kernel_probe_location
*location
);
62 * Get the offset of a symbol derived location.
64 LTTNG_EXPORT
extern enum lttng_kernel_probe_location_status
65 lttng_kernel_probe_location_symbol_get_offset(
66 const struct lttng_kernel_probe_location
*location
,
70 * Create an address derived probe location.
71 * On failure, NULL is returned.
73 LTTNG_EXPORT
extern struct lttng_kernel_probe_location
*
74 lttng_kernel_probe_location_address_create(uint64_t address
);
77 * Get the address of an address derived probe location.
79 LTTNG_EXPORT
extern enum lttng_kernel_probe_location_status
80 lttng_kernel_probe_location_address_get_address(
81 const struct lttng_kernel_probe_location
*location
,
88 #endif /* LTTNG_KERNEL_PROBE_H */