Tests: Fix: Use '.logfile' instead of '.log' for test app output
[lttng-tools.git] / include / lttng / kernel-probe.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2020 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_KERNEL_PROBE_H
9#define LTTNG_KERNEL_PROBE_H
10
11#include <lttng/lttng-export.h>
12
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19struct lttng_kernel_probe_location;
20
21enum lttng_kernel_probe_location_status {
22 LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK = 0,
23 /* Invalid parameters provided. */
24 LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID = -1,
25};
26
27enum lttng_kernel_probe_location_type {
28 LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN = -1,
29 /* Location derived from a symbol and an offset. */
30 LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET = 0,
31 /* Location derived from an address. */
32 LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS = 1,
33};
34
35/*
36 * Get the type of the kernel probe location.
37 */
38LTTNG_EXPORT extern enum lttng_kernel_probe_location_type
39lttng_kernel_probe_location_get_type(const struct lttng_kernel_probe_location *location);
40
41/*
42 * Destroy the kernel probe location.
43 */
44LTTNG_EXPORT extern void
45lttng_kernel_probe_location_destroy(struct lttng_kernel_probe_location *location);
46
47/*
48 * Create a symbol derived probe location.
49 * On failure, NULL is returned.
50 */
51LTTNG_EXPORT extern struct lttng_kernel_probe_location *
52lttng_kernel_probe_location_symbol_create(const char *symbol_name, uint64_t offset);
53
54/*
55 * Get the symbol name of a symbol derived probe location.
56 */
57LTTNG_EXPORT extern const char *
58lttng_kernel_probe_location_symbol_get_name(const struct lttng_kernel_probe_location *location);
59
60/*
61 * Get the offset of a symbol derived location.
62 */
63LTTNG_EXPORT extern enum lttng_kernel_probe_location_status
64lttng_kernel_probe_location_symbol_get_offset(const struct lttng_kernel_probe_location *location,
65 uint64_t *offset);
66
67/*
68 * Create an address derived probe location.
69 * On failure, NULL is returned.
70 */
71LTTNG_EXPORT extern struct lttng_kernel_probe_location *
72lttng_kernel_probe_location_address_create(uint64_t address);
73
74/*
75 * Get the address of an address derived probe location.
76 */
77LTTNG_EXPORT extern enum lttng_kernel_probe_location_status
78lttng_kernel_probe_location_address_get_address(const struct lttng_kernel_probe_location *location,
79 uint64_t *offset);
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif /* LTTNG_KERNEL_PROBE_H */
This page took 0.037318 seconds and 5 git commands to generate.