@@ -623,19 +623,29 @@ static void *worker_trigger(void *arg)
623
623
static void * worker_attach (void * arg )
624
624
{
625
625
struct uprobe_syscall_executed * skel ;
626
- unsigned long rounds = 0 ;
626
+ unsigned long rounds = 0 , offset ;
627
+ void * addr ;
628
+
629
+ addr = find_nop5 (& uprobe_test );
630
+ if (!ASSERT_OK_PTR (addr , "find_nop5" ))
631
+ return NULL ;
632
+
633
+ offset = get_uprobe_offset (addr );
634
+ if (!ASSERT_GE (offset , 0 , "get_uprobe_offset" ))
635
+ return NULL ;
627
636
628
637
skel = uprobe_syscall_executed__open_and_load ();
629
638
if (!ASSERT_OK_PTR (skel , "uprobe_syscall_executed__open_and_load" ))
630
639
return NULL ;
631
640
632
641
while (!race_stop ) {
633
- skel -> links .test_uprobe_multi = bpf_program__attach_uprobe_multi (skel -> progs .test_uprobe_multi ,
634
- -1 , "/proc/self/exe" , "uprobe_test" , NULL );
635
- if (!ASSERT_OK_PTR (skel -> links .test_uprobe_multi , "bpf_program__attach_uprobe_multi " ))
642
+ skel -> links .test_uprobe = bpf_program__attach_uprobe_opts (skel -> progs .test_uprobe ,
643
+ 0 , "/proc/self/exe" , offset , NULL );
644
+ if (!ASSERT_OK_PTR (skel -> links .test_uprobe , "bpf_program__attach_uprobe_opts " ))
636
645
break ;
637
- bpf_link__destroy (skel -> links .test_uprobe_multi );
638
- skel -> links .test_uprobe_multi = NULL ;
646
+
647
+ bpf_link__destroy (skel -> links .test_uprobe );
648
+ skel -> links .test_uprobe = NULL ;
639
649
rounds ++ ;
640
650
}
641
651
@@ -653,6 +663,7 @@ static void test_uprobe_race(void)
653
663
if (!ASSERT_GE (nr_cpus , 0 , "nr_cpus" ))
654
664
return ;
655
665
666
+ nr_cpus /= 2 ;
656
667
nr = nr_cpus * 2 ;
657
668
threads = malloc (sizeof (* threads ) * nr );
658
669
if (!ASSERT_OK_PTR (threads , "malloc" ))
0 commit comments