File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 11#include "../src/libbpf.h"
22
3- int callback_fn (struct bpf_program * prog , struct bpf_prog_load_opts * opts , long cookie ) {
4- printf ("Hello world\n" );
5- return -1 ;
6- }
7-
83int main (int argn , char * * argv ) {
94 if (argn != 3 ) {
105 return 1 ;
@@ -15,17 +10,7 @@ int main(int argn, char **argv) {
1510 return 1 ;
1611 }
1712
18- struct libbpf_prog_handler_opts opts ;
19- opts .sz = sizeof (opts );
20- opts .prog_attach_fn = NULL ;
21- opts .prog_setup_fn = NULL ;
22- opts .prog_prepare_load_fn = callback_fn ;
23- libbpf_register_prog_handler (bpf_program__section_name (prog ), bpf_program__get_type (prog ),
24- bpf_program__expected_attach_type (prog ), & opts );
25- bpf_object__close (obj );
26- obj = bpf_object__open (argv [1 ]);
27-
28- bpf_object__load (obj , 0 , "asd" , "fddffd" );
13+ bpf_object__load (obj , 1 , "asd" , "fddffd" );
2914
3015 bpf_object__close (obj );
3116}
You can’t perform that action at this time.
0 commit comments