po 3. 11. 2025 v 15:24 odesÃlatel Wander Lairson Costa <[email protected]> napsal: >> +/* >> + * timerlat_bpf_set_action - set action on threshold executed on BPF side >> + */ >> +static int timerlat_bpf_set_action(struct bpf_program *prog) >> +{ >> + unsigned int key = 0, value = bpf_program__fd(prog); >> + >> + return bpf_map__update_elem(bpf->maps.bpf_action, >> + &key, sizeof(key), >> + &value, sizeof(value), >> + BPF_ANY); >> +} >> + > > I believe it makes more sense to add the definition of this function to > the patch where it is called. >
Maybe, but I wrote this patch first, the rest of the patchset some time after that. That is why it is this way; either way, it doesn't hurt to define something before using it, the other way is worse. Tomas
