summaryrefslogtreecommitdiff
path: root/tools/perf/tests/llvm.c
diff options
context:
space:
mode:
authorJoe Stringer <joe@ovn.org>2017-01-23 04:11:25 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-01-26 17:42:58 +0300
commite28ff1a8382ee02b10cf11cf3b48541dc3d14a58 (patch)
tree7b2e4fbf719f7c62f506e2d19f5aca86597d0337 /tools/perf/tests/llvm.c
parent7803ba73099867d1f6ca866857277d92e0da4080 (diff)
downloadlinux-e28ff1a8382ee02b10cf11cf3b48541dc3d14a58.tar.xz
tools lib bpf: Add libbpf_get_error()
This function will turn a libbpf pointer into a standard error code (or 0 if the pointer is valid). This also allows removal of the dependency on linux/err.h in the public header file, which causes problems in userspace programs built against libbpf. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: netdev@vger.kernel.org Link: http://lkml.kernel.org/r/20170123011128.26534-5-joe@ovn.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/llvm.c')
-rw-r--r--tools/perf/tests/llvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c
index 02a33ebcd992..d357dab72e68 100644
--- a/tools/perf/tests/llvm.c
+++ b/tools/perf/tests/llvm.c
@@ -13,7 +13,7 @@ static int test__bpf_parsing(void *obj_buf, size_t obj_buf_sz)
struct bpf_object *obj;
obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, NULL);
- if (IS_ERR(obj))
+ if (libbpf_get_error(obj))
return TEST_FAIL;
bpf_object__close(obj);
return TEST_OK;