Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

libbpf: Fix some incorrect @param descriptions in the comment of libbpf.h

Fix up some of missing or incorrect @param descriptions for libbpf public APIs
in libbpf.h.

Signed-off-by: Jianyun Gao <jianyungao89@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20251118033025.11804-1-jianyungao89@gmail.com

authored by

Jianyun Gao and committed by
Andrii Nakryiko
8c868a34 f2cb0660

+16 -11
+16 -11
tools/lib/bpf/libbpf.h
··· 448 448 449 449 /** 450 450 * @brief **bpf_program__unpin()** unpins the BPF program from a file 451 - * in the BPFFS specified by a path. This decrements the programs 451 + * in the BPFFS specified by a path. This decrements program's in-kernel 452 452 * reference count. 453 453 * 454 454 * The file pinning the BPF program can also be unlinked by a different ··· 481 481 482 482 /** 483 483 * @brief **bpf_link__unpin()** unpins the BPF link from a file 484 - * in the BPFFS specified by a path. This decrements the links 485 - * reference count. 484 + * in the BPFFS. This decrements link's in-kernel reference count. 486 485 * 487 486 * The file pinning the BPF link can also be unlinked by a different 488 487 * process in which case this function will return an error. 489 488 * 490 - * @param prog BPF program to unpin 491 - * @param path file path to the pin in a BPF file system 489 + * @param link BPF link to unpin 492 490 * @return 0, on success; negative error code, otherwise 493 491 */ 494 492 LIBBPF_API int bpf_link__unpin(struct bpf_link *link); ··· 993 995 * - fentry/fexit/fmod_ret; 994 996 * - lsm; 995 997 * - freplace. 996 - * @param prog BPF program to set the attach type for 997 - * @param type attach type to set the BPF map to have 998 + * @param prog BPF program to configure; must be not yet loaded. 999 + * @param attach_prog_fd FD of target BPF program (for freplace/extension). 1000 + * If >0 and func name omitted, defers BTF ID resolution. 1001 + * @param attach_func_name Target function name. Used either with 1002 + * attach_prog_fd to find destination BTF type ID in that BPF program, or 1003 + * alone (no attach_prog_fd) to resolve kernel (vmlinux/module) BTF ID. 1004 + * Must be provided if attach_prog_fd is 0. 998 1005 * @return error code; or 0 if no error occurred. 999 1006 */ 1000 1007 LIBBPF_API int ··· 1101 1098 /** 1102 1099 * @brief **bpf_map__set_value_size()** sets map value size. 1103 1100 * @param map the BPF map instance 1101 + * @param size the new value size 1104 1102 * @return 0, on success; negative error, otherwise 1105 1103 * 1106 1104 * There is a special case for maps with associated memory-mapped regions, like ··· 1206 1202 * per-CPU values value size has to be aligned up to closest 8 bytes for 1207 1203 * alignment reasons, so expected size is: `round_up(value_size, 8) 1208 1204 * * libbpf_num_possible_cpus()`. 1209 - * @flags extra flags passed to kernel for this operation 1205 + * @param flags extra flags passed to kernel for this operation 1210 1206 * @return 0, on success; negative error, otherwise 1211 1207 * 1212 1208 * **bpf_map__lookup_elem()** is high-level equivalent of ··· 1230 1226 * per-CPU values value size has to be aligned up to closest 8 bytes for 1231 1227 * alignment reasons, so expected size is: `round_up(value_size, 8) 1232 1228 * * libbpf_num_possible_cpus()`. 1233 - * @flags extra flags passed to kernel for this operation 1229 + * @param flags extra flags passed to kernel for this operation 1234 1230 * @return 0, on success; negative error, otherwise 1235 1231 * 1236 1232 * **bpf_map__update_elem()** is high-level equivalent of ··· 1246 1242 * @param map BPF map to delete element from 1247 1243 * @param key pointer to memory containing bytes of the key 1248 1244 * @param key_sz size in bytes of key data, needs to match BPF map definition's **key_size** 1249 - * @flags extra flags passed to kernel for this operation 1245 + * @param flags extra flags passed to kernel for this operation 1250 1246 * @return 0, on success; negative error, otherwise 1251 1247 * 1252 1248 * **bpf_map__delete_elem()** is high-level equivalent of ··· 1269 1265 * per-CPU values value size has to be aligned up to closest 8 bytes for 1270 1266 * alignment reasons, so expected size is: `round_up(value_size, 8) 1271 1267 * * libbpf_num_possible_cpus()`. 1272 - * @flags extra flags passed to kernel for this operation 1268 + * @param flags extra flags passed to kernel for this operation 1273 1269 * @return 0, on success; negative error, otherwise 1274 1270 * 1275 1271 * **bpf_map__lookup_and_delete_elem()** is high-level equivalent of ··· 1641 1637 * @param sample_cb function called on each received data record 1642 1638 * @param lost_cb function called when record loss has occurred 1643 1639 * @param ctx user-provided extra context passed into *sample_cb* and *lost_cb* 1640 + * @param opts optional parameters for the perf buffer, can be null 1644 1641 * @return a new instance of struct perf_buffer on success, NULL on error with 1645 1642 * *errno* containing an error code 1646 1643 */