Commit 37ccc12b authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

tools/runqslower: Add BPF_F_CURRENT_CPU for running selftest on older kernels

Libbpf compiles and runs subset of selftests on each PR in its Github mirror
repository. To allow still building up-to-date selftests against outdated
kernel images, add back BPF_F_CURRENT_CPU definitions back.

N.B. BCC's runqslower version ([0]) doesn't need BPF_F_CURRENT_CPU due to use of
locally checked in vmlinux.h, generated against kernel with 1aae4bdd ("bpf:
Switch BPF UAPI #define constants used from BPF program side to enums")
applied.

  [0] https://github.com/iovisor/bcc/pull/2809

Fixes: 367d82f1 (" tools/runqslower: Drop copy/pasted BPF_F_CURRENT_CPU definiton")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200311043010.530620-1-andriin@fb.com
parent 13fac1d8
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "runqslower.h" #include "runqslower.h"
#define TASK_RUNNING 0 #define TASK_RUNNING 0
#define BPF_F_CURRENT_CPU 0xffffffffULL
const volatile __u64 min_us = 0; const volatile __u64 min_us = 0;
const volatile pid_t targ_pid = 0; const volatile pid_t targ_pid = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment