From patchwork Thu Oct 17 00:25:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13839183 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 28A8BD2F7D8 for ; Thu, 17 Oct 2024 01:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:From:Subject :References:Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uq9AxXLwl+md7pGfplbuMGPRmw11SaZaUSrHTUrrfs0=; b=QMWQ+fzSlQ0xnPfhuMx+djl6rR fllemsDU86YFZC9yg3meJWMeWuOGhwDsauSVXEfHpppESVjQx8GCobNXF5bsLYXXsCIrWwcYyUUVP B5W6tsYvzZ/Hfh5EJZJ2y2rm5A0aof2P8r6QqS4BZ8dFQhWfK41UadlOcCilvMZ+JhDCBno3d+YR+ i6ggtWdJvagjLFXLviSDDppzGB011biNGWFp1HlElEevXXgsp0wIMrx8lqxSOvvGRRbowsRDKsJZZ g8Pup+NMc+GX5tbGS7aOK+bogLVZwYinW0XRxvTg5B4FdiSinhfKGg0CZTIJAVn3DYimTO0icr+sR krxewyMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1EyT-0000000DQBv-11tA; Thu, 17 Oct 2024 01:06:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1ELK-0000000DKTb-0HQb for linux-arm-kernel@bombadil.infradead.org; Thu, 17 Oct 2024 00:26:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=uq9AxXLwl+md7pGfplbuMGPRmw11SaZaUSrHTUrrfs0=; b=m09i8OCyaW8dHmw8FNS9G2R92Y rKSk7WMym9MxmYGJvnEgJuoQMz4Wq47MIpldNdbCM8AOSDIfeu4MYKnKuhEJ5fztX1PhBQ9hpmEED LsQBTj4jUzWB4rGfL5MzUH1dhr61H+qMT75Zv05WPmRNVxav/G7XJMg25ovOb0umtFMUoSJa6138y Pz5b7qZ3ecULzImWnOuyLxgEWbKNGL14gg4K8sYd+LUtxiouqF1cogMu+OZrW1exW6J/kje42gXPV MYlwpuu2OLxUl2zfLo19PmcLUNXyWlc2MUq7cGxAokdP8vd2FM9LbCjs/q77wSDpJySF5c4uXxI9V ssPJR4XQ==; Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1ELG-00000006yLn-1kJ5 for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 00:26:16 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e0b8fa94718so589025276.0 for ; Wed, 16 Oct 2024 17:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729124773; x=1729729573; 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=uq9AxXLwl+md7pGfplbuMGPRmw11SaZaUSrHTUrrfs0=; b=hZTPf3wjZo5gv0SwMD1K7wwNrMmvax9ObdMPWMxgIBKZ8s+mfmi+LGYIks2dGnxPEF PnUsflblAob9ceohQFH1aAH4EI9ZU/UpFUfW6O2MQHAMcFjsIQodWV2MYOSJF+hCgtGY D8TsfT9GhThm5NscGnel2bD3+M1ztgTuPLHnxmtslq4ARQhMf37wQa+H3af6DI2hLNpj cmwTJwT1Nqqorpm8cRlxdGO0IO6jlMnYw/7b5nstqKuho9f7dPg4FbjR6oo39rUG4eqp gzWdiupdf9WroQ8ufq8m8IrrGbokSoUqHAJt9roFgx9t8+QS8PNXtbR05sJpqjx9QIul SeeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729124773; x=1729729573; 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=uq9AxXLwl+md7pGfplbuMGPRmw11SaZaUSrHTUrrfs0=; b=Rv+RDs4I0HPSiiNgXZFcf3FMhcZlUPsj8o1vDGjpY7zbuMPuafaiE5f3fujY5FemLQ Ms9hW4uSakRnRN8QHvRzpos0QAXGhGB/maQ9lcNggOxLHvUwlU2kTt9ZHhd1BuXJsiHH gjAczUabD8WNXB8aFnq35cvWteEv+HfHIh17JmaOj88GDNoPgI6ZXHm6IZN+jkk1TrGr hOCovNHnWdvdzmxmVHZG01LrwWX14D/lOGIRyoY7xJxkdEmPYATgX5wvbfUyXlVYZBOo V0yQEPFl7PYL2tpSe2/UNRXaHEtITHbI0F7gFRw3OUTeKRMVvqiTgpievtXAA0ShIflR pGhg== X-Forwarded-Encrypted: i=1; AJvYcCWal0WM0ODwV3pUXEk80kboDs+gresTz8XjoYAsyYVdM4pC0Bsm811lvtNXGgLss69zj9C0w3K1/RIIFkg5DPHv@lists.infradead.org X-Gm-Message-State: AOJu0YwJiJul3qDf/oNdEy1Kxafnhz4acEwcWJimVnPpuJdrnIYFOYZP YuNsCbuarxQh2psVcP+AVD0sg0xwZlUyRLBocCytsNwM18N5mZyvNjazltQW/9XJTQaE+LWLlMO ySMSSwQ== X-Google-Smtp-Source: AGHT+IFblE5b3blF81m60FrHwxXihWa7btaVQayshFuqPR503LpiCQwiOp0I0Sdca5Yyel3RIIDwjSVp3STP X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:a00a:f237:9bc0:79c]) (user=irogers job=sendgmr) by 2002:a25:7e04:0:b0:e25:fcb:3205 with SMTP id 3f1490d57ef6-e29785695e6mr5028276.8.1729124772530; Wed, 16 Oct 2024 17:26:12 -0700 (PDT) Date: Wed, 16 Oct 2024 17:25:18 -0700 In-Reply-To: <20241017002520.59124-1-irogers@google.com> Message-Id: <20241017002520.59124-19-irogers@google.com> Mime-Version: 1.0 References: <20241017002520.59124-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Subject: [PATCH v3 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-20241017_012615_174022_26299189 X-CRM114-Status: GOOD ( 18.84 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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. 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 b2cf7d9e4785..9dfc9abfdddd 100644 --- a/tools/perf/util/include/dwarf-regs.h +++ b/tools/perf/util/include/dwarf-regs.h @@ -82,7 +82,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