Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1042434rdb; Fri, 2 Feb 2024 11:35:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDGDpR2M6wpShAVDU7nj1E2adcp4/qBVfr+jTrCrnmSqeGVoHs1eKjQz0jTP6lA4kyKhsE X-Received: by 2002:aa7:d605:0:b0:55f:c110:a0f3 with SMTP id c5-20020aa7d605000000b0055fc110a0f3mr324190edr.18.1706902546577; Fri, 02 Feb 2024 11:35:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706902546; cv=pass; d=google.com; s=arc-20160816; b=gVrdm1QMCi7tbK7MxRVY+5hxH1KQYegbPebdCmjEOgsYNK8pAf+dQwbhMFBtPi3K1z 7+Qm6GjBB7NhXaKScGgTueFPebxByK+GRoyab/nDvvAfbWLES2mbIyLwDPBUOQNil8dl rnrCFVO3v+XncqdPA1ZrflWYsP4qJ2e1nLDhoI5iHKQRyw/A6hBxNPGdR0UIq1JC9hou RVnkN+ZRjR9OUwhW/soSLWs9xxq0VBvLCFy0ICmsBAh+YfTgytqRFIVSII4jSee4DUpL 0qgzz+hMtR8pqIG+1m+/TYhNNt7WTngyUrEcv0stxYCxUnZoJtXAGEYXy5HmyoI7rFV+ PxBg== 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=QqN90ubLd5pBQkGbeDHn3t4n26qdulFCo/dDz3eO9Tw=; fh=Q4F/1147okY09EoNqyg5JBRH36mcxGwY31s3A6GJaF8=; b=TrJCF8pH4WI3PbHpf+N89lhbJVo+KMLrmTeQ69bSV6f1wkyTdGja+JSXoC5KfNXon4 X4DKlUNrT/cHVFfUVYHIJnHhgFrzowMs/sb2eiN+Gihtw7HGAB+cEFgu4sBNiJSs3OZE WKYos2XHv96p7VkMtVvi/H/nCxb2Q2VUiqX+8XRMar4dMvdud+nR/X78xn9mW6F8/eGL vKBOt/pHkMOm5oJ4hKJ0pLNHjhKgJnRf11UeavqHrZV3GcsfnOiFqJ+XMtjklBTkcrhm fmnK3zTsaz/GI+AuPcMjDCQ7CjOuQQmxCE3n0Wm9jMDtxpAT1xPK3TNc9LJkL4+WXHTz 037Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kWwGOR/F"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50486-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50486-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCX4QLrCp1q+6/NIqiSa7fRS5jXNde26Dq5NgYEouAGWCmMpx1yfQ5j8butpE6HZBj4GpDyOrG1Ot7PEla52IOdkoedU8f5ZUeOq901/1w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a14-20020aa7cf0e000000b005600a0d25fbsi299968edy.63.2024.02.02.11.35.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 11:35:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50486-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="kWwGOR/F"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50486-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50486-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 56FA41F283D9 for ; Fri, 2 Feb 2024 19:35:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C3B01F188; Fri, 2 Feb 2024 19:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kWwGOR/F" 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 49BFF15E5D6 for ; Fri, 2 Feb 2024 19:35:38 +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=1706902539; cv=none; b=P2V61PFsUPF5XQ9UGeqZOgJRmAFYia0M9FWyNggFo9TJGYXC2jYgrn4wzYgQCdyvPSLqk3XbmsYzMZ1EDUXnMdae0m7H16jdAVLsbjFcZdpZ+nKs9/w8f6NsUvNQG8JjU7vvIWPLOd4yEWZRCQInZyZOp6g6FvI8aNvgnI1ee8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706902539; c=relaxed/simple; bh=U0zfGUMFO4K2m1luVI9jAWwNldzXk9o9jhSpjNh1xo4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=kprRwjv/U0UZLL85ts+CrdOqhIJlE2fZiK1XxMRIGL3ma813rmWevfajUG0RjaKD4M3M+5OLSafihnA5Ojz8ZTif64vOtX6FM7bs8U4lwCebicXjnEP9hdKSb4X8ehJ1Xk65R+mvhu1iKQcIhdDeBId2B0GNXAKaf1FdICFagZM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kWwGOR/F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3856CC433F1; Fri, 2 Feb 2024 19:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706902538; bh=U0zfGUMFO4K2m1luVI9jAWwNldzXk9o9jhSpjNh1xo4=; h=Date:From:To:Cc:Subject:From; b=kWwGOR/FeQWTnU2aXMjWm+NS9P7nlvduLR/k8z5W2nmBun11QfN3xFQGcAaNE92P+ E2tgoX8/ls7KaD6vlb7kxKXBFyAX7/9HT5r6UqaZvZGJTJimXwx3fjSB6hZ0fO1HET fiq4O+oEss5Upl9O7SuEoygN1YWmZU5yuyPFKuP+FHJfwDhkXvZ6bIVbFF8Ix2PklC LdA+pzeBgPCRzvqRd1Jy9ip5mxKaX5hlLyh8dmG8q+VKaRLucYrLN6xK1OvFsPQ/T5 CxeQ7FfksXR2NBozbztkVenz73DIFSMJAfHkDSgvS6ld+RyKeB8mpVlFzAxCL51Qh3 WT9D8W8aeWlnQ== Date: Fri, 2 Feb 2024 16:35:35 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Adrian Hunter , Ian Rogers , Jiri Olsa , Linux Kernel Mailing List Subject: [PATCH 1/1] perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h Message-ID: 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=us-ascii Content-Disposition: inline If we instead decide to generate vmlinux.h from BTF info, it will be there: $ pahole timespec64 struct timespec64 { time64_t tv_sec; /* 0 8 */ long int tv_nsec; /* 8 8 */ /* size: 16, cachelines: 1, members: 2 */ /* last cacheline: 16 bytes */ }; $ pahole manages to find it from /sys/kernel/btf/vmlinux, that is generated from the kernel types. Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- .../util/bpf_skel/augmented_raw_syscalls.bpf.c | 14 +------------- tools/perf/util/bpf_skel/vmlinux/vmlinux.h | 7 +++++++ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c index baecffbece14fb68..d3b672593c540259 100644 --- a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c +++ b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c @@ -6,6 +6,7 @@ * payload expected by the 'perf trace' beautifiers. */ +#include "vmlinux.h" #include #include #include @@ -22,19 +23,6 @@ #define MAX_CPUS 4096 -// FIXME: These should come from system headers -#ifndef bool -typedef char bool; -#endif -typedef int pid_t; -typedef long long int __s64; -typedef __s64 time64_t; - -struct timespec64 { - time64_t tv_sec; - long int tv_nsec; -}; - /* bpf-output associated map */ struct __augmented_syscalls__ { __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); diff --git a/tools/perf/util/bpf_skel/vmlinux/vmlinux.h b/tools/perf/util/bpf_skel/vmlinux/vmlinux.h index ab84a6e1da5eedb3..e9028235d7717b59 100644 --- a/tools/perf/util/bpf_skel/vmlinux/vmlinux.h +++ b/tools/perf/util/bpf_skel/vmlinux/vmlinux.h @@ -20,6 +20,13 @@ typedef __s64 s64; typedef int pid_t; +typedef __s64 time64_t; + +struct timespec64 { + time64_t tv_sec; + long int tv_nsec; +}; + enum cgroup_subsys_id { perf_event_cgrp_id = 8, }; -- 2.43.0