Skip to content

Commit

Permalink
perf build: Fix btf__load_from_kernel_by_id() feature check
Browse files Browse the repository at this point in the history
[ Upstream commit 7353461 ]

The btf__load_from_kernel_by_id() only takes one arg, not two.

Committer notes:

I tested it just with an older libbpf, one where
btf__load_from_kernel_by_id() wasn't introduced yet.

A test with a newer dynamic libbpf would fail because the
btf__load_from_kernel_by_id() is there, but takes just one arg.

Fixes: 0ae065a ("perf build: Fix check for btf__load_from_kernel_by_id() in libbpf")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: http://lore.kernel.org/linux-perf-users/YozLKby7ITEtchC9@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
olsajiri authored and gregkh committed Jun 9, 2022
1 parent e3264ae commit 4a2ea97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/build/feature/test-libbpf-btf__load_from_kernel_by_id.c
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
#include <bpf/libbpf.h>
#include <bpf/btf.h>

int main(void)
{
return btf__load_from_kernel_by_id(20151128, NULL);
btf__load_from_kernel_by_id(20151128);
return 0;
}

0 comments on commit 4a2ea97

Please sign in to comment.