aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/pyperf.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2019-07-02 20:26:51 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2019-07-03 15:06:33 +0200
commitd2f5bbbc350050895d9f33c2744a61f9e0af1caa (patch)
tree16c2e73e7fccf67fdb0802634eaff677bf4c1055 /tools/testing/selftests/bpf/progs/pyperf.h
parent71634d7f92093062e7b8b2a9efffa5569edcca8b (diff)
downloadkernel_replicant_linux-d2f5bbbc350050895d9f33c2744a61f9e0af1caa.tar.gz
kernel_replicant_linux-d2f5bbbc350050895d9f33c2744a61f9e0af1caa.tar.bz2
kernel_replicant_linux-d2f5bbbc350050895d9f33c2744a61f9e0af1caa.zip
selftests: bpf: standardize to static __always_inline
The progs for bpf selftests use several different notations to force function inlining. Standardize to what most of them use, static __always_inline. Suggested-by: Song Liu <liu.song.a23@gmail.com> Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/pyperf.h')
-rw-r--r--tools/testing/selftests/bpf/progs/pyperf.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/progs/pyperf.h b/tools/testing/selftests/bpf/progs/pyperf.h
index 6b0781391be5..abf6224649be 100644
--- a/tools/testing/selftests/bpf/progs/pyperf.h
+++ b/tools/testing/selftests/bpf/progs/pyperf.h
@@ -75,8 +75,7 @@ typedef struct {
void* co_name; // PyCodeObject.co_name
} FrameData;
-static inline __attribute__((__always_inline__)) void*
-get_thread_state(void* tls_base, PidData* pidData)
+static __always_inline void *get_thread_state(void *tls_base, PidData *pidData)
{
void* thread_state;
int key;
@@ -87,8 +86,8 @@ get_thread_state(void* tls_base, PidData* pidData)
return thread_state;
}
-static inline __attribute__((__always_inline__)) bool
-get_frame_data(void* frame_ptr, PidData* pidData, FrameData* frame, Symbol* symbol)
+static __always_inline bool get_frame_data(void *frame_ptr, PidData *pidData,
+ FrameData *frame, Symbol *symbol)
{
// read data from PyFrameObject
bpf_probe_read(&frame->f_back,
@@ -161,7 +160,7 @@ struct bpf_elf_map SEC("maps") stackmap = {
.max_elem = 1000,
};
-static inline __attribute__((__always_inline__)) int __on_event(struct pt_regs *ctx)
+static __always_inline int __on_event(struct pt_regs *ctx)
{
uint64_t pid_tgid = bpf_get_current_pid_tgid();
pid_t pid = (pid_t)(pid_tgid >> 32);