Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2366580lqp; Sun, 24 Mar 2024 16:03:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXS6qAnmv8nXEzCZlxD3O/XwlRBaOmxTpZ/10b5i6d70HtRjw/wL6HzcDUheY+mG1VG/fWSiFhKUsAtcdUey6kdAnDozhtB3rFIzIhIQA== X-Google-Smtp-Source: AGHT+IE1U+k9HVpJD2G9KWz+AniQ+Y9glyjTrXtdntIgkHQtqZIVs3PMnPAykUj88TPAgXKURoEj X-Received: by 2002:a17:906:b1d9:b0:a46:a1d0:8451 with SMTP id bv25-20020a170906b1d900b00a46a1d08451mr4124911ejb.16.1711321409634; Sun, 24 Mar 2024 16:03:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711321409; cv=pass; d=google.com; s=arc-20160816; b=qJhL2Irg/byetIvtQl4jIYqHiKZucPQkb5EtXD97iwrqAcInp2ScsljJvcO5wLHELn hTxI9T04G7H+TXRtW0rirhAeYn3PFjAbm+4EU8ETQVzArCxvTeQ5Az0GhLcpd5fkhH8s b08ASLCy+xlC38UWfT4unCi6U3JdGGpespiW+dBaiAvnzQrunpKpEgqz2V4M1AxpONGU 9hHuWcM/knRv50C8i5iwCFAIJZZcDBZ7+pKHo5iCo3hs92YuiXgJPFcfkmEtsZT89tBZ KMJ/iApq8XT/a7vkcHcZTcKbq3nkiNH87GUZB1HOIvk8sGxL9N2pmvS2WYZwTFNZOJE0 u7yg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vLWHx2b3bgHYwu2wC+f6AuBHYBtemGT/ywPrPyLUnHc=; fh=F0P4d1VZCFW3kJvyUtQt3r2/XCRGPb2N/9eOR+1qAPU=; b=rP7FPuF9bxHISHbNydy4n2eX86FXVyYUh+qJtTTdaTSYZT7C1f2JV6bjmwAboj8Ji0 U5/+rlsOgVyhXY6iGOqLyCMO/6UrRKd+csDEbvwTVQgnoriggMXkCdaf/ubAaR1ndnti dG6fMBjptdeNz+bseSs1BagFQ5BBoTTwCFzzTMPrHmt4tyCyTjhGogi3QI4IBx/rePm/ txchDQJ0AIo/Sew/t5GImzNAE5sa3F5sUsRNiqbFeVDDZq4CKLwuZltI3os+d78mzese BXWikCwe6Dasl3qbJxySxNPCE/qeio6zJg0h//bnS66kgG9WS4trjnkari7EYCJQ5Tv6 l1PQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NZunQo7E; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r4-20020a170906280400b00a43db2d8b90si1864035ejc.325.2024.03.24.16.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NZunQo7E; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5BD021F26107 for ; Sun, 24 Mar 2024 23:03:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20B7313175E; Sun, 24 Mar 2024 22:37:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NZunQo7E" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 255F013172A; Sun, 24 Mar 2024 22:36:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319819; cv=none; b=gc8JcvbeqemEfhT3pPnvSvnMdnlH3jsrGLQPeJcJvb2RXyXLMLmi4AD9QrD2Uu2X9V68Xjx2BucQpJOpIvsRoKGsvjwpA6Y8lZ/rEnANIViVy2vvkPSNYX/UJ5VUTzo4sHw0iTwxYoBTf/Bn5AFRh6I9T98UI0VT0VB9795mAhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319819; c=relaxed/simple; bh=ub5gTDg45u7ZTcHGkS5iJFn3fIXQKswUIcupG71O8js=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rs90tazKUNNiyISn4PdZQKusWu7yQINdYYYHkQ7CjGCRisiyqlXZX+7Hu8LX39nvxQpkvHke2AgRlbQNuZ3bjYhHDyKS+hXHQuW+9maUgLGZ5Q4Y6mIKcqPU6J5kf8CL9zSu8nI8o3ybgjKjZ2sdlbZwM3T4jrM0xHLUMM0a7fY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NZunQo7E; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DBADC433F1; Sun, 24 Mar 2024 22:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319819; bh=ub5gTDg45u7ZTcHGkS5iJFn3fIXQKswUIcupG71O8js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZunQo7ETtp8cYDeJ2Pa5JpKbidqe414BYoHJbwXOV3c+m5IOPpYWlbNY3A5cjLDI kOXGBgAjLo0Usnt7wVP0iVDcdNjzSWJJbyGVWyl9LZmW12jrFyX1gh/umMJiYskG8L 0+9AcAx3APKGek+Iku6/BUKslDHTwWTDtpS1jRHfgwtme2EoSrA/nPjVNkJa6onCE4 nPmfA8WFYtE8oJqB3SFYaRZeZTL5PQSKG7OENClxnv23nN5Yh/rYFc61jkgQnIWjHy mjmME/pPn8hDZao3PzV5LU9EhpkJ+NIRmAjbdmMowtw8Vo8hSXDk2hhPGBzY8gFjMv GjzkMmq87qUGg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrii Nakryiko , Daniel Borkmann , Eduard Zingerman , Sasha Levin Subject: [PATCH 6.8 121/715] libbpf: Add missed btf_ext__raw_data() API Date: Sun, 24 Mar 2024 18:25:00 -0400 Message-ID: <20240324223455.1342824-122-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Andrii Nakryiko [ Upstream commit b9551da8cf3ade01a50316df8a618fd945723ee0 ] Another API that was declared in libbpf.map but actual implementation was missing. btf_ext__get_raw_data() was intended as a discouraged alias to consistently-named btf_ext__raw_data(), so make this an actuality. Fixes: 20eccf29e297 ("libbpf: hide and discourage inconsistently named getters") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20240201172027.604869-5-andrii@kernel.org Signed-off-by: Sasha Levin --- tools/lib/bpf/btf.c | 6 +++++- tools/lib/bpf/libbpf.map | 2 +- tools/lib/bpf/linker.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index b61bc5d1009b7..119d45eadb2ed 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -3044,12 +3044,16 @@ struct btf_ext *btf_ext__new(const __u8 *data, __u32 size) return btf_ext; } -const void *btf_ext__get_raw_data(const struct btf_ext *btf_ext, __u32 *size) +const void *btf_ext__raw_data(const struct btf_ext *btf_ext, __u32 *size) { *size = btf_ext->data_size; return btf_ext->data; } +__attribute__((alias("btf_ext__raw_data"))) +const void *btf_ext__get_raw_data(const struct btf_ext *btf_ext, __u32 *size); + + struct btf_dedup; static struct btf_dedup *btf_dedup_new(struct btf *btf, const struct btf_dedup_opts *opts); diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 386964f572a8f..86804fd90dd1a 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -325,7 +325,6 @@ LIBBPF_0.7.0 { bpf_xdp_detach; bpf_xdp_query; bpf_xdp_query_id; - btf_ext__raw_data; libbpf_probe_bpf_helper; libbpf_probe_bpf_map_type; libbpf_probe_bpf_prog_type; @@ -413,4 +412,5 @@ LIBBPF_1.4.0 { global: bpf_token_create; btf__new_split; + btf_ext__raw_data; } LIBBPF_1.3.0; diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index 16bca56002ab3..0d4be829551b5 100644 --- a/tools/lib/bpf/linker.c +++ b/tools/lib/bpf/linker.c @@ -2732,7 +2732,7 @@ static int finalize_btf(struct bpf_linker *linker) /* Emit .BTF.ext section */ if (linker->btf_ext) { - raw_data = btf_ext__get_raw_data(linker->btf_ext, &raw_sz); + raw_data = btf_ext__raw_data(linker->btf_ext, &raw_sz); if (!raw_data) return -ENOMEM; -- 2.43.0