summaryrefslogtreecommitdiff
path: root/samples/bpf/test_lru_dist.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/bpf/test_lru_dist.c')
-rw-r--r--samples/bpf/test_lru_dist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c
index 2859977b7f37..316230a0ed23 100644
--- a/samples/bpf/test_lru_dist.c
+++ b/samples/bpf/test_lru_dist.c
@@ -16,10 +16,13 @@
#include <sched.h>
#include <sys/wait.h>
#include <sys/stat.h>
+#include <sys/resource.h>
#include <fcntl.h>
#include <stdlib.h>
#include <time.h>
+
#include "libbpf.h"
+#include "bpf_util.h"
#define min(a, b) ((a) < (b) ? (a) : (b))
#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
@@ -510,7 +513,7 @@ int main(int argc, char **argv)
srand(time(NULL));
- nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
+ nr_cpus = bpf_num_possible_cpus();
assert(nr_cpus != -1);
printf("nr_cpus:%d\n\n", nr_cpus);