|
@@ -13,6 +13,7 @@
|
|
|
#include <linux/rcupdate.h>
|
|
|
#include <linux/random.h>
|
|
|
#include <linux/smp.h>
|
|
|
+#include <linux/topology.h>
|
|
|
#include <linux/ktime.h>
|
|
|
#include <linux/sched.h>
|
|
|
#include <linux/uidgid.h>
|
|
@@ -92,6 +93,17 @@ const struct bpf_func_proto bpf_get_smp_processor_id_proto = {
|
|
|
.ret_type = RET_INTEGER,
|
|
|
};
|
|
|
|
|
|
+BPF_CALL_0(bpf_get_numa_node_id)
|
|
|
+{
|
|
|
+ return numa_node_id();
|
|
|
+}
|
|
|
+
|
|
|
+const struct bpf_func_proto bpf_get_numa_node_id_proto = {
|
|
|
+ .func = bpf_get_numa_node_id,
|
|
|
+ .gpl_only = false,
|
|
|
+ .ret_type = RET_INTEGER,
|
|
|
+};
|
|
|
+
|
|
|
BPF_CALL_0(bpf_ktime_get_ns)
|
|
|
{
|
|
|
/* NMI safe access to clock monotonic */
|