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
17 struct lttng_kernel_probe_location
;
19 enum lttng_kernel_probe_location_status
{
20 LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK
= 0,
21 /* Invalid parameters provided. */
22 LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID
= -1,
25 enum lttng_kernel_probe_location_type
{
26 LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN
= -1,
27 /* Location derived from a symbol and an offset. */
28 LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET
= 0,
29 /* Location derived from an address. */
30 LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS
= 1,
34 * Get the type of the kernel probe location.
36 extern enum lttng_kernel_probe_location_type
37 lttng_kernel_probe_location_get_type(
38 const struct lttng_kernel_probe_location
*location
);
41 * Destroy the kernel probe location.
43 extern void lttng_kernel_probe_location_destroy(
44 struct lttng_kernel_probe_location
*location
);
47 * Create a symbol derived probe location.
48 * On failure, NULL is returned.
50 extern struct lttng_kernel_probe_location
*
51 lttng_kernel_probe_location_symbol_create(const char *symbol_name
,
55 * Get the symbol name of a symbol derived probe location.
57 extern const char *lttng_kernel_probe_location_symbol_get_name(
58 const struct lttng_kernel_probe_location
*location
);
61 * Get the offset of a symbol derived location.
63 extern enum lttng_kernel_probe_location_status
64 lttng_kernel_probe_location_symbol_get_offset(
65 const struct lttng_kernel_probe_location
*location
,
69 * Create an address derived probe location.
70 * On failure, NULL is returned.
72 extern struct lttng_kernel_probe_location
*
73 lttng_kernel_probe_location_address_create(uint64_t address
);
76 * Get the address of an address derived probe location.
78 extern enum lttng_kernel_probe_location_status
79 lttng_kernel_probe_location_address_get_address(
80 const struct lttng_kernel_probe_location
*location
,
87 #endif /* LTTNG_KERNEL_PROBE_H */