Re: [PATCH v4 bpf-next 18/22] bpftool: Use syscall/loader program in "prog load" and "gen skeleton" command.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/11/21 9:17 PM, Andrii Nakryiko wrote:
+       bpf_object__for_each_program(prog, obj) {
+               printf("\tif (skel->links.%1$s_fd > 0) close(skel->links.%1$s_fd);\n",
+                      bpf_program__name(prog));

you use bpf_program__name(prog) in so many place that it will be much
simpler if you have a dedicated variable for it

Every time it's in the different loop over all progs.

+       obj = bpf_object__open_file(file, &open_opts);
+       if (IS_ERR_OR_NULL(obj)) {

please use libbpf_get_error() instead of IS_ERR_OR_NULL()

That was copy-pasted from another place in the same file.
Fixed both and the rest of comments.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux