summaryrefslogtreecommitdiff
blob: 831de6487a844870d09e7ab72a78e8bc8861dce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/src/btf.h b/src/btf.h
index 61579a3..4e9f9fc 100644
--- a/src/btf.h
+++ b/src/btf.h
@@ -2,6 +2,7 @@
 
 #include "types.h"
 #include <linux/types.h>
+#include <linux/version.h>
 #include <map>
 #include <regex>
 #include <string>
@@ -11,6 +12,15 @@
 struct btf;
 struct btf_type;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+/* this is required to build with 5.4 and earlier kernel headers */
+enum btf_func_linkage {
+    BTF_FUNC_STATIC = 0,
+    BTF_FUNC_GLOBAL = 1,
+    BTF_FUNC_EXTERN = 2,
+};
+#endif
+
 namespace bpftrace {
 
 class BTF