On Mon, 2025-02-10 at 17:13 -0800, Andrii Nakryiko wrote: [...] > > @@ -1334,17 +1634,6 @@ static int process_obj(const char *filename) > > > > env.files_processed++; > > > > - bpf_object__for_each_program(prog, obj) { > > - prog_cnt++; > > - } > > - > > - if (prog_cnt == 1) { > > - prog = bpf_object__next_program(obj, NULL); > > - bpf_program__set_autoload(prog, true); > > - process_prog(filename, obj, prog); > > - goto cleanup; > > - } > > - > > I think this was an optimization to avoid a heavy-weight ELF parsing > twice, why would we want to remove it?.. > > pw-bot: cr The v1 of this patch missed the case that globals have to be set in both cases, when prog_cnt == 1 and prog_cnt != 1. I remember making same mistake when debugging something unrelated. Hence I suggested removing this special case. > > bpf_object__for_each_program(prog, obj) { > > const char *prog_name = bpf_program__name(prog); > >