From patchwork Fri Nov 8 23:46:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13869112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F3F1D64076 for ; Sat, 9 Nov 2024 00:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cxhtG6inqw7xVhW8lmLCzQGuYG7i0WKxzoXsaeSddKQ=; b=OJDA8L49g38nNe bJZvO+DaCMLLijaeuVTywxyEBrxWSCra0laxj3AX6PP9U1ZxWTTEzgRY0cNpIXLbM1Q+EFxCUnDPJ addVs+N1OO+jRhcaR4MR2DcEgbtnPP2N/eSzz88kfDQSgromjkerZmwXQTFZzdtVHWRO9yqrIdeVO zBJmdSJDMfucsdSRfgtVclD66oOCLo6yeMALKslrnaedVOP2kpyw5LLQEcGqAKyK0Y45V8+RO/bzI ro5OwSF7+HeCICB5u8bf6niRPB3ulRAZzQkDpeyeh9E7ExQt4/OUmo4RIKLBXdRIVw+M9ozrf0B0x gep9nPZ/j1CdVzR8exCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t9ZC6-0000000CKDc-3NCC; Sat, 09 Nov 2024 00:19:14 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t9Ygn-0000000CFJu-3hio for linux-riscv@lists.infradead.org; Fri, 08 Nov 2024 23:46:55 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e30cf121024so4596540276.1 for ; Fri, 08 Nov 2024 15:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731109612; x=1731714412; darn=lists.infradead.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=hYN4r2dXiDDQ1/umm78N+WhLJG6p8WQgWglBPVDyni0=; b=jUcBZFpf+OuV58uEaJRS04CV9gEgEGFEApP98HU83qz2285Up/Jwj4Y7Vj4npadhec J21eudy2L74DvueoAMrTSIyYa70IidFEV4CcWfWfVVX8W6I4XuGmgGMzsHLBzwMbrTZL W1rjVWm+3WPYuICZC6vkDzu96BnXgfAZqMlGtVudzeZhkNzmeMTMd+JZC/KPd4ZJCVAT grm/GD0Fu8AjmVZSjPVujB3lfkj1AnvQE6X4ugaklBGiP0rn0Foo9foqAtNkF/UvONLz QKik+8xzLMDElaKFVX/g9p9XIqIAPjgJWJpdYIFgJoFrKccxUV/QxWv1zxrpbrcFDbbs gUzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731109612; x=1731714412; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hYN4r2dXiDDQ1/umm78N+WhLJG6p8WQgWglBPVDyni0=; b=FrCpy0L4h5E0SDh3tr/on5HwfFT69KwvmIE0wq/xF5hahJQCnsczeFGfLQtJIYOp2N 2JQTa3GGgaQ/hcKigdXrN5yNJjk+FppZuOW00cECjwazgbzHjpqxqTM57nSVAgUwdl1N ct2upDUdM7mPsyGhFNJypM6o/X+EU7CXrAu6tvvOAN3rafNkwmNT28vU7hN2w14NeQgY BkHFxxUnD+E+DTBlaX4c3jtwzogeYCT4TLeod/77kDEaxj/mHN03ZXBdOXutgc5C4IyW kLR/YjiKOwS3XnTvEuFfj4FeshE09vDT1pvrW3aUOC5RD/i85SUbYQ3Lkr5luNA/BKYh kLmA== X-Forwarded-Encrypted: i=1; AJvYcCWDWyw9j6l21WcUHOtuLWpbIFe5GLFrgZKvtdO3E/NBVQuTzcKGYJZshpYGfHwXfbMCI+4uT57Hp9XHDA==@lists.infradead.org X-Gm-Message-State: AOJu0YwI8VXI/FiN08yyPEZn1aSB/icUbr9JI0R78XGMbcVW7R0XtuKL gPp/JTYSBfu33i7K2oLOnI+jwvFD6pFTz37OkFvBTlm+IPihQSj9qWbTtU8+DfQqWtBc+OfD4Jc AmmNyqg== X-Google-Smtp-Source: AGHT+IGrTeQzmzATOMc9sc51qhHx4vN1bXYAD5BhwSzzmjme2VXQDGFuwDyPU+Bin0IaJPd5bjTzYYDXlmfz X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:6fd2:1e36:6d8c:7c49]) (user=irogers job=sendgmr) by 2002:a5b:acd:0:b0:e30:d561:dad4 with SMTP id 3f1490d57ef6-e337f8417bemr9670276.2.1731109611796; Fri, 08 Nov 2024 15:46:51 -0800 (PST) Date: Fri, 8 Nov 2024 15:46:03 -0800 In-Reply-To: <20241108234606.429459-1-irogers@google.com> Message-Id: <20241108234606.429459-19-irogers@google.com> Mime-Version: 1.0 References: <20241108234606.429459-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.277.g8800431eea-goog Subject: [PATCH v4 18/20] perf xtensa: Remove dwarf-regs.c From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nick Terrell , "Masami Hiramatsu (Google)" , Changbin Du , Guilherme Amadio , Yang Jihong , Aditya Gupta , Athira Rajeev , Masahiro Yamada , Bibo Mao , Huacai Chen , Kajol Jain , Atish Patra , Shenlin Liang , Anup Patel , Oliver Upton , "Steinar H. Gunderson" , "Dr. David Alan Gilbert" , Chen Pei , Dima Kogan , Przemek Kitszel , "David S. Miller" , Alexander Lobakin , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241108_154653_936461_8BC1D543 X-CRM114-Status: GOOD ( 17.65 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. As this is the only file in the arch/xtensa/util clean up Build files. Tidy up the EM_NONE cases for xtensa in dwarf-regs.c. Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Ian Rogers --- tools/perf/arch/xtensa/Build | 1 - tools/perf/arch/xtensa/util/Build | 1 - tools/perf/arch/xtensa/util/dwarf-regs.c | 21 --------------------- tools/perf/util/dwarf-regs.c | 4 ++-- tools/perf/util/include/dwarf-regs.h | 2 +- 5 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 tools/perf/arch/xtensa/Build delete mode 100644 tools/perf/arch/xtensa/util/Build delete mode 100644 tools/perf/arch/xtensa/util/dwarf-regs.c diff --git a/tools/perf/arch/xtensa/Build b/tools/perf/arch/xtensa/Build deleted file mode 100644 index e63eabc2c8f4..000000000000 --- a/tools/perf/arch/xtensa/Build +++ /dev/null @@ -1 +0,0 @@ -perf-util-y += util/ diff --git a/tools/perf/arch/xtensa/util/Build b/tools/perf/arch/xtensa/util/Build deleted file mode 100644 index 2d1a48696ad9..000000000000 --- a/tools/perf/arch/xtensa/util/Build +++ /dev/null @@ -1 +0,0 @@ -perf-$(CONFIG_LIBDW) += dwarf-regs.o diff --git a/tools/perf/arch/xtensa/util/dwarf-regs.c b/tools/perf/arch/xtensa/util/dwarf-regs.c deleted file mode 100644 index 12f5457300f5..000000000000 --- a/tools/perf/arch/xtensa/util/dwarf-regs.c +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Mapping of DWARF debug register numbers into register names. - * - * Copyright (c) 2015 Cadence Design Systems Inc. - */ - -#include -#include - -#define XTENSA_MAX_REGS 16 - -const char *xtensa_regs_table[XTENSA_MAX_REGS] = { - "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", - "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", -}; - -const char *get_arch_regstr(unsigned int n) -{ - return n < XTENSA_MAX_REGS ? xtensa_regs_table[n] : NULL; -} diff --git a/tools/perf/util/dwarf-regs.c b/tools/perf/util/dwarf-regs.c index a0bcc2529cb0..05fff75a8f59 100644 --- a/tools/perf/util/dwarf-regs.c +++ b/tools/perf/util/dwarf-regs.c @@ -35,7 +35,7 @@ const char *get_dwarf_regstr(unsigned int n, unsigned int machine, unsigned int #if EM_HOST == EM_X86_64 || EM_HOST == EM_386 || EM_HOST == EM_AARCH64 || EM_HOST == EM_ARM \ || EM_HOST == EM_CSKY || EM_HOST == EM_LOONGARCH || EM_HOST == EM_MIPS || EM_HOST == EM_PPC \ || EM_HOST == EM_PPC64 || EM_HOST == EM_RISCV || EM_HOST == EM_S390 || EM_HOST == EM_SH \ - || EM_HOST == EM_SPARC || EM_HOST == EM_SPARCV9 + || EM_HOST == EM_SPARC || EM_HOST == EM_SPARCV9 || EM_HOST == EM_XTENSA if (machine == EM_NONE) { /* Generic arch - use host arch */ machine = EM_HOST; @@ -45,7 +45,7 @@ const char *get_dwarf_regstr(unsigned int n, unsigned int machine, unsigned int #if EM_HOST != EM_X86_64 && EM_HOST != EM_386 && EM_HOST != EM_AARCH64 && EM_HOST != EM_ARM \ && EM_HOST != EM_CSKY && EM_HOST != EM_LOONGARCH && EM_HOST != EM_MIPS && EM_HOST != EM_PPC \ && EM_HOST != EM_PPC64 && EM_HOST != EM_RISCV && EM_HOST != EM_S390 && EM_HOST != EM_SH \ - && EM_HOST != EM_SPARC && EM_HOST != EM_SPARCV9 + && EM_HOST != EM_SPARC && EM_HOST != EM_SPARCV9 && EM_HOST != EM_XTENSA case EM_NONE: /* Generic arch - use host arch */ return get_arch_regstr(n); #endif diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h index cb632d1f46f3..e0f1d65895f5 100644 --- a/tools/perf/util/include/dwarf-regs.h +++ b/tools/perf/util/include/dwarf-regs.h @@ -92,7 +92,7 @@ #if !defined(__x86_64__) && !defined(__i386__) && !defined(__aarch64__) && !defined(__arm__) \ && !defined(__loongarch__) && !defined(__mips__) && !defined(__powerpc__) \ && !defined(__powerpc64__) && !defined(__riscv__) && !defined(__s390x__) && !defined(__sh__) \ - && !defined(__sparc64__) && !defined(__sparc__) + && !defined(__sparc64__) && !defined(__sparc__) && !defined(__xtensa__) const char *get_arch_regstr(unsigned int n); #endif