From patchwork Thu Oct 17 00:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13839181 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 23A5DD2F7D7 for ; Thu, 17 Oct 2024 01:02:36 +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=+vS3pAQ+haKP/8iv+6aAP7RJEQP9tkb6yzoJLAeVBwY=; b=M3lou/FvgVVAaH7lANOe7Q95aX AVqiLuO+Ya2Ey+aHqdj8gHP+75R+4UPqYseUNuQubMClCUVTz75tm6AQa/FZeZ4tOyvqdtTygi1LS EGkIYuFjJ4G7zy5nvMzJKujl0OC133e5YAmpPJq4VkrZSjfUPbdx2wA0uodnM/d7byxpnEGoEI0kQ /gYKKPMdhsMI48LayopnVLg8/Ko0UtEzojxq7K+KrlVz4EAfAutPE5K/VVzUgDgTs0/Q163v91A2c xvUxSCfAKq8XoE3mgvyca6uAm5RAI/VCDbEPNgTcVnsbirLuln4Xl+F3TJlBlV5QUyO8I9s+uvNmh aauvYBTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1EuI-0000000DPog-2GOW; Thu, 17 Oct 2024 01:02:26 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1EL8-0000000DKOd-1qOG for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 00:26:07 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-6e32b43e053so7804177b3.1 for ; Wed, 16 Oct 2024 17:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729124765; x=1729729565; 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=+vS3pAQ+haKP/8iv+6aAP7RJEQP9tkb6yzoJLAeVBwY=; b=JlLUJdNR6Gj7mo+IzAgXwHyclcDChaKIEuERfSvb85iLLEMWC7w95BKJzB+3o51mnC FXHpzr7FUQ3os8403lYKvGMjbOCfalpfzlL+y7uX/yKN7Fq/MQ8rgS1eSeCFpP5Q+zvt JzoJVXRFuJYdf/uWN2PlGAjIZjPt0wTqUAxCM+G0uMzkpDrc97Mk8ZfTFPMOFnsM6X2l JaypoQ7DEzqKYpgoWPWW+qmDzwdXfVpuv77TZhPc6/NRplqCTZeRelbCSlPm7ww61v/b Xa01olxLF1G93Gc3Ly76eMUzZeZWdIalWlCKPXjx1mdEIPG9KV7X7AVk6QQIbVpEOz5K 4QEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729124765; x=1729729565; 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=+vS3pAQ+haKP/8iv+6aAP7RJEQP9tkb6yzoJLAeVBwY=; b=fpQUwCkJmbbs7RsPZ3mDAV2vBx3ybktry4me0Y+CcxmJaoGVxsBqZJ2QZLDw4hPHI7 OSaIyAbb9gw20bH8prK/DHvZvXKtaJ4HPIzTp/HScU/9Xq1NA1r7jRFAcbdZ2Dq86P4E EXKsf3HIwG4EPNxVTKstarBF00ZLJjjIGntKhP1G70X1e6X9xJe1QIYGH0ScxJaQoGef 2M7AtHo2gsGYXg5kJSeBv+GlBMlgtXtZG3WBA8XD3l18HHu5CMgZ5g7OkZWmOMSeiNOH 7VhoqjjdEmJ+whvd3q3C5CkyHZ1HRgFfsfX9tXhC9J+r7XnncU1EOgQI0yrLLKzOSZns 6qUw== X-Forwarded-Encrypted: i=1; AJvYcCV8xanMD/4x7fvggiUGXFhgbNZ1jWuclWQPgOiCEecJ/hHpu7SUMjrmh2IkalLIR3IWiuKIcp0UNUj299JMm1Ho@lists.infradead.org X-Gm-Message-State: AOJu0YxGykX7zIiRWlJMzfpGOiNrFKyXFlX2dp5wwAH0FAmw2z78rcPh m3IwXNCNjgLkYeS09F9IHy24T4pTGBDqh9FgiquZs9kNo8JkVuFnm8oYwyE+EaSgemfIFXrC4vz oL8+8bg== X-Google-Smtp-Source: AGHT+IHww5hKkYtrtEd7xFxuwiqgL1g9EP1jrDvOSFsM0YJ3aBoaypiL1q7z5gT/re1gw8cKAYiVLMh2TMTK X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:a00a:f237:9bc0:79c]) (user=irogers job=sendgmr) by 2002:a05:690c:9a84:b0:6e3:19d7:382a with SMTP id 00721157ae682-6e3d3f7f52fmr1338867b3.1.1729124764951; Wed, 16 Oct 2024 17:26:04 -0700 (PDT) Date: Wed, 16 Oct 2024 17:25:15 -0700 In-Reply-To: <20241017002520.59124-1-irogers@google.com> Message-Id: <20241017002520.59124-16-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 15/20] perf s390: 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-20241016_172606_503670_406F7B43 X-CRM114-Status: GOOD ( 17.98 ) 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. Tidy up the EM_NONE cases for s390 in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/s390/util/Build | 1 - tools/perf/arch/s390/util/dwarf-regs.c | 16 ---------------- tools/perf/util/dwarf-regs.c | 4 ++-- tools/perf/util/include/dwarf-regs.h | 2 +- 4 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 tools/perf/arch/s390/util/dwarf-regs.c diff --git a/tools/perf/arch/s390/util/Build b/tools/perf/arch/s390/util/Build index 787410f99bb3..736c0ad09194 100644 --- a/tools/perf/arch/s390/util/Build +++ b/tools/perf/arch/s390/util/Build @@ -2,7 +2,6 @@ perf-util-y += header.o perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o perf-util-y += perf_regs.o -perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-util-y += machine.o diff --git a/tools/perf/arch/s390/util/dwarf-regs.c b/tools/perf/arch/s390/util/dwarf-regs.c deleted file mode 100644 index 5bcf3192623a..000000000000 --- a/tools/perf/arch/s390/util/dwarf-regs.c +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Mapping of DWARF debug register numbers into register names. - * - * Copyright IBM Corp. 2010, 2017 - * Author(s): Hendrik Brueckner - * - */ - -#include -#include "dwarf-regs-table.h" - -const char *get_arch_regstr(unsigned int n) -{ - return (n >= ARRAY_SIZE(s390_dwarf_regs)) ? NULL : s390_dwarf_regs[n]; -} diff --git a/tools/perf/util/dwarf-regs.c b/tools/perf/util/dwarf-regs.c index 2c6b197556dd..1649fc07f4f5 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_PPC64 || EM_HOST == EM_RISCV || EM_HOST == EM_S390 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_PPC64 && EM_HOST != EM_RISCV && EM_HOST != EM_S390 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 35f4f33205da..25f3d6b90f10 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(__powerpc64__) && !defined(__riscv__) && !defined(__s390x__) const char *get_arch_regstr(unsigned int n); #endif