From patchwork Sat Oct 5 19:55:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13823538 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 2E39ACFB42C for ; Sat, 5 Oct 2024 20:31:17 +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=ma4kgoFy2RIK7A+71lTzE6CEm9/tJ6zbTbn85DXB8RQ=; b=FEhj7rIzue+UkyIYOFqo+xTGsR P3aDhwuyQcT00aZkJrdalAhp7st5FXb6yC6p2gZ13C27Qfp9IWONNsXGrz4Yw6y3IborBtO+F7Swa /cbv52YAWffrAiUZEFihFFbQDBmI5iESlVixqJa176FhiHkz3rXldMpGNSNEGa8hVFGdB1c8BpwyQ xUI1/m/7Jru1tOA8uzyrVDfwtaiiBoFW2uQnLaxAwUXtap/Gro3srV2o9e55JVI1Tlog4QNXo9kkw qvNp8w22aIZP3Rv+rmtcjUdUYQtbMecLmUCrrHrkV5NX4CYwYSWaBaHFHNHooNdMevAwJxfIGvTlg +MzJJXUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sxBQd-0000000Fugf-2gat; Sat, 05 Oct 2024 20:31:03 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sxAtg-0000000FqNw-1DZI for linux-arm-kernel@lists.infradead.org; Sat, 05 Oct 2024 19:57:01 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-e25cfee6581so5569139276.2 for ; Sat, 05 Oct 2024 12:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728158219; x=1728763019; 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=ma4kgoFy2RIK7A+71lTzE6CEm9/tJ6zbTbn85DXB8RQ=; b=ZqOSh2135+obnyaVIfp2NIFEjotlQiUR2m1E+f8sjUDwoz6l1/vsQmm0yhI1951ts9 pKeYUoJ/daT1ysjg/YWkESrEJv7HIg6Jnt82jFMCF5aAyIvnc8FnfTawFwR7OoakWU4z UTdbMYbkMjVzajF8oWtc5jNK6s1j3Oxrp+1IzWs0e9AWKs7yIC53v9D/M7iKLxRTRNf4 mShpGw/PfVz1e+MWIXzAlLR1Fc9ripQ5VjQI7E1OG7WsIdUqZotqWJQkIw7Lja57B+bh 0ChH1+Du/+YjA7cdWAPhMT3Ra2IsNOtomgFWJle6N0t8jjc5sqR562pdlE6N3e7xK77J bBqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728158219; x=1728763019; 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=ma4kgoFy2RIK7A+71lTzE6CEm9/tJ6zbTbn85DXB8RQ=; b=rWdx0YUqB0tSdsjjbffZAakhILUZ7BSGI/4BEMlrOvJZQWa3obDvRb6jp8+x4NqQ5P p6mmZ2Z945sEF461QFJ88yKdUVelZkjhzLZRTMJCD+Dovm1bF1pvz9m3X4OoXaf+hJ7z c56onffrEDcP7CErDps8g0cKbnc2luR1G3+Es+ri/cHYVd0B8pnN6pdSNayXeFnQfbzj CEv8ZpS0gKcgLR4dQaG5APUoH1NNm8QJH6nMSkMzwIUZS7QHYtvS77esX9pNoeFsMqvu Co6V3ks68q83zauSZkumajq6HPv9sR2sdP+qI8KuIKutjvp6wKHD/iwZsG6T0QNnP0Rd mt9w== X-Forwarded-Encrypted: i=1; AJvYcCVU2lofni8WVRUczNcPoM0gqqBve6KfWy5Irm7wY67t29aSMcYpllfT+yxu0476IgX2WCMh9d4tnoyVgIXPuUED@lists.infradead.org X-Gm-Message-State: AOJu0YyWSMVt+TuVHzZeaUxgGuGEm4h2eI1C6rol994+cFbEoxIScpMi waSvyLTT9JRKGZnf0TjzpOb9iGdPqLnIkVpty1n2u5oG/yZcCG8jrsnAypA664N+WkmE0cDdEJJ e1gahug== X-Google-Smtp-Source: AGHT+IEl51HegVcv/pl0KKiaLpVIfkXCyaK+ttN6DaWvP25wIl/YaqJ6jogCCBBTO/D119SZYDZzeC85Makg X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:4c2:5b4d:8797:7249]) (user=irogers job=sendgmr) by 2002:a25:aa21:0:b0:e22:5bdf:39b4 with SMTP id 3f1490d57ef6-e28936baae8mr4651276.2.1728158218682; Sat, 05 Oct 2024 12:56:58 -0700 (PDT) Date: Sat, 5 Oct 2024 12:55:37 -0700 In-Reply-To: <20241005195541.380070-1-irogers@google.com> Message-Id: <20241005195541.380070-28-irogers@google.com> Mime-Version: 1.0 References: <20241005195541.380070-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog Subject: [PATCH v2 27/31] perf sh: 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 , "Steven Rostedt (Google)" , "Masami Hiramatsu (Google)" , Guilherme Amadio , Changbin Du , Daniel Bristot de Oliveira , Daniel Wagner , Aditya Gupta , Athira Rajeev , Masahiro Yamada , Kajol Jain , Huacai Chen , Bibo Mao , Anup Patel , Atish Patra , Shenlin Liang , Oliver Upton , "Steinar H. Gunderson" , "Dr. David Alan Gilbert" , Chen Pei , Dima Kogan , Yury Norov , 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-20241005_125700_376200_7656B5AB X-CRM114-Status: GOOD ( 18.37 ) 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/sh/util clean up Build files. Tidy up the EM_NONE cases for sh in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/sh/Build | 1 - tools/perf/arch/sh/util/Build | 1 - tools/perf/arch/sh/util/dwarf-regs.c | 41 ---------------------------- tools/perf/util/dwarf-regs.c | 4 +-- tools/perf/util/include/dwarf-regs.h | 2 +- 5 files changed, 3 insertions(+), 46 deletions(-) delete mode 100644 tools/perf/arch/sh/Build delete mode 100644 tools/perf/arch/sh/util/Build delete mode 100644 tools/perf/arch/sh/util/dwarf-regs.c diff --git a/tools/perf/arch/sh/Build b/tools/perf/arch/sh/Build deleted file mode 100644 index e63eabc2c8f4..000000000000 --- a/tools/perf/arch/sh/Build +++ /dev/null @@ -1 +0,0 @@ -perf-util-y += util/ diff --git a/tools/perf/arch/sh/util/Build b/tools/perf/arch/sh/util/Build deleted file mode 100644 index 2337a0b710a2..000000000000 --- a/tools/perf/arch/sh/util/Build +++ /dev/null @@ -1 +0,0 @@ -perf-util-$(CONFIG_LIBDW) += dwarf-regs.o diff --git a/tools/perf/arch/sh/util/dwarf-regs.c b/tools/perf/arch/sh/util/dwarf-regs.c deleted file mode 100644 index 4b17fc86c73b..000000000000 --- a/tools/perf/arch/sh/util/dwarf-regs.c +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Mapping of DWARF debug register numbers into register names. - * - * Copyright (C) 2010 Matt Fleming - */ - -#include -#include - -/* - * Generic dwarf analysis helpers - */ - -#define SH_MAX_REGS 18 -const char *sh_regs_table[SH_MAX_REGS] = { - "r0", - "r1", - "r2", - "r3", - "r4", - "r5", - "r6", - "r7", - "r8", - "r9", - "r10", - "r11", - "r12", - "r13", - "r14", - "r15", - "pc", - "pr", -}; - -/* Return architecture dependent register string (for kprobe-tracer) */ -const char *get_arch_regstr(unsigned int n) -{ - return (n < SH_MAX_REGS) ? sh_regs_table[n] : NULL; -} diff --git a/tools/perf/util/dwarf-regs.c b/tools/perf/util/dwarf-regs.c index 1649fc07f4f5..944ff4ef0290 100644 --- a/tools/perf/util/dwarf-regs.c +++ b/tools/perf/util/dwarf-regs.c @@ -34,7 +34,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_PPC64 || EM_HOST == EM_RISCV || EM_HOST == EM_S390 || EM_HOST == EM_SH if (machine == EM_NONE) { /* Generic arch - use host arch */ machine = EM_HOST; @@ -43,7 +43,7 @@ const char *get_dwarf_regstr(unsigned int n, unsigned int machine, unsigned int switch (machine) { #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_PPC64 && EM_HOST != EM_RISCV && EM_HOST != EM_S390 && EM_HOST != EM_SH 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 25f3d6b90f10..2b212ed70a15 100644 --- a/tools/perf/util/include/dwarf-regs.h +++ b/tools/perf/util/include/dwarf-regs.h @@ -81,7 +81,7 @@ #ifdef HAVE_LIBDW_SUPPORT #if !defined(__x86_64__) && !defined(__i386__) && !defined(__aarch64__) && !defined(__arm__) \ && !defined(__loongarch__) && !defined(__mips__) && !defined(__powerpc__) \ - && !defined(__powerpc64__) && !defined(__riscv__) && !defined(__s390x__) + && !defined(__powerpc64__) && !defined(__riscv__) && !defined(__s390x__) && !defined(__sh__) const char *get_arch_regstr(unsigned int n); #endif