samples/bpf: fix kprobe attachment issue on x64
authorYonghong Song <yhs@fb.com>
Mon, 30 Apr 2018 02:27:48 +0000 (19:27 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 30 Apr 2018 03:36:53 +0000 (20:36 -0700)
commit34745aed515c1d6040110ff82378056533518eb6
treebdd6bbae3a8616d5a53f4299932aceecf61f5921
parent7ef3771205302a71a8bb4a2286ef98e5cade5d1a
samples/bpf: fix kprobe attachment issue on x64

Commit d5a00528b58c ("syscalls/core, syscalls/x86: Rename
struct pt_regs-based sys_*() to __x64_sys_*()") renamed a lot
of syscall function sys_*() to __x64_sys_*().
This caused several kprobe based samples/bpf tests failing.

This patch fixed the problem in bpf_load.c.
For x86_64 architecture, function name __x64_sys_*() will be
first used for kprobe event creation. If the creation is successful,
it will be used. Otherwise, function name sys_*() will be used
for kprobe event creation.

Fixes: d5a00528b58c ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
samples/bpf/bpf_load.c