netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: fix test_attach_probe map definition
@ 2019-07-06  4:44 Andrii Nakryiko
  2019-07-06  5:17 ` Yonghong Song
  2019-07-08 15:25 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2019-07-06  4:44 UTC (permalink / raw)
  To: andrii.nakryiko, bpf, netdev, ast, daniel, kernel-team; +Cc: Andrii Nakryiko

ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map
defs") changed BTF-defined maps syntax, while independently merged
1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests") added new
test using outdated syntax of maps. This patch fixes this test after
corresponding patch sets were merged.

Fixes: ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map defs")
Fixes: 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 .../testing/selftests/bpf/progs/test_attach_probe.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/bpf/progs/test_attach_probe.c b/tools/testing/selftests/bpf/progs/test_attach_probe.c
index 7a7c5cd728c8..63a8dfef893b 100644
--- a/tools/testing/selftests/bpf/progs/test_attach_probe.c
+++ b/tools/testing/selftests/bpf/progs/test_attach_probe.c
@@ -6,14 +6,11 @@
 #include "bpf_helpers.h"
 
 struct {
-	int type;
-	int max_entries;
-	int *key;
-	int *value;
-} results_map SEC(".maps") = {
-	.type = BPF_MAP_TYPE_ARRAY,
-	.max_entries = 4,
-};
+	__uint(type, BPF_MAP_TYPE_ARRAY);
+	__uint(max_entries, 4);
+	__type(key, int);
+	__type(value, int);
+} results_map SEC(".maps");
 
 SEC("kprobe/sys_nanosleep")
 int handle_sys_nanosleep_entry(struct pt_regs *ctx)
-- 
2.17.1


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

* Re: [PATCH bpf-next] selftests/bpf: fix test_attach_probe map definition
  2019-07-06  4:44 [PATCH bpf-next] selftests/bpf: fix test_attach_probe map definition Andrii Nakryiko
@ 2019-07-06  5:17 ` Yonghong Song
  2019-07-08 15:25 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2019-07-06  5:17 UTC (permalink / raw)
  To: Andrii Nakryiko, andrii.nakryiko, bpf, netdev,
	Alexei Starovoitov, daniel, Kernel Team



On 7/5/19 9:44 PM, Andrii Nakryiko wrote:
> ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map
> defs") changed BTF-defined maps syntax, while independently merged
> 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests") added new
> test using outdated syntax of maps. This patch fixes this test after
> corresponding patch sets were merged.
> 
> Fixes: ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map defs")
> Fixes: 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: Yonghong Song <yhs@fb.com>

> ---
>   .../testing/selftests/bpf/progs/test_attach_probe.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/progs/test_attach_probe.c b/tools/testing/selftests/bpf/progs/test_attach_probe.c
> index 7a7c5cd728c8..63a8dfef893b 100644
> --- a/tools/testing/selftests/bpf/progs/test_attach_probe.c
> +++ b/tools/testing/selftests/bpf/progs/test_attach_probe.c
> @@ -6,14 +6,11 @@
>   #include "bpf_helpers.h"
>   
>   struct {
> -	int type;
> -	int max_entries;
> -	int *key;
> -	int *value;
> -} results_map SEC(".maps") = {
> -	.type = BPF_MAP_TYPE_ARRAY,
> -	.max_entries = 4,
> -};
> +	__uint(type, BPF_MAP_TYPE_ARRAY);
> +	__uint(max_entries, 4);
> +	__type(key, int);
> +	__type(value, int);
> +} results_map SEC(".maps");
>   
>   SEC("kprobe/sys_nanosleep")
>   int handle_sys_nanosleep_entry(struct pt_regs *ctx)
> 

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

* Re: [PATCH bpf-next] selftests/bpf: fix test_attach_probe map definition
  2019-07-06  4:44 [PATCH bpf-next] selftests/bpf: fix test_attach_probe map definition Andrii Nakryiko
  2019-07-06  5:17 ` Yonghong Song
@ 2019-07-08 15:25 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-07-08 15:25 UTC (permalink / raw)
  To: Andrii Nakryiko, andrii.nakryiko, bpf, netdev, ast, kernel-team

On 07/06/2019 06:44 AM, Andrii Nakryiko wrote:
> ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map
> defs") changed BTF-defined maps syntax, while independently merged
> 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests") added new
> test using outdated syntax of maps. This patch fixes this test after
> corresponding patch sets were merged.
> 
> Fixes: ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map defs")
> Fixes: 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!

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

end of thread, other threads:[~2019-07-08 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-06  4:44 [PATCH bpf-next] selftests/bpf: fix test_attach_probe map definition Andrii Nakryiko
2019-07-06  5:17 ` Yonghong Song
2019-07-08 15:25 ` Daniel Borkmann

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).