On Thu, 24 Jan 2019 19:27:35 +0100, Maciej Fijałkowski wrote:
> > > can live with this. In case of typo and program being not found it would 
> > > be
> > > good to print out the section names to choose from in usage().  
> > 
> > Agree, might be nice as well via libbpf.  
> 
> Would it be acceptable to print them from within libbpf? Something as trivial
> as:
> void
> bpf_object__print_type_sections(struct bpf_object *obj,
>                               enum bpf_prog_type type)
> {
>       struct bpf_program *prog;
> 
>       bpf_object__for_each_program(prog, obj) {
>               if (bpf_program__is_type(prog, type))
>                       pr_info("section %s\n", prog->section_name);
>       }
> }

Better not.

> Or do we want to add a accessor for section_name and go through programs in
> application?

bpf_program__title(), no?

Reply via email to