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=1796519665; b=uRkSk9h3dk+oxVQMFJu29Es0Tm+726kCp4op7HpYyPHTb/z8295UrFNwtpsXGLU6UtMO 7gG9DMf7cxd9iLCjKmCBIZvd2uQaSwLUt8liR95ON8BfbBeMV35AYyqRPskxmZxab8U4X nLojU4ZWuh4PGHkJTLP8dVMms/Sgsabqz2TTOhx41rNOcpjrTW9UuZk7THOLWrJoMO4cT L35Koh1ZkIfyjbEufwmLsjfEaV9v2zDgSpUpQkjp8rJ0zGKO+PfPTnpwl1F02ZzjloxR2 toXVKsll/lH+lJXBJCg7aAAswWn7rMi2EOan9GoWpvspUE/YL0Z1jnxLV7//teP13Tg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796519665; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=8EaDkfjLxfyuDMW36dO6hzDPHdHhbcB+HrC3H7rmFUk=; b=PMv+Rc6ttJFfxzDZWserkLDYOeI2IUtyYe97YuhF/KRvU9WZhap8UTgQay/41EpJwZBw NpJyNKh8MVPDXBLKXTExDR8wsirI8yGks94ExyLHoH0o/frcslqKQV6SorPwEq1wV5272 rltJNRicN2F/84rk2YsmKHJa7n+ztbZlXhmzG45muDG6/jf41O3MKssgZ6VavxeySRd6P jicgPReEv5tjgSZk9qx34znjyFgDOs/kqdKnqzAaXOhdwfBVmT+TTnPrLPuYwaNdH3bpM CleWcFCYPlkUjGXPz7XfQLktvRnrlw+tPFSuMqsbdgcioTw5C0R8sYMo10XhUetrVnQ== 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=NkwgpzbY; 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 B7DAD606A31F; Sun, 6 Dec 2026 01:14:25 +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=NkwgpzbY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F5361F0092B; Sun, 6 Dec 2026 01:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796519665; bh=8EaDkfjLxfyuDMW36dO6hzDPHdHhbcB+HrC3H7rmFUk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=NkwgpzbYOENfzd+lwQJlTSQ6jZzPvPJwM/hkE1LyZOw5eptnI5XPLff9yFQduZwrA Z/R35sWoWHJ9CVKRKFKdW6zg97xNwOGDrIQYmn5gPfjyFaojWJBIALRdHMXGILOf2v sICy9XmUoQ96Dr/tp/NikuHVMUNWBXtlU0iw1vxp8hDXxlf6S9cVZMpaBEa/SL0zjd SGArlySWeVMJc2K8DAigGzjqBC1BBDaxz285XlklGKaVSM7Q5thZo7e3x4a7vaKsQE R4xUJ10E1GskVgwQwE0GwqptFZRyI1rDsIMgAV0wadEAb8PDD55JeInGXMiwLQtbc7 Q4hpYRV8rW/Pw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3] 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: <20261206010021.2830750-1-irogers@google.com> References: <20261206010021.2830750-1-irogers@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 01:14:24 +0000 X-Mailing-List: bpf@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: unresolved maintainer objection to ten bpf-gcc workaround flags -- commit 01cc9ea53169f37881bab27710483ce98ca56d3e Author: Ian Rogers perf build: Fix bpf-gcc skeleton codegen and CO-RE relocations This commit disables ten GCC optimization passes and adds -std=3Dgnu11 for bpf-gcc builds in tools/perf/bpf_skel.mak, and updates lock_contention.bpf.c and sample_filter.bpf.c to emit CO-RE relocations accepted by libbpf and the kernel verifier. > diff --git a/tools/perf/bpf_skel.mak b/tools/perf/bpf_skel.mak > index 7b7edf5065091..ea158fb47b848 100644 > --- a/tools/perf/bpf_skel.mak > +++ b/tools/perf/bpf_skel.mak > @@ -32,7 +32,25 @@ ifeq ($(CONFIG_PERF_BPF_SKEL_BPF_GCC),y) > QUIET_BPF_CC =3D $(QUIET_BPF_GCC) > IS_LITTLE_ENDIAN :=3D $(shell $(CC) -dM -E - grep 'define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__') > - BPF_OPTIONS =3D -Wall -mcpu=3Dv3 -fno-ident -DBPF_NO_PRESERVE_ACCESS_I= NDEX -Wno-attributes \ > + # Disable GCC passes that emit BPF code rejected by libbpf or the veri= fier: > + # - -fno-ivopts: keep scalar loop counters instead of pointer-equality > + # latches (PTR_TO_MAP_VALUE / PTR_TO_STACK) that is_branch_taken() c= annot > + # bound. > + # - -fno-ipa-sra -fno-partial-inlining: avoid .isra/.part subprogram c= lones > + # that omit .BTF.ext func_info records. > + # - -fno-tree-loop-im -fno-move-loop-invariants: keep CO-RE relocations > + # inside bpf_core_field_exists() guards instead of hoisting them int= o loop > + # preheaders where libbpf poisons missing-field relocations. > + # - -fno-if-conversion -fno-if-conversion2 -fno-ssa-phiopt > + # -fno-schedule-insns -fno-schedule-insns2: prevent converting point= er > + # NULL checks into branchless (-ptr | ptr) >> 63 pointer ALU or hois= ting > + # pointer arithmetic above NULL / bounds checks. > + BPF_OPTIONS =3D -Wall -mcpu=3Dv3 -fno-ident \ > + -fno-ivopts -fno-ipa-sra -fno-partial-inlining \ > + -fno-tree-loop-im -fno-move-loop-invariants \ > + -fno-if-conversion -fno-if-conversion2 -fno-ssa-phiopt \ > + -fno-schedule-insns -fno-schedule-insns2 \ > + -DBPF_NO_PRESERVE_ACCESS_INDEX -Wno-attributes \ > -D__TARGET_ARCH_$(SRCARCH) $(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-m= big-endian) > BPF_SYS_INCLUDES =3D $(call get_sys_includes,$(CC),) > else [Severity: Low] As reported by Namhyung Kim on v2 [1], carrying ten GCC optimization-pass disabling flags in BPF_OPTIONS raises maintainability concerns while tools/perf/Makefile.config still keeps bpf-gcc preferred by default on GCC builds (prefer_bpf_gcc :=3D $(CC_NO_CLANG)). Unlike test_progs-bpf_gcc in tools/testing/selftests/bpf/Makefile, which treats bpf-gcc as an optional flavor without global pass-disabling flags, this disables ivopts, ipa-sra, partial-inlining, loop invariant motion, if-conversion, phiopt, and instruction scheduling for all perf skeletons. Should bpf-gcc be made opt-in until GCC fixes these codegen issues instead of carrying these flags? [1] https://lore.kernel.org/r/axO9dKDMajQkON36@google.com --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206010021.2830= 750-1-irogers@google.com?part=3D1