summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/profiler.inc.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2023-03-31 11:31:55 +0200
committerAlexei Starovoitov <ast@kernel.org>2023-03-31 18:40:16 +0200
commit328bafc9a373da5f268d82533dd8f2e66526d168 (patch)
treeb3cbb22676c74c48f6727d46ed1a69d5fbf6c578 /tools/testing/selftests/bpf/progs/profiler.inc.h
parentselftests/bpf: Add testcases for ptr_*_or_null_ in bpf_kptr_xchg (diff)
downloadlinux-328bafc9a373da5f268d82533dd8f2e66526d168.tar.xz
linux-328bafc9a373da5f268d82533dd8f2e66526d168.zip
selftests/bpf: Add err.h header
Moving error macros from profiler.inc.h to new err.h header. It will be used in following changes. Also adding PTR_ERR macro that will be used in following changes. Acked-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20230331093157.1749137-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/profiler.inc.h')
-rw-r--r--tools/testing/selftests/bpf/progs/profiler.inc.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/profiler.inc.h b/tools/testing/selftests/bpf/progs/profiler.inc.h
index 875513866032..f799d87e8700 100644
--- a/tools/testing/selftests/bpf/progs/profiler.inc.h
+++ b/tools/testing/selftests/bpf/progs/profiler.inc.h
@@ -6,6 +6,7 @@
#include <bpf/bpf_tracing.h>
#include "profiler.h"
+#include "err.h"
#ifndef NULL
#define NULL 0
@@ -16,7 +17,6 @@
#define O_DIRECTORY 00200000
#define __O_TMPFILE 020000000
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
-#define MAX_ERRNO 4095
#define S_IFMT 00170000
#define S_IFSOCK 0140000
#define S_IFLNK 0120000
@@ -34,7 +34,6 @@
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
-#define IS_ERR_VALUE(x) (unsigned long)(void*)(x) >= (unsigned long)-MAX_ERRNO
#define KILL_DATA_ARRAY_SIZE 8