From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796337287; b=bUJ3cg0cIjrUIYJiwugTI/LDft03aEoR7PRIOCu5SmrjboSDHaKNWHILUUMNJ4Ms0Vdm 6QOA35gw4G7i3xfR8kUUQIvnBqzb39jsECQoUG2kRcsDHY3u40otBoBkp4kIu21Rx63Cp xUBfJuV/DCGrm/z5LrLXd+Hx2gZ3/Y49mUT10Qu/GmLg/VjfTPM8+v1bzrpJSqrtMVmeo GLWLqnHdGrGWtgyRs/zhmu0wi6Q8k3/j+Ekw53pU+qw5rRh4qfpPnQJBDi9wrfpdg8Sq7 /QB+UtyFPeybdF875Sq+9D8xQcaxaPjubCCeyBqUmDEErFO1084tDTQwT3vyLrCKR/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796337287; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=CN0zGD1HrtQcrF+e7+q7LX9Y0cnMtHQN02NghKo01io=; b=OYx+0nC0NmwN0jRoysBYEdqj4NSu/syvGUMhZo1BZdy7bM5gc8vQ98/77WD9hx8LaQ6q 0/qp6WmkS52xGqHxzUtN+AwAQOBvDiYesGCI9IfDH6Va5jAgtifZbnLOTXYlMnfYlrHZ5 Zfptj+NqyuXCHY/C6iPl+4mnqQrQOpCOIXa1v9/PHFlpnbaCrnnHvOPeqy9Nm+3tD4viz CpwFWT2k5NmxZiDejhLf0kYli+t5SzUEWOsJad9n3wtaNjyJk2MLHF/geMD92yqXuBPlq NeGLE2ZVhlWHJW3OffUrBzCeK491axWVTOGOpGlajnPs7sBxl79Gu9eyEWpXDgLAPBA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cL2oMiJ+; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B1A2606A322; Thu, 3 Dec 2026 22:34:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cL2oMiJ+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id DACAC1F0092B; Thu, 3 Dec 2026 22:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796337287; bh=CN0zGD1HrtQcrF+e7+q7LX9Y0cnMtHQN02NghKo01io=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cL2oMiJ+869URAXI4qWJXlnvt/Ul99xE05cx/EXwFPlthZFTr2XErVS3ZB/hDiC4+ NKle+pE7r09ZYSG7ZU8tlTikbs0t8T83XQbNaM7IWkffEDCXSzXT445JhQwzCugquD 8eDDmeW1S9Nt9eHmt/GilvDXSA/96hDcUBV6cwJHNTAoWaqQTaNJ5/cyMbwso66leF PO05veKsdj6sTTSndxAwcArAVvCg+bIfEJx5KVEr0trhV5B8xuzfToya58PBVv0OBH smIkRUlgdDjTfmx1QiC98T3evH4VAdRIN9N5BnGH5ULOBMe6GwivDeYkIHv0qI3180 Xp4rfi0KGAdXg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] perf build: Fix bpf-gcc skeleton codegen and CO-RE relocations Reply-To: sashiko-reviews@lists.linux.dev To: "Ian Rogers" Cc: linux-perf-users@vger.kernel.org, bpf@vger.kernel.org In-Reply-To: <20261203221459.1567050-1-irogers@google.com> References: <20261203221459.1567050-1-irogers@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 22:34:46 +0000 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] perf: undocumented __clang__ guard on mem_hops check in perf_get_sample() -- commit c2700c3fd451a5a8cebb067313708ff938102232 Author: Ian Rogers perf build: Fix bpf-gcc skeleton codegen and CO-RE relocations This commit disables several GCC optimization passes in bpf_skel.mak and adjusts CO-RE relocations in lock_contention.bpf.c and sample_filter.bpf.c so perf BPF skeletons built with bpf-gcc pass libbpf relocation and kernel verification. > diff --git a/tools/perf/util/bpf_skel/sample_filter.bpf.c b/tools/perf/ut= il/bpf_skel/sample_filter.bpf.c > index e5666d4c17228..9ddac8e5cd789 100644 > --- a/tools/perf/util/bpf_skel/sample_filter.bpf.c > +++ b/tools/perf/util/bpf_skel/sample_filter.bpf.c [ ... ] > @@ -142,35 +147,44 @@ static inline __u64 perf_get_sample(struct bpf_perf= _event_data_kern *kctx, [ ... ] > if (entry->part =3D=3D 8) { > + union perf_mem_data_src___new src_new =3D { > + .val =3D src.val, > + }; > +#ifdef __clang__ > union perf_mem_data_src___new *data =3D (void *)&kctx->data->data_src; > =20 > - if (__builtin_preserve_field_info(data->mem_hops, BPF_FIELD_EXISTS)) > - return data->mem_hops; > - > - return 0; > + if (!__builtin_preserve_field_info(data->mem_hops, BPF_FIELD_EXISTS)) > + return 0; > +#endif > + return src_new.mem_hops; > } [Severity: Low] Is this #ifdef __clang__ guard around the mem_hops check needed, or should it be documented? Commit 4fc844347ec1 ("perf bpf: Use __builtin_preserve_field_info for GCC compatibility") switched this check to __builtin_preserve_field_info() for GCC, and this patch disables it on bpf-gcc without a comment or mention in the commit message. Because perf_sample_filter() calls bpf_cast_to_kern_ctx() and perf_get_sample() checks data->sample_flags, pre-5.16 kernels lacking mem_hops cannot reach this path. Either drop this check for both compilers or briefly document the #ifdef __clang__ guard here and in the changelog. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203221459.1567= 050-1-irogers@google.com?part=3D1