From patchwork Fri Feb 2 19:35:35 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: 196008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp656831dyc; Fri, 2 Feb 2024 11:35:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeuEQThAhp58rkkbb3h113/1sUQOXMf67kjLDTsQ4aQa634fYJaktY6aqYi/Kzz0HEcitP X-Received: by 2002:a17:906:3059:b0:a37:35de:c71f with SMTP id d25-20020a170906305900b00a3735dec71fmr435373ejd.29.1706902554301; Fri, 02 Feb 2024 11:35:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706902554; cv=pass; d=google.com; s=arc-20160816; b=L1WVayYQSD/OudeR12UJ8rfIbPuAWSnUvInlnNX1laSpRWuf2RRTCd8buCDDudKhJe iBkaOAioh8/mq4/spFeVxEMYQSgp/g1jM2OXO4gpQeJMhyFdV5topsZd2w9RiM/vQCPz dIrGHRgoC1RUkMr3Z245L+vTQOhEsuHbdSC1Kp1x26Ci1nXsCtqJCQA2NHZhnorR0xOI jt3JOGxmpW6SXwAojT9c8VCBru5JNuU3uC8vaqw3G5Z5D5/W9QxaKPWuTayonxuq1sCb BfyUxmt9rzct/ujzGwuO3xpqspUt0NXRdz449swm4MWii7q3wH8RqUg4y6hOXGBYoEJl ybuA== 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=7pSfBT+zwAUkb39tJlu/+XqHR5pP88aQuu1DjZalboY=; b=nb2jA+TqmpSqckdoy14Asi4MYNkFWusZ0W2RJPwByHBwuCa27x9etER7ygCLPeGXNh mWI6h+bfG7kU74l4F+ayWpj1s3QAzf5UPXAtsUBl9Z4SbtWn2jcLFZClf+DyBtEDX5Mw C/gjW2kceEGmBwGBYmbsRwy/pG7Mvk0AvL1+ItbEcL0n7ZzSGH8kbdS3EY4DNljklJoQ 7+ZEKM6xeLdanj3sRE5tYdgrsRVOtiC5s87v4ajPhClfk18RVfXKPlTOhOoB2DLDf0p5 JDT7IyeYudCvvkgc+UqAqV2GVDs9NVuCTfGXwnx8Zk7K84OL0IBiG6WMstddPLm34kq0 ppyg==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50486-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUON00/LZcMyXFn2e20f/C+hV2TggLs5tTmOdscJcUY/3ymGzQUFDJuA9wz84v8io82tbHlcY0+vlMcYMVbfWI1mg55WQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w15-20020a170906130f00b00a36fb4ca3d8si1010049ejb.357.2024.02.02.11.35.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 11:35:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50486-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50486-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E4C111F27F71 for ; Fri, 2 Feb 2024 19:35:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCFB78060B; Fri, 2 Feb 2024 19:35:41 +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-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789817052609413298 X-GMAIL-MSGID: 1789817052609413298 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 Acked-by: Namhyung Kim --- .../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, };