netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next] tools/bpftool: use version from the kernel source tree
@ 2017-12-20 20:19 Roman Gushchin
  2017-12-20 20:26 ` Yonghong Song
  2017-12-20 20:29 ` Jakub Kicinski
  0 siblings, 2 replies; 8+ messages in thread
From: Roman Gushchin @ 2017-12-20 20:19 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel-team, scientist, Roman Gushchin,
	Jakub Kicinski, Alexei Starovoitov, Daniel Borkmann

Bpftool determines it's own version based on the kernel
version, which is picked from the linux/version.h header.

It's strange to use the version of the installed kernel
headers, and makes much more sense to use the version
of the actual source tree, where bpftool sources are.

This patch adds $(srctree)/usr/include to the list
of include files, which causes bpftool to use the version
from the source tree.

Example:
before:

$ bpftool version
bpftool v4.14.6

after:
$ bpftool version
bpftool v4.15.0

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
---
 tools/bpf/bpftool/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 9c089cfa5f3f..6864d416c49e 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -37,7 +37,9 @@ CC = gcc
 
 CFLAGS += -O2
 CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wshadow
-CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf -I$(srctree)/kernel/bpf/
+CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi
+CFLAGS += -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf
+CFLAGS += -I$(srctree)/kernel/bpf/ -I$(srctree)/usr/include
 LIBS = -lelf -lbfd -lopcodes $(LIBBPF)
 
 INSTALL ?= install
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-21 17:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-20 20:19 [RFC PATCH net-next] tools/bpftool: use version from the kernel source tree Roman Gushchin
2017-12-20 20:26 ` Yonghong Song
2017-12-20 20:56   ` Roman Gushchin
2017-12-20 20:29 ` Jakub Kicinski
2017-12-20 20:53   ` Roman Gushchin
2017-12-20 21:52     ` Jakub Kicinski
2017-12-21 12:07       ` Roman Gushchin
2017-12-21 17:34         ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).