linux-next: manual merge of the bpf-next tree with the bpf tree
Subsystems (3)
Hi all,
Today's linux-next merge of the bpf-next tree got a conflict in:
tools/testing/selftests/bpf/test_progs.c
between commit:
a4e21ff8d9a3 ("bpf: minor fix to selftest test_stacktrace_build_id()")
from the bpf tree and commit:
79b453501310 ("tools/bpf: add a test for bpf_get_stack with tracepoint prog")
from the bpf-next tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 42 lines
Cheers,
Stephen Rothwell
diff --cc tools/testing/selftests/bpf/test_progs.c
index fac581f1c57f,aa336f0abebc..000000000000
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@@ -1137,9 -1193,14 +1193,14 @@@ static void test_stacktrace_build_id(vo
err, errno))
goto disable_pmu;
+ stack_amap_fd = bpf_find_map(__func__, obj, "stack_amap");
+ if (CHECK(stack_amap_fd < 0, "bpf_find_map stack_amap",
+ "err %d errno %d\n", err, errno))
+ goto disable_pmu;
+
assert(system("dd if=/dev/urandom of=/dev/zero count=4 2> /dev/null")
== 0);
- assert(system("./urandom_read if=/dev/urandom of=/dev/zero count=4 2> /dev/null") == 0);
+ assert(system("./urandom_read") == 0);
/* disable stack trace collection */
key = 0;
val = 1;
@@@ -1188,8 -1249,15 +1249,15 @@@
previous_key = key;
} while (bpf_map_get_next_key(stackmap_fd, &previous_key, &key) == 0);
- CHECK(build_id_matches < 1, "build id match",
- "Didn't find expected build ID from the map\n");
+ if (CHECK(build_id_matches < 1, "build id match",
- "Didn't find expected build ID from the map"))
++ "Didn't find expected build ID from the map\n"))
+ goto disable_pmu;
+
+ stack_trace_len = PERF_MAX_STACK_DEPTH
+ * sizeof(struct bpf_stack_build_id);
+ err = compare_stack_ips(stackmap_fd, stack_amap_fd, stack_trace_len);
+ CHECK(err, "compare_stack_ips stackmap vs. stack_amap",
+ "err %d errno %d\n", err, errno);
disable_pmu:
ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE);Quoted 52 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the bpf-next tree got a conflict in:
tools/testing/selftests/bpf/test_progs.cbetween commit:
a4e21ff8d9a3("bpf: minor fix to selftesttest_stacktrace_build_id()")from the bpf tree and commit:
79b453501310("tools/bpf: add a test forbpf_get_stackwith tracepoint prog")from the bpf-next tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 2 lines
Cheers, Stephen Rothwelltools/testing/selftests/bpf/test_progs.c +6
-1@@@ -1137,9 -1193,14 +1193,14 @@@ static void test_stacktrace_build_id(vo err, errno)) goto disable_pmu; + stack_amap_fd =bpf_find_map (__func__, obj,"stack_amap" ); +if (CHECK (stack_amap_fd <0 ,"bpf_find_map stack_amap" , +"err %d errno %d\n" , err, errno)) + goto disable_pmu; +assert (system ("dd if=/dev/urandom of=/dev/zero count=4 2> /dev/null" ) ==0 ); -assert (system ("./urandom_read if=/dev/urandom of=/dev/zero count=4 2> /dev/null" ) ==0 ); +assert (system ("./urandom_read" ) ==0 );/* disable stack trace collection */ key =0 ; val =1 ;
tools/testing/selftests/bpf/test_progs.c
Quoted 8 lines
tools/testing/selftests/bpf/test_progs.c +2
-3@@@ -1188,8 -1249,15 +1249,15 @@@ previous_key = key; }while (bpf_map_get_next_key (stackmap_fd, &previous_key, &key) ==0 ); -CHECK (build_id_matches <1 ,"build id match" , -"Didn't find expected build ID from the map\n" ); +if (CHECK (build_id_matches <1 ,"build id match" , - "Didn't find expected build ID from the map")) ++"Didn't find expected build ID from the map\n" ))
^^^ Is there a "+" at the beginning of this line?
Thanks,
Song
Quoted 10 lines
tools/testing/selftests/bpf/test_progs.c +7
-0+ goto disable_pmu; + + stack_trace_len =PERF_MAX_STACK_DEPTH + *sizeof (struct bpf_stack_build_id ); + err =compare_stack_ips (stackmap_fd, stack_amap_fd, stack_trace_len); +CHECK (err,"compare_stack_ips stackmap vs. stack_amap" , +"err %d errno %d\n" , err, errno); disable_pmu:ioctl (pmu_fd,PERF_EVENT_IOC_DISABLE );
Hi Song,
Quoted 8 lines · On Wed, 2 May 2018 04:40:20 +0000 Song Liu <[email protected]> wrote:
Review
Quoted 6 lines
(quoted diff) +2
-3- CHECK(build_id_matches < 1, "build id match", - "Didn't find expected build ID from the map\n"); + if (CHECK(build_id_matches < 1, "build id match", - "Didn't find expected build ID from the map")) ++ "Didn't find expected build ID from the map\n"))^^^ Is there a "+" at the beginning of this line?
No, this is a merge resolution diff, so the ++ means that the line did not appear in either parent commit.
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 16 lines · Stephen Rothwell
Hi Song,
Quoted 8 lines · On Wed, 2 May 2018 04:40:20 +0000 Song Liu <[email protected]> wrote:
Review
Quoted 6 lines
(quoted diff) +2
-3- CHECK(build_id_matches < 1, "build id match", - "Didn't find expected build ID from the map\n"); + if (CHECK(build_id_matches < 1, "build id match", - "Didn't find expected build ID from the map")) ++ "Didn't find expected build ID from the map\n"))^^^ Is there a "+" at the beginning of this line?
Quoted 2 lines
No, this is a merge resolution diff, so the ++ means that the line did not appear in either parent commit.
Hi Stephen,
Thanks for the explanation!
Song