From patchwork Sat Feb 24 15:47:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 205905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1207234dyb; Sat, 24 Feb 2024 07:48:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXmJ0S6kyuoXkf22HT1H63jEE1VY/o4LHNMeiXzAyy9dcpjw2pjJZwRtiq0jiKvGClDom2nnvuRVk7XTbuhI7lMgUsTGg== X-Google-Smtp-Source: AGHT+IEGsGqn8FunJZJ7LiYkI7zFNeKNzUQgM3eBC7oYL1db4eHYo0xRlDwiWk8VVMwcJfXWk1/E X-Received: by 2002:a17:903:2312:b0:1dc:89fe:570f with SMTP id d18-20020a170903231200b001dc89fe570fmr1235422plh.68.1708789695703; Sat, 24 Feb 2024 07:48:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708789695; cv=pass; d=google.com; s=arc-20160816; b=uPWb5V6voNAgPmL9/lg6FsG0bsCUJ21BditrowXqvk7oK9NAFaUvEW8x7OGxE/3XeW UE5UzO70fa+nm+/IIZhqUDvbHQENVkLC3Yq+orlDVloLBdZ41qJBtF5dxoEEXCOYyXu4 Gv6gjv7q1BGhAx2wVATBZE0Aars96kjZkoITF+1yr//RDmA5+QRhg5CO2yz9Y7RWwFAQ hLzE+hI6TsYn37Z7lVtGNMHaKarItDebxtMdUdtxXTdP7k0zl8IREwkqqZzwIr8dX2oU SNqlB4YJFSDrG3ZVB2mu2sy7hJaNNc0U6tTVlEulLGDyPztn8830GD6TDm4n+xDrlFos 5LkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=2G+7RsybiI1/ZLJ6JKFhTlJXoYJHwdS9+N8HRIPBni0=; fh=kbiKnJa7ZygYVf04YkHeXOerjQrxJ/7P8bOPq92JQYg=; b=sQOX8dMwVLiNjkvHBQfwIEYmShfS8d7xmNiFadwqWKXo93pDFrSdERsPKfYXpvJbrv DZj9SWtcoy9SZEEkf3rUmBIAmu0z1FGwiwtTsR9ECHNslb2LCio6ujcsXBTa2e/CFQNo jrhYdACDlMqa9oZ4C61tIXIMzls5N+yTP9GRjQYm7eYZSpHxjP9ACbI8RiaiaW8JlaNw QCd9FSN1n1e7BpMtg5ae1wPeTpaE9Qmo7AndAXm/rakCzEJY/6euZtKUueecQRjCFf22 TiSBURmINRdwCPld++63iU0rkx3+HXOEmuY/mKWDirC2e6n02c2wTm/FchIpIvEFhWpW 3ejQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jGRs+thD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79726-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79726-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z17-20020a170902ccd100b001dc8af2e62bsi410600ple.541.2024.02.24.07.48.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 07:48:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79726-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jGRs+thD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79726-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79726-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 856C1283356 for ; Sat, 24 Feb 2024 15:48:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9904047A7A; Sat, 24 Feb 2024 15:48:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jGRs+thD" 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 EF91417E9; Sat, 24 Feb 2024 15:48:01 +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=1708789682; cv=none; b=lKt04wTMNV48ZFEy5Le4rnZe4MSV8xuxl724WAA69jujgLvFjXDpPBE+EXXtn7SARWFmVEYwrEt3hqa5XfGtcukbP957VJAy7Ioc416JtTniorBi6qEH6N5XWcm9rfGt4eY71KDKzHbcMXm9HenOxQS1BWEaRD1pbBjpAqV1xEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708789682; c=relaxed/simple; bh=AgfceBaBph7sVUR2Dyn5Iudnt1yeQy1TvBMVEfuCNOg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=mdgD7E6H9eFC1yhwIiQao3sVT03DghTc58OfHEouJKYSfbkNjXG+3PpZbWo2nAtOsqyGl3ZLpauT+jboLFy7aFdUTb7vvwoGOZ0HyK8lHjZtJszNFiS3ukfUYhiM/yd3AGuiglBtNCzjAxyRGUuaeMsOTEtFMOBWq+SdSzApKf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jGRs+thD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1A62C433F1; Sat, 24 Feb 2024 15:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708789681; bh=AgfceBaBph7sVUR2Dyn5Iudnt1yeQy1TvBMVEfuCNOg=; h=Date:From:To:Cc:Subject:From; b=jGRs+thDgYc2Z/T7N/Fu8f+hNqNixXrAff/1MLj1FSVAkW91gg/HPMawZL5VG0h9a oeb2IPch8CcZI8haaHwOrPyOGcfTTmmCHjdys8lQR6F9hs6SMj+8s3wTTADXg7wFNq lV7Bt4Mgk4KheisZz+8YsA5I5jQbCYXcPLfKpqTtTddSsQOXSq9rOPCHcpaKnRR3Fh 6nvIOJgJ080M5x0xaLhjdWUEYuJo9vhR5+GRioqL5oBM66cLAcnD2beU4blxPhqoPh 9TL6cgxII40I7E7IDpi5jawHBZMvgFQD8UYfEJaeAVmRd7zbImC8RmXnWdzwA0pDC8 amwspg7nh49Ew== Date: Sat, 24 Feb 2024 12:47:57 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Stephen Rothwell , Ian Rogers , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791795864179462052 X-GMAIL-MSGID: 1791795864179462052 When building BPF skels perf will, by default, install a minimalistic vmlinux.h file with the types needed by the BPF skels in tools/perf/util/bpf_skel/ in its build directory. When 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h") was added, a type used in the augmented_raw_syscalls BPF skel, 'struct timespec64' was not found when building from a pre-existing build directory, because the vmlinux.h there didn't contain that type, ending up with this error, spotted in linux-next: 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); | ^ util/bpf_skel/augmented_raw_syscalls.bpf.c:350:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64' 350 | __u32 size = sizeof(struct timespec64); | ^ ~~~~~~~~~~~~~~~~~~~ util/bpf_skel/augmented_raw_syscalls.bpf.c:350:29: note: forward declaration of 'struct timespec64' 350 | __u32 size = sizeof(struct timespec64); | ^ 2 errors generated. make[2]: *** [Makefile.perf:1158: /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [Makefile.perf:261: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf' So add a Makefile dependency (Namhyung's suggestion) to make sure that the new tools/perf/util/bpf_skel/vmlinux/vmlinux.h minimal vmlinux is updated in the build directory, providing the moved 'struct timespec64' type. Fixes: 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h") Cc: Ian Rogers Cc: Namhyung Kim Reported-by: Stephen Rothwell Link: https://lore.kernel.org/lkml/CAM9d7ciaj80QZL0AS_T2HNBdMOyS-j1wBHQSYs=U3kHQimY1mQ@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo Reviewed-by: Ian Rogers --- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 3cecd51b239707ba..33621114135ee2c8 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