diff options
| author | Daniel Borkmann <daniel@iogearbox.net> | 2020-01-10 17:20:07 +0100 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-01-10 17:20:19 +0100 |
| commit | 7a2d070f91db83a1e08bf212e8f6a34d852efb7f (patch) | |
| tree | 29f80d80eff2526f251e5def34a8b7eb870b0504 /tools/testing/selftests/bpf/progs/pyperf.h | |
| parent | f41aa387a7896c193b384c5fb531cd2cb9e00128 (diff) | |
| parent | 360301a6c21be87fe881546bd5f22eccf7a165c5 (diff) | |
Merge branch 'bpf-global-funcs'
Alexei Starovoitov says:
====================
Introduce static vs global functions and function by function verification.
This is another step toward dynamic re-linking (or replacement) of global
functions. See patch 2 for details.
v2->v3:
- cleaned up a check spotted by Song.
- rebased and dropped patch 2 that was trying to improve BTF based on ELF.
- added one more unit test for scalar return value from global func.
v1->v2:
- addressed review comments from Song, Andrii, Yonghong
- fixed memory leak in error path
- added modified ctx check
- added more tests in patch 7
====================
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.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/pyperf.h b/tools/testing/selftests/bpf/progs/pyperf.h index 71d383cc9b85..e186899954e9 100644 --- a/tools/testing/selftests/bpf/progs/pyperf.h +++ b/tools/testing/selftests/bpf/progs/pyperf.h @@ -154,7 +154,12 @@ struct { __uint(value_size, sizeof(long long) * 127); } stackmap SEC(".maps"); -static __always_inline int __on_event(struct pt_regs *ctx) +#ifdef GLOBAL_FUNC +__attribute__((noinline)) +#else +static __always_inline +#endif +int __on_event(struct bpf_raw_tracepoint_args *ctx) { uint64_t pid_tgid = bpf_get_current_pid_tgid(); pid_t pid = (pid_t)(pid_tgid >> 32); @@ -254,7 +259,7 @@ static __always_inline int __on_event(struct pt_regs *ctx) } SEC("raw_tracepoint/kfree_skb") -int on_event(struct pt_regs* ctx) +int on_event(struct bpf_raw_tracepoint_args* ctx) { int i, ret = 0; ret |= __on_event(ctx); |
