File: kprobes.h

package info (click to toggle)
lttng-modules 2.14.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,808 kB
  • sloc: ansic: 74,851; sh: 548; makefile: 62
file content (50 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
 *
 * src/wrapper/kprobes.h
 *
 * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
 */

#ifndef _LTTNG_WRAPPER_KPROBES_H
#define _LTTNG_WRAPPER_KPROBES_H

#include <linux/kprobes.h>
#include <lttng/kernel-version.h>

#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))

static inline
struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri)
{
	return get_kretprobe(ri);
}

#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */

static inline
struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri)
{
	return ri->rp;
}

#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */


#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \
    LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0))
static inline
unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri)
{
	return get_kretprobe_retaddr(ri);
}

#else

static inline
unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri)
{
	return (unsigned long) ri->ret_addr;
}
#endif

#endif /* _LTTNG_WRAPPER_KPROBES_H */