All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] tools/bpf: use proper type and uapi perf_event.h header for libbpf
@ 2018-10-09 23:14 Yonghong Song
  2018-10-09 23:21 ` Song Liu
  2018-10-10  5:05 ` Alexei Starovoitov
  0 siblings, 2 replies; 3+ messages in thread
From: Yonghong Song @ 2018-10-09 23:14 UTC (permalink / raw)
  To: ast, daniel, netdev; +Cc: kernel-team

Use __u32 instead u32 in libbpf.c and also use
uapi perf_event.h instead of tools/perf/perf-sys.h.

Signed-off-by: Yonghong Song <yhs@fb.com>
---
 tools/lib/bpf/Makefile | 2 +-
 tools/lib/bpf/libbpf.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 6ad27257fd67..79d84413ddf2 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -69,7 +69,7 @@ FEATURE_USER = .libbpf
 FEATURE_TESTS = libelf libelf-mmap bpf reallocarray
 FEATURE_DISPLAY = libelf bpf
 
-INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi -I$(srctree)/tools/perf
+INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
 FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
 
 check_feat := 1
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index ceb918c14d80..176cf5523728 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -19,7 +19,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <perf-sys.h>
 #include <asm/unistd.h>
 #include <linux/err.h>
 #include <linux/kernel.h>
@@ -27,6 +26,7 @@
 #include <linux/btf.h>
 #include <linux/list.h>
 #include <linux/limits.h>
+#include <linux/perf_event.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/vfs.h>
@@ -169,7 +169,7 @@ static LIST_HEAD(bpf_objects_list);
 
 struct bpf_object {
 	char license[64];
-	u32 kern_version;
+	__u32 kern_version;
 
 	struct bpf_program *programs;
 	size_t nr_programs;
@@ -540,7 +540,7 @@ static int
 bpf_object__init_kversion(struct bpf_object *obj,
 			  void *data, size_t size)
 {
-	u32 kver;
+	__u32 kver;
 
 	if (size != sizeof(kver)) {
 		pr_warning("invalid kver section in %s\n", obj->path);
@@ -1295,7 +1295,7 @@ static int bpf_object__collect_reloc(struct bpf_object *obj)
 static int
 load_program(enum bpf_prog_type type, enum bpf_attach_type expected_attach_type,
 	     const char *name, struct bpf_insn *insns, int insns_cnt,
-	     char *license, u32 kern_version, int *pfd, int prog_ifindex)
+	     char *license, __u32 kern_version, int *pfd, int prog_ifindex)
 {
 	struct bpf_load_program_attr load_attr;
 	char *cp, errmsg[STRERR_BUFSIZE];
-- 
2.17.1

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

* Re: [PATCH bpf-next] tools/bpf: use proper type and uapi perf_event.h header for libbpf
  2018-10-09 23:14 [PATCH bpf-next] tools/bpf: use proper type and uapi perf_event.h header for libbpf Yonghong Song
@ 2018-10-09 23:21 ` Song Liu
  2018-10-10  5:05 ` Alexei Starovoitov
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2018-10-09 23:21 UTC (permalink / raw)
  To: Yonghong Song; +Cc: Alexei Starovoitov, daniel, netdev, Kernel Team



> On Oct 9, 2018, at 4:14 PM, Yonghong Song <yhs@fb.com> wrote:
> 
> Use __u32 instead u32 in libbpf.c and also use
> uapi perf_event.h instead of tools/perf/perf-sys.h.
> 
> Signed-off-by: Yonghong Song <yhs@fb.com>

Acked-by: Song Liu <songliubraving@fb.com>

> ---
> tools/lib/bpf/Makefile | 2 +-
> tools/lib/bpf/libbpf.c | 8 ++++----
> 2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 6ad27257fd67..79d84413ddf2 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -69,7 +69,7 @@ FEATURE_USER = .libbpf
> FEATURE_TESTS = libelf libelf-mmap bpf reallocarray
> FEATURE_DISPLAY = libelf bpf
> 
> -INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi -I$(srctree)/tools/perf
> +INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
> FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
> 
> check_feat := 1
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index ceb918c14d80..176cf5523728 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -19,7 +19,6 @@
> #include <unistd.h>
> #include <fcntl.h>
> #include <errno.h>
> -#include <perf-sys.h>
> #include <asm/unistd.h>
> #include <linux/err.h>
> #include <linux/kernel.h>
> @@ -27,6 +26,7 @@
> #include <linux/btf.h>
> #include <linux/list.h>
> #include <linux/limits.h>
> +#include <linux/perf_event.h>
> #include <sys/stat.h>
> #include <sys/types.h>
> #include <sys/vfs.h>
> @@ -169,7 +169,7 @@ static LIST_HEAD(bpf_objects_list);
> 
> struct bpf_object {
> 	char license[64];
> -	u32 kern_version;
> +	__u32 kern_version;
> 
> 	struct bpf_program *programs;
> 	size_t nr_programs;
> @@ -540,7 +540,7 @@ static int
> bpf_object__init_kversion(struct bpf_object *obj,
> 			  void *data, size_t size)
> {
> -	u32 kver;
> +	__u32 kver;
> 
> 	if (size != sizeof(kver)) {
> 		pr_warning("invalid kver section in %s\n", obj->path);
> @@ -1295,7 +1295,7 @@ static int bpf_object__collect_reloc(struct bpf_object *obj)
> static int
> load_program(enum bpf_prog_type type, enum bpf_attach_type expected_attach_type,
> 	     const char *name, struct bpf_insn *insns, int insns_cnt,
> -	     char *license, u32 kern_version, int *pfd, int prog_ifindex)
> +	     char *license, __u32 kern_version, int *pfd, int prog_ifindex)
> {
> 	struct bpf_load_program_attr load_attr;
> 	char *cp, errmsg[STRERR_BUFSIZE];
> -- 
> 2.17.1
> 

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

* Re: [PATCH bpf-next] tools/bpf: use proper type and uapi perf_event.h header for libbpf
  2018-10-09 23:14 [PATCH bpf-next] tools/bpf: use proper type and uapi perf_event.h header for libbpf Yonghong Song
  2018-10-09 23:21 ` Song Liu
@ 2018-10-10  5:05 ` Alexei Starovoitov
  1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2018-10-10  5:05 UTC (permalink / raw)
  To: Yonghong Song; +Cc: ast, daniel, netdev, kernel-team

On Tue, Oct 09, 2018 at 04:14:47PM -0700, Yonghong Song wrote:
> Use __u32 instead u32 in libbpf.c and also use
> uapi perf_event.h instead of tools/perf/perf-sys.h.
> 
> Signed-off-by: Yonghong Song <yhs@fb.com>

Applied, Thanks

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

end of thread, other threads:[~2018-10-10 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 23:14 [PATCH bpf-next] tools/bpf: use proper type and uapi perf_event.h header for libbpf Yonghong Song
2018-10-09 23:21 ` Song Liu
2018-10-10  5:05 ` Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.