From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758080AbcHDJPQ (ORCPT ); Thu, 4 Aug 2016 05:15:16 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51656 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932152AbcHDJPM (ORCPT ); Thu, 4 Aug 2016 05:15:12 -0400 Date: Thu, 4 Aug 2016 02:15:00 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: linux-kernel@vger.kernel.org, wangnan0@huawei.com, acme@redhat.com, dsahern@gmail.com, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, adrian.hunter@intel.com, namhyung@kernel.org, jolsa@kernel.org, alexei.starovoitov@gmail.com Reply-To: adrian.hunter@intel.com, tglx@linutronix.de, mingo@kernel.org, alexei.starovoitov@gmail.com, jolsa@kernel.org, namhyung@kernel.org, dsahern@gmail.com, wangnan0@huawei.com, acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf tests bpf: Use SyS_epoll_wait alias Git-Commit-ID: c369e0a1a8fa6ca80e6c37c8735d9427b623ae62 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c369e0a1a8fa6ca80e6c37c8735d9427b623ae62 Gitweb: http://git.kernel.org/tip/c369e0a1a8fa6ca80e6c37c8735d9427b623ae62 Author: Arnaldo Carvalho de Melo AuthorDate: Tue, 2 Aug 2016 16:48:19 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 3 Aug 2016 19:40:48 -0300 perf tests bpf: Use SyS_epoll_wait alias Something made the sys_epoll_wait() function alias not to be found in the vmlinux DWARF info, being found only in /proc/kallsyms, which made the BPF perf tests to fail: [root@jouet ~]# perf test BPF 37: Test BPF filter : 37.1: Test basic BPF filtering : FAILED! 37.2: Test BPF prologue generation : Skip 37.3: Test BPF relocation checker : Skip [root@jouet ~]# Using -v we can see it is failing to find DWARF info for the probed function, sys_epoll_wait, which we can find in /proc/kallsyms but not in vmlinux with CONFIG_DEBUG_INFO: [root@jouet ~]# grep -w sys_epoll_wait /proc/kallsyms ffffffffbd295b50 T sys_epoll_wait [root@jouet ~]# [root@jouet ~]# readelf -wi /lib/modules/4.7.0+/build/vmlinux | grep -w sys_epoll_wait [root@jouet ~]# If we try to use perf probe: [root@jouet ~]# perf probe sys_epoll_wait Failed to find debug information for address ffffffffbd295b50 Probe point 'sys_epoll_wait' not found. Error: Failed to add events. [root@jouet ~]# It all works if we use SyS_epoll_wait, that is just an alias to the probed function: [root@jouet ~]# grep -i sys_epoll_wait /proc/kallsyms ffffffffbd295b50 T SyS_epoll_wait ffffffffbd295b50 T sys_epoll_wait [root@jouet ~]# So use it: [root@jouet ~]# perf test BPF 37: Test BPF filter : 37.1: Test basic BPF filtering : Ok 37.2: Test BPF prologue generation : Ok 37.3: Test BPF relocation checker : Ok [root@jouet ~]# Further info: [root@jouet ~]# gcc --version gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) [acme@jouet linux]$ cat /etc/fedora-release Fedora release 24 (Twenty Four) Investigation as to why it fails is still underway, but it was always going from sys_epoll_wait to SyS_epoll_wait when looking up the DWARF info in vmlinux, and this is what is breaking now. Switching to use SyS_epoll_wait allows this test to proceed and test the BPF code it was designed for, so lets have this in to allow passing this test while we fix the root cause. Cc: Adrian Hunter Cc: Alexei Starovoitov Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-7hekjp0bodwjbb419sl2b55h@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/bpf-script-example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/bpf-script-example.c b/tools/perf/tests/bpf-script-example.c index e53bc91..268e5f8 100644 --- a/tools/perf/tests/bpf-script-example.c +++ b/tools/perf/tests/bpf-script-example.c @@ -31,8 +31,8 @@ struct bpf_map_def SEC("maps") flip_table = { .max_entries = 1, }; -SEC("func=sys_epoll_wait") -int bpf_func__sys_epoll_wait(void *ctx) +SEC("func=SyS_epoll_wait") +int bpf_func__SyS_epoll_wait(void *ctx) { int ind =0; int *flag = bpf_map_lookup_elem(&flip_table, &ind);