From nobody Tue Dec 2 02:43:42 2025 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C6DD5464D for ; Tue, 18 Nov 2025 03:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763436640; cv=none; b=BJDmlB+DHZHbj/+EcVB6e4OS/cPh0xj31t0WX+jL4K+jDMlyu9y3WF+tDgbDBR7iJrpRcXmcqKchWoQnWsSQQD/5F7F+r6extHBcHYFsuPQxzyfjOTJpNI37tfg1N3UZeyR8nNkE7eD4enwaEBiuR0S9ODrAx9DDV5DYFd3Dz5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763436640; c=relaxed/simple; bh=BE9zsbvHGFfp+7aYyid9mP7IxTpWTd0oLS1V3AxM4xc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=vBwcbKHsNr2ubVPYcXO78S2BdtPcOJm3xeoyaOTcN8cvwPas105/aQOebFLfCvREYVi4/10EQReY7slByWPZPQbjvE8fH3RhmAnvvdnoecyWVfNhL457/3Q7v84lZ2/Y8QlKVllPaYLkBKOHAEVbfpxNrxXAJsWVZdHNYr25Nps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SCI1/r1/; arc=none smtp.client-ip=209.85.216.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SCI1/r1/" Received: by mail-pj1-f65.google.com with SMTP id 98e67ed59e1d1-343ea89896eso4987801a91.2 for ; Mon, 17 Nov 2025 19:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763436637; x=1764041437; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AIpio3BmxnaLKRtG46m9gb4TEer3dPT7GOk9htkcR9A=; b=SCI1/r1/+s/lZFLoFqbF9sRBLLS9sLVLDV5qEELTpQZe6hax5JXqpGkABuUnsCXH83 txDm3jo3zjJ6jcHZ5ISqB3kjXh1XMFD42fMQ6Qdctvd4/vDFtrCxxXWY04vi101erKZt swBnpCcWesczc4Eeu7t7TXYw2EmZ6oT/0b/5fzHDAsLFvSG3LCf1HZapvrnmhirvM17I V855Rcj7dI1HnJf8g3AFPt9r/Av/Z3ZlcNzF5zadhXuaIDsMeZwbG12waupM+JYM3jTY SQZ+1OZJFIk0MX0LjvJKFdYxepDEyxb1pDoybLQ3onhMMi6qqY7PM9MgozEh8TB5z4YM pzkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763436637; x=1764041437; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AIpio3BmxnaLKRtG46m9gb4TEer3dPT7GOk9htkcR9A=; b=g0JOTsZ+N1aqwqNuaIRQq9CPeRgaitQg5IuTApUzbiFjcOGJdeUz7Uy3UxEjX4ABqm TVRi0NK7ugFXU3LAhADRrt56vX4IeA3ArOYrhMZcdCfm2e51vD8awG/mJ5KiFpnVNB8H 30OMLSfDPS9HSiwHD5+dYdP+++INgSBwy+LFLYJ1avylpOOWOdfhp069srI4D5LYPIYq Hzt7OIH6umtIv65kpTrM/smiv4kQVeuCgJQr9shYP6BKpaACi/4be7ioAqadCV7FJuaC 62IOgWRP4wtIGKTBIZRzUC0I5vbFuS24n1KHGEmERQPryASB+B2NI98NX9y0FUuhY7pM qqsw== X-Gm-Message-State: AOJu0Yzwupcb5VLf9sO6GinPezWsi/JOTgpRjE5gybLKT9/FchE6/vWR LXRTSVJmLvoz//Akl90uSb2CWGBNJzei5z1RE8qpmFVjuVFtKwyBAVXGvIWchBWt X-Gm-Gg: ASbGncuxKfquQcvJRqhacY3MUaAqzl74xpfgVFS6Tm4/lOPbHDERF9Um+5LTiATMWXU Fy1Gi0ckeFH11ZVGK6ZDy+wd5oV7U3ersP5dpohRzHj8KkOEmd5H7OMPzDg9vvSPRgyyKLGujn1 Thugqxh03u+GHezjbGaPpkPUWnKmlSSGvbn4Oq8FmqnPWBs7RuvppuycIaQ7TQAClHUczVobMtY pRUFnGKpZCHmyITmh8b2WG0XUPyC7oV8AyBzeLVAhvSl6NsKagL9rAvthjsCTKkuh2rNHL4/Hsl BE/j3wjSiJZ2gq4xAxrgw8D/8VD/OrRHoMN0GLq+4krj3mfac03K3oJPq05jJ21OF/T2UX3NtLa dc7S2mX1ENxEpakoHk4cuGN+A1cON6ob018sWpnbl7NvGSUiRUdWQBnMqV3ZjBgi7A3OjmVLZyW tfsIKvWb/MiIAaYhBRWxrsSMLC/PqQXQplmQ== X-Google-Smtp-Source: AGHT+IG+IgR1Db1XjCV8ThNxAgsCmbbRs2M3HCU1m2p26WBqCzV20SgGglln8zkiaE2/Jgyz3VELZg== X-Received: by 2002:a17:90b:55c6:b0:335:2823:3683 with SMTP id 98e67ed59e1d1-343f9eadd5bmr14823336a91.9.1763436637031; Mon, 17 Nov 2025 19:30:37 -0800 (PST) Received: from DESKTOP-P5RIK7I.localdomain ([103.52.189.22]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3456513e090sm11172110a91.6.2025.11.17.19.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Nov 2025 19:30:36 -0800 (PST) From: Jianyun Gao To: linux-kernel@vger.kernel.org Cc: Jianyun Gao , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org (open list:BPF [GENERAL] (Safe Dynamic Programs and Tools)) Subject: [PATCH] libbpf: fix some incorrect @param descriptions in the comment of libbpf.h Date: Tue, 18 Nov 2025 11:30:24 +0800 Message-Id: <20251118033025.11804-1-jianyungao89@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are some incorrect @param descriptions in the comment of libbpf.h file. The following is a case: /** * @brief **bpf_link__unpin()** unpins the BPF link from a file * in the BPFFS specified by a path. This decrements the links * reference count. * * The file pinning the BPF link can also be unlinked by a different * process in which case this function will return an error. * * @param prog BPF program to unpin * @param path file path to the pin in a BPF file system * @return 0, on success; negative error code, otherwise */ LIBBPF_API int bpf_link__unpin(struct bpf_link *link); In the parameters of the bpf_link__unpin() function, there are no 'prog' and 'path' parameters. This patch fixes this kind of issues present in the comments of the libbpf.h file. Signed-off-by: Jianyun Gao --- tools/lib/bpf/libbpf.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 5118d0a90e24..8ca7957c8dd4 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -481,14 +481,12 @@ LIBBPF_API int bpf_link__pin(struct bpf_link *link, c= onst char *path); =20 /** * @brief **bpf_link__unpin()** unpins the BPF link from a file - * in the BPFFS specified by a path. This decrements the links - * reference count. + * in the BPFFS. This decrements the links reference count. * * The file pinning the BPF link can also be unlinked by a different * process in which case this function will return an error. * - * @param prog BPF program to unpin - * @param path file path to the pin in a BPF file system + * @param link BPF link to unpin * @return 0, on success; negative error code, otherwise */ LIBBPF_API int bpf_link__unpin(struct bpf_link *link); @@ -995,8 +993,13 @@ LIBBPF_API __u32 bpf_program__line_info_cnt(const stru= ct bpf_program *prog); * - fentry/fexit/fmod_ret; * - lsm; * - freplace. - * @param prog BPF program to set the attach type for - * @param type attach type to set the BPF map to have + * @param prog BPF program to configure; must be not yet loaded. + * @param attach_prog_fd FD of target BPF program (for freplace/extension). + * If >0 and func name omitted, defers BTF ID resolution. + * @param attach_func_name Target function name. Used either with + * attach_prog_fd to find its BTF ID in that program, or alone + * (no attach_prog_fd) to resolve kernel (vmlinux/module) BTF ID. Must be + * provided if attach_prog_fd is 0. * @return error code; or 0 if no error occurred. */ LIBBPF_API int @@ -1098,6 +1101,7 @@ LIBBPF_API __u32 bpf_map__value_size(const struct bpf= _map *map); /** * @brief **bpf_map__set_value_size()** sets map value size. * @param map the BPF map instance + * @param size the new value size * @return 0, on success; negative error, otherwise * * There is a special case for maps with associated memory-mapped regions,= like @@ -1202,7 +1206,7 @@ LIBBPF_API struct bpf_map *bpf_map__inner_map(struct = bpf_map *map); * per-CPU values value size has to be aligned up to closest 8 bytes for * alignment reasons, so expected size is: `round_up(value_size, 8) * * libbpf_num_possible_cpus()`. - * @flags extra flags passed to kernel for this operation + * @param flags extra flags passed to kernel for this operation * @return 0, on success; negative error, otherwise * * **bpf_map__lookup_elem()** is high-level equivalent of @@ -1226,7 +1230,7 @@ LIBBPF_API int bpf_map__lookup_elem(const struct bpf_= map *map, * per-CPU values value size has to be aligned up to closest 8 bytes for * alignment reasons, so expected size is: `round_up(value_size, 8) * * libbpf_num_possible_cpus()`. - * @flags extra flags passed to kernel for this operation + * @param flags extra flags passed to kernel for this operation * @return 0, on success; negative error, otherwise * * **bpf_map__update_elem()** is high-level equivalent of @@ -1242,7 +1246,7 @@ LIBBPF_API int bpf_map__update_elem(const struct bpf_= map *map, * @param map BPF map to delete element from * @param key pointer to memory containing bytes of the key * @param key_sz size in bytes of key data, needs to match BPF map definit= ion's **key_size** - * @flags extra flags passed to kernel for this operation + * @param flags extra flags passed to kernel for this operation * @return 0, on success; negative error, otherwise * * **bpf_map__delete_elem()** is high-level equivalent of @@ -1265,7 +1269,7 @@ LIBBPF_API int bpf_map__delete_elem(const struct bpf_= map *map, * per-CPU values value size has to be aligned up to closest 8 bytes for * alignment reasons, so expected size is: `round_up(value_size, 8) * * libbpf_num_possible_cpus()`. - * @flags extra flags passed to kernel for this operation + * @param flags extra flags passed to kernel for this operation * @return 0, on success; negative error, otherwise * * **bpf_map__lookup_and_delete_elem()** is high-level equivalent of @@ -1637,6 +1641,7 @@ struct perf_buffer_opts { * @param sample_cb function called on each received data record * @param lost_cb function called when record loss has occurred * @param ctx user-provided extra context passed into *sample_cb* and *los= t_cb* + * @param opts optional parameters for the perf buffer, mainly *sample_per= iod* * @return a new instance of struct perf_buffer on success, NULL on error = with * *errno* containing an error code */ --=20 2.34.1