Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp25845lqb; Fri, 15 Mar 2024 13:54:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXyUHJOu5bl1jYyziT6Vcs22rz3dejuNPNdIduMWDVW0WiJ2isIVTHX7WQ11DDNfd5TuGiBA56636wZ7zWnwdnEq4ZY85Z2K63QctQvA== X-Google-Smtp-Source: AGHT+IGvEo7SvQflTI66KmaAjIKyU/3NolpD+Qb8aBiNOpc0SLeMvat1htU3ZczaIa8yeBl/hPCl X-Received: by 2002:a0c:bf4f:0:b0:691:6cc8:145c with SMTP id b15-20020a0cbf4f000000b006916cc8145cmr3802249qvj.53.1710536041974; Fri, 15 Mar 2024 13:54:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710536041; cv=pass; d=google.com; s=arc-20160816; b=bPL2F3OBBAVPV7nTk/RtmfKtJXGAUPdxDD7BOlMiNo2LZmn2ZiiwaxH0UZUu1YzZu0 Tru7gQkyeI6P8MYHMg8tyhqOCDwjbeS2kOP/e51/nRGwAUt6411ym+mRSr8JWPFYV4yM 03qwBGd2Ng4WdHVn5wQ531dGb7WGUlQZLHggW3qK6xuuwnJ5mqH9w9LOCRuGzAzhWnRa iR//1m3dfCIkEY1ibkSntzcwGxWchPOsdTYgTggc6CxHPjwpRYXBC2RtYldMPBEIT6TK A1PgJ7hJyrt0SIgK1t1dga23fQ2T3RWEHanDgHfkmJd9wvTUloxAfT64Rn88/0O5vL/7 B9Xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0h5+xeXP0D1zyykF56y/vwlwif7JBvx6cNWhPTSywJg=; fh=xqBA6XU1fuyTFblptcc0c2Nkny7AEuI4qyn8l5YDn6E=; b=0qE7OixrjcodgTA9rEkl90RVxSg5Y+jJ9Jld1pbny4pH6Wa862jhMM35v3B5XLuxgI Ksc/MmS5nlXV7xRsSnJNjws13EbwiwggCIyOqOwfX/Kh+AYveYcbCFY1cuH1nTK/Q8Xg tQbHIhLPZ2hj0EuUgSGkDPBEbayWh1qBs8jDsnCMirkGCKyy4kyilkJ3EWCGNcxZP1F6 5RqUNeXf5kZ0OmtM/SkDNGZKAyi7mevDaExWMOdP4NpMDffncOhwYSJyCTXsq17jAfdy qtHMNp5mOnFxPkI/g+SR0cjN6ddSi3WiC/LQiM8otTHpxZXhbiml5j8aFvAUdL2JPlmk DGhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Th2Jescx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-104912-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q3-20020a056214194300b0068f2ffd3a56si3868004qvk.588.2024.03.15.13.54.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 13:54:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104912-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Th2Jescx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-104912-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104912-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 97A3B1C231D1 for ; Fri, 15 Mar 2024 20:54:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 433D554BFA; Fri, 15 Mar 2024 20:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Th2Jescx" 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 2E9FE5DF1B; Fri, 15 Mar 2024 20:48:47 +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=1710535728; cv=none; b=O8z+wCbIH9+PZGElEaXJ5ytJ2+kddvqALhJVeuiTyH3O3mb0YtccMCNq1QriGJP9WUIbOinDqYHzedJK68CHTjayKnYj49pc8s7TjyYJBJ8jUjYW0qzQhbK+edwp2QpfFMzPAvLlOvimu9h+332iFiyoEZseJhv50u+FKOQL4O8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710535728; c=relaxed/simple; bh=sGWDJZ0P89LGVOcIO9kQVxIBj15Yndvpht5SzGy8FWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZNdCWufbFa/GJ6JWNhN/lzKttWxeRIMgI5TLaEzGG+kVfeP5aaCGE09ZBR09PyHDwybv2DWRiIXFvzY+UUq/ruwjrrxBAIXRCXwQnWD6X5RDInfZrh0WErgsiVbza2XicX65p3mryHq8Wp7gA2dKYlKI7q/Xx+ovZDeKa+jpwlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Th2Jescx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE53AC43394; Fri, 15 Mar 2024 20:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710535727; bh=sGWDJZ0P89LGVOcIO9kQVxIBj15Yndvpht5SzGy8FWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Th2JescxUC5rkugLTby6T+OAHZ50YGKM6lM9f0XtpYB0LEaLuFlVlMcsOD8ljayO9 NVakU+9CrmchQQrPF3Bf/iMLl7KPQ5gvizAxfVVZwtlxnPCOejEWKxciBNobMXHUq5 2eWbxMJS19aBFiQh/aZAjqoYy3YPHQSliDG4ZXMJooRwOxvFkHmJgGQUQ8P0vaj/US /NXbbak2OFa646LdHl47sovbcjPnhFyWXnFvEPqWzWzIoNt/j6APqhJpDhwMGpinpH hwWTGGoL2vN/beh50/yxnlSXSmfuyoPdyb2eAchKV+jgs58W4UyanylOhTXxz0m6Ik +luRHV/BF26yg== From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo Subject: [PATCH 2/5] perf beauty: Move prctl.h files (uapi/linux and x86's) copy out of the directory used to build perf Date: Fri, 15 Mar 2024 17:48:32 -0300 Message-ID: <20240315204835.748716-3-acme@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240315204835.748716-1-acme@kernel.org> References: <20240315204835.748716-1-acme@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnaldo Carvalho de Melo It is used only to generate string tables, not to build perf, so move it to the tools/perf/trace/beauty/{include,arch}/ hierarchies, that is used just for scraping. This is a something that should've have happened, as happened with the linux/socket.h scrapper, do it now as Ian suggested while doing an audit/refactor session in the headers used by perf. No other tools/ living code uses it, just coming from either 'make install_headers' or from the system /usr/include/ directory. Suggested-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/CAP-5=fWZVrpRufO4w-S4EcSi9STXcTAN2ERLwTSN7yrSSA-otQ@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.perf | 11 +++++------ tools/perf/check-headers.sh | 4 ++-- .../trace/beauty}/arch/x86/include/uapi/asm/prctl.h | 0 .../trace/beauty}/include/uapi/linux/prctl.h | 0 tools/perf/trace/beauty/prctl_option.sh | 6 +++--- tools/perf/trace/beauty/x86_arch_prctl.sh | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) rename tools/{ => perf/trace/beauty}/arch/x86/include/uapi/asm/prctl.h (100%) rename tools/{ => perf/trace/beauty}/include/uapi/linux/prctl.h (100%) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index c75342b21089fc6f..b36c0c68c346d1ac 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -475,11 +475,11 @@ beauty_linux_dir := $(srctree)/tools/perf/trace/beauty/include/linux/ beauty_uapi_linux_dir := $(srctree)/tools/perf/trace/beauty/include/uapi/linux/ beauty_uapi_sound_dir := $(srctree)/tools/perf/trace/beauty/include/uapi/sound/ beauty_arch_asm_dir := $(srctree)/tools/perf/trace/beauty/arch/x86/include/asm/ +beauty_x86_arch_asm_uapi_dir := $(srctree)/tools/perf/trace/beauty/arch/x86/include/uapi/asm/ linux_uapi_dir := $(srctree)/tools/include/uapi/linux asm_generic_uapi_dir := $(srctree)/tools/include/uapi/asm-generic arch_asm_uapi_dir := $(srctree)/tools/arch/$(SRCARCH)/include/uapi/asm/ -x86_arch_asm_uapi_dir := $(srctree)/tools/arch/x86/include/uapi/asm/ x86_arch_asm_dir := $(srctree)/tools/arch/x86/include/asm/ beauty_outdir := $(OUTPUT)trace/beauty/generated @@ -617,11 +617,10 @@ $(mmap_prot_array): $(asm_generic_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman- $(Q)$(SHELL) '$(mmap_prot_tbl)' $(asm_generic_uapi_dir) $(arch_asm_uapi_dir) > $@ prctl_option_array := $(beauty_outdir)/prctl_option_array.c -prctl_hdr_dir := $(srctree)/tools/include/uapi/linux/ prctl_option_tbl := $(srctree)/tools/perf/trace/beauty/prctl_option.sh -$(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl) - $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@ +$(prctl_option_array): $(beauty_uapi_linux_dir)/prctl.h $(prctl_option_tbl) + $(Q)$(SHELL) '$(prctl_option_tbl)' $(beauty_uapi_linux_dir) > $@ usbdevfs_ioctl_array := $(beauty_ioctl_outdir)/usbdevfs_ioctl_array.c usbdevfs_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/usbdevfs_ioctl.sh @@ -632,8 +631,8 @@ $(usbdevfs_ioctl_array): $(beauty_uapi_linux_dir)/usbdevice_fs.h $(usbdevfs_ioct x86_arch_prctl_code_array := $(beauty_outdir)/x86_arch_prctl_code_array.c x86_arch_prctl_code_tbl := $(srctree)/tools/perf/trace/beauty/x86_arch_prctl.sh -$(x86_arch_prctl_code_array): $(x86_arch_asm_uapi_dir)/prctl.h $(x86_arch_prctl_code_tbl) - $(Q)$(SHELL) '$(x86_arch_prctl_code_tbl)' $(x86_arch_asm_uapi_dir) > $@ +$(x86_arch_prctl_code_array): $(beauty_x86_arch_asm_uapi_dir)/prctl.h $(x86_arch_prctl_code_tbl) + $(Q)$(SHELL) '$(x86_arch_prctl_code_tbl)' $(beauty_x86_arch_asm_uapi_dir) > $@ x86_arch_irq_vectors_array := $(beauty_outdir)/x86_arch_irq_vectors_array.c x86_arch_irq_vectors_tbl := $(srctree)/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index b35eba5e99c8d91f..03d00110a48fcb9a 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -17,7 +17,6 @@ FILES=( "include/uapi/linux/in.h" "include/uapi/linux/openat2.h" "include/uapi/linux/perf_event.h" - "include/uapi/linux/prctl.h" "include/uapi/linux/sched.h" "include/uapi/linux/seccomp.h" "include/uapi/linux/stat.h" @@ -35,7 +34,6 @@ FILES=( "arch/x86/include/asm/inat_types.h" "arch/x86/include/asm/emulate_prefix.h" "arch/x86/include/asm/msr-index.h" - "arch/x86/include/uapi/asm/prctl.h" "arch/x86/lib/x86-opcode-map.txt" "arch/x86/tools/gen-insn-attr-x86.awk" "arch/arm/include/uapi/asm/perf_regs.h" @@ -93,9 +91,11 @@ SYNC_CHECK_FILES=( declare -a BEAUTY_FILES BEAUTY_FILES=( "arch/x86/include/asm/irq_vectors.h" + "arch/x86/include/uapi/asm/prctl.h" "include/linux/socket.h" "include/uapi/linux/fs.h" "include/uapi/linux/mount.h" + "include/uapi/linux/prctl.h" "include/uapi/linux/usbdevice_fs.h" "include/uapi/sound/asound.h" ) diff --git a/tools/arch/x86/include/uapi/asm/prctl.h b/tools/perf/trace/beauty/arch/x86/include/uapi/asm/prctl.h similarity index 100% rename from tools/arch/x86/include/uapi/asm/prctl.h rename to tools/perf/trace/beauty/arch/x86/include/uapi/asm/prctl.h diff --git a/tools/include/uapi/linux/prctl.h b/tools/perf/trace/beauty/include/uapi/linux/prctl.h similarity index 100% rename from tools/include/uapi/linux/prctl.h rename to tools/perf/trace/beauty/include/uapi/linux/prctl.h diff --git a/tools/perf/trace/beauty/prctl_option.sh b/tools/perf/trace/beauty/prctl_option.sh index 9455d9672f140d13..e049f5e9c01116fb 100755 --- a/tools/perf/trace/beauty/prctl_option.sh +++ b/tools/perf/trace/beauty/prctl_option.sh @@ -1,18 +1,18 @@ #!/bin/sh # SPDX-License-Identifier: LGPL-2.1 -[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ +[ $# -eq 1 ] && beauty_uapi_linux_dir=$1 || beauty_uapi_linux_dir=tools/perf/trace/beauty/include/uapi/linux/ printf "static const char *prctl_options[] = {\n" regex='^#define[[:space:]]{1}PR_(\w+)[[:space:]]*([[:xdigit:]]+)([[:space:]]*/.*)?$' -grep -E $regex ${header_dir}/prctl.h | grep -v PR_SET_PTRACER | \ +grep -E $regex ${beauty_uapi_linux_dir}/prctl.h | grep -v PR_SET_PTRACER | \ sed -E "s%$regex%\2 \1%g" | \ sort -n | xargs printf "\t[%s] = \"%s\",\n" printf "};\n" printf "static const char *prctl_set_mm_options[] = {\n" regex='^#[[:space:]]+define[[:space:]]+PR_SET_MM_(\w+)[[:space:]]*([[:digit:]]+).*' -grep -E $regex ${header_dir}/prctl.h | \ +grep -E $regex ${beauty_uapi_linux_dir}/prctl.h | \ sed -r "s/$regex/\2 \1/g" | \ sort -n | xargs printf "\t[%s] = \"%s\",\n" printf "};\n" diff --git a/tools/perf/trace/beauty/x86_arch_prctl.sh b/tools/perf/trace/beauty/x86_arch_prctl.sh index b1596df251f0aa9f..b714ffa3cb7a4ed8 100755 --- a/tools/perf/trace/beauty/x86_arch_prctl.sh +++ b/tools/perf/trace/beauty/x86_arch_prctl.sh @@ -2,9 +2,9 @@ # Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo # SPDX-License-Identifier: LGPL-2.1 -[ $# -eq 1 ] && x86_header_dir=$1 || x86_header_dir=tools/arch/x86/include/uapi/asm/ +[ $# -eq 1 ] && beauty_x86_arch_asm_uapi_dir=$1 || beauty_x86_arch_asm_uapi_dir=tools/perf/trace/beauty/arch/x86/include/uapi/asm/ -prctl_arch_header=${x86_header_dir}/prctl.h +prctl_arch_header=${beauty_x86_arch_asm_uapi_dir}/prctl.h print_range () { idx=$1 -- 2.43.2