Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp439613rbb; Sat, 24 Feb 2024 07:05:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIYeGTcC7mdM5Jzuees1YHSngdeL9UicZCbfBx4dqFqCCkq8HpGP/1xOzZ3DdnrccUTIi5co4+4alHtd6wUZ3F0fjEZHZts/ZA/tk9vw== X-Google-Smtp-Source: AGHT+IFKI/oL1VKYl67H/w4Z9dak2COD+DtZPkFXA8oTma5J34hPJWuHH6nvcCpZ9Eo5TEf2pZFU X-Received: by 2002:a17:906:7245:b0:a3e:4d7c:9ce1 with SMTP id n5-20020a170906724500b00a3e4d7c9ce1mr2208335ejk.21.1708787136990; Sat, 24 Feb 2024 07:05:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708787136; cv=pass; d=google.com; s=arc-20160816; b=LcmnR8s9ZfUKL+44uwHYBTSetF0lsVwlTfELY63NyYLnq220tS4stc+JvXCUFA+2TW 2/1XmNvAoYmaEKCSTn7BJN+EYaPRacZtjAqnqLa572bcuxcUpWPs+edrpbNDFoMjrSJW 5E3wEEQdU2GxIksho5AU0fruc+QLY0ZZrboLC8umA/H3MH9mMYPx+eVywyWj17Zh/ExR wGpWL5hU4TORJAisyCL5U0WpHqQ84Sn6m7d65ayp9usEDBtzLr8OHVDDY2C2Hp+gjFF4 z0TyhNAjrePi/tBUCuGOWydhRIRdxeD9a5EHJLJwtRF4N4iLtPUUZkOq2QUnlNMT7ln4 NpmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M8ZM88512ouQccYtiGSC1ovO2+cEaVAFh9vsbJB8CDA=; fh=O6tSxt+DGDnTUB1TZfPSCRBACQMFpcRl27X/gdeSIKg=; b=iaybHITCWArKkKRL1F1T9vRT+K+UoB/NYbJKff7IoEZOnXDShA6UC79gWMawP5umID zGq+n3sdzS5GfhTHxNwfSI21UIlxb/opS3Dxl+sUf+o9YP5zmp40hnoDMA75XMaVik+3 LMp3NAElZWLOIHixAz8YeMODdxGhsysfJbFN7qVZuQbo5rpIVSv9jMMWifFNtyKQmB/V 3a42dzQVt6X9g7v0/aVJAGVH2MjRdVcaV28IKuLQgq8/+We+5+z8VuGFHoqwzXRmP3aL R8NH9KfmNHVGAx2R4WTXxu8SamzF0Aw28nbn5AaNrJ6A+1q6m0XDPaCX6EKGNaYcdMx+ w5YA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dJXs5p2l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79711-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gb35-20020a170907962300b00a430b3193dcsi89053ejc.663.2024.02.24.07.05.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 07:05:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dJXs5p2l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79711-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 8FAA11F22C5C for ; Sat, 24 Feb 2024 15:05:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C45B45C15; Sat, 24 Feb 2024 15:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dJXs5p2l" 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 596BE24B54; Sat, 24 Feb 2024 15:05:28 +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=1708787128; cv=none; b=bCcOB+Y3mB7qSwAxeDDMhvaFTHxveXPye6I8tkpbt/ihGX91W594ijitTcuJ6aif0bz9qILEzFVpHDP+6bpy33gqlFGuo/soa0asoo+WgBMmDlaFkEc3gDKJeKdOLd1Lfwnz6jXsWLYmOvvQ6Ec7hUfVEEfC0ijHVZC5YqG/FQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708787128; c=relaxed/simple; bh=oC+819alsBsCF37dz60vdeaMt67VeJuCkAD2RtMidss=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DsXs3UyARUx625UQkJPgcIZkla32mzgbckZjmi8qN/To/UF8haKWmXTn7zo+UKKVIRi8I5yIHL7bFJ7R4qLIbtOT8MfiRaEHScQBxhvlGf9Nuse1xcYsRapG2HBBMe7lEqzCNPYWQcX15HcAMzIk5ZaQr6Lihmty8NrqyppIAKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dJXs5p2l; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC64BC433F1; Sat, 24 Feb 2024 15:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708787128; bh=oC+819alsBsCF37dz60vdeaMt67VeJuCkAD2RtMidss=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dJXs5p2lPsA++XKQWmL0YkfkWSlzoIOywXQchJiIrYKG90l0zDG4Mwr2IoHpKkXs/ gfV2+PBDH6R/g4nceJSBYotXoOW/Cxa+PGM0zL5lc1o1qJ71X7c7jL8Jnef7Pw9+8d vi6jhwHaPPkwFfNWWrQxcsEirCdKv3Qt6q+l7w9dP5pVTLv6WL+AnXQ6LfRrjN/7z9 T9L66jdVhMbPvUjN1/4ePXzCYrkeUvZc6lczj7S1i6Bd/rSQ/StNajCaDFgZrwa0L7 5uguXiiQMtbNbFFHnGyQhTHGwiyp4di8ozhvDxVoZzjJG7BT5mkSGZsFH4RFtNY5mx ESNnSJoxNjv0g== Date: Sat, 24 Feb 2024 12:05:24 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Stephen Rothwell , Ian Rogers , Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: [solved] Re: linux-next: build failure after merge of the perf tree Message-ID: References: <20240222100656.0a644254@canb.auug.org.au> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Feb 23, 2024 at 12:34:40PM -0800, Namhyung Kim wrote: > Hi Arnaldo, > > On Fri, Feb 23, 2024 at 12:11 PM Arnaldo Carvalho de Melo > wrote: > > > > On Fri, Feb 23, 2024 at 04:50:47PM -0300, Arnaldo Carvalho de Melo wrote: > > > On Thu, Feb 22, 2024 at 10:06:56AM +1100, Stephen Rothwell wrote: > > > > Hi all, > > > > > > > > After merging the perf tree, today's linux-next build (native perf) > > > > failed like this: > > > > > > > > util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64' > > > > __u32 size = sizeof(struct timespec64); > > > > ^ ~~~~~~~~~~~~~~~~~~~ > > > > util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64' > > > > __u32 size = sizeof(struct timespec64); > > > > ^ > > > > > > > > Caused by commit > > > > > > > > 29d16de26df1 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h") > > > > > > > > This is a ppc64 le build. > > > > > > > > I have used the perf tree from next-20240221 for today. > > > > > > Ok, finally I managed to secure a ppc64 machine to test this and > > > sometimes I reproduce just like you reported, but sometimes I can't do > > > it, didn't manage to isolate what is that makes it fail sometimes, make > > > -C tools/perf clean, nuking the O= target directory, etc, when I > > > reproduce it: > > > > So I think I see the problem, I now left the build directory with a > > previous build from torvalds/master, then switched to the > > perf-tools-branch and tried to build from there, without first removing > > the old build, it fails: > > > > CLANG /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o > > util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64' > > 329 | __u32 size = sizeof(struct timespec64); > > | ^ ~~~~~~~~~~~~~~~~~~~ > > util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64' > > 329 | __u32 size = sizeof(struct timespec64); > > | ^ > > 1 error generated. > > make[2]: *** [Makefile.perf:1161: /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o] Error 1 > > make[1]: *** [Makefile.perf:264: sub-make] Error 2 > > > > > > Because it will use what was installed before in the build dir: > > > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ ls -la /tmp/build/perf-tools-next/util/bpf_skel/vmlinux.h > > -rw-r--r--. 1 acme acme 4319 Feb 23 14:59 /tmp/build/perf-tools-next/util/bpf_skel/vmlinux.h > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ > > > > And that one doesn't have 'struct timespec64': > > > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ grep timespec64 /tmp/build/perf-tools-next/util/bpf_skel/vmlinux.h > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ > > > > If I remove that directory contents: > > > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ rm -rf /tmp/build/perf-tools-next/ > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ mkdir /tmp/build/perf-tools-next/ > > [acme@ibm-p9z-16-lp5 perf-tools-next]$ > > > > And then try to build again: > > > > make -k O=/tmp/build/perf-tools-next/ -C tools/perf install-bin > > > > It works. > > > > I reproduced the problem on x86_64, so, on this transition period, the > > problem happens, probably we need to robustify the installation of > > tools/perf/util/bpf_skel/vmlinux/vmlinux.h in the O= target directory, > > but if you just make sure the build directory is clean before trying to > > build it, this time, it should work, wdyt? > > Can we add a dependency to the minimal vmlinux.h? That fixes it, I'll submit a formal patch - Arnaldo > Thanks, > Namhyung > > ---8<--- > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf > index 3cecd51b2397..33621114135e 100644 > --- a/tools/perf/Makefile.perf > +++ b/tools/perf/Makefile.perf > @@ -1147,7 +1147,7 @@ ifeq ($(VMLINUX_H),) > endif > endif > > -$(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) > +$(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) $(VMLINUX_H) > ifeq ($(VMLINUX_H),) > $(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ > else