From nobody Thu Nov 28 03:41:47 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D3BE188937 for ; Sat, 5 Oct 2024 19:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728158210; cv=none; b=Tobfeo5dMfYIrCyKSgt2nw4KUL5wNqjwQbFsBMuG64m+OVSRj5B2kl8Ei/MscXUK+qlcHGmcF5cgYKIKbub3tHYzLhwALv31y+r9ShzQLBkoBC8n0PLIFgl9k1/BPZYPAt+kFvJ0Lk4MpE/HdwRDtvX30RqgpWeAC64aW0dil9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728158210; c=relaxed/simple; bh=KPXFlEwWt/UGl7qiXtTbrMb7WVi1MkyXBOPi+pW+OQY=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=btAQs8N8EUkbI+iz6Ayx47Y8QE7zPYHKisRABKiCohyXCB7OL0hUYknYZG/pShxC68orXemxBjtUK89HzueihGHRHasvrxiOVxTviPrzbTn2HdDGM8JDMEU7QFg1rWb1WAXf6EEME1gzRydANJE155mgNhceqow9ovYQa5DUXW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sn9te8xZ; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sn9te8xZ" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e230808455so40287537b3.0 for ; Sat, 05 Oct 2024 12:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728158207; x=1728763007; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=q4nfym4aHRABgeK2o4kYgh7MQauDKY/5wnwGVKCXL/U=; b=sn9te8xZlw/6cDKLa+pSkj8uevcvGoeIgSFMNJWIJZ6O9ehrnHlCyCf9s1msd+ZTKu 8WlrLji7Kb8iic+5luj58swwTRHWYXkZhEqocZNrW9rtNhM7Hp9KSsrhZSuxY7r0MXqE Y4BnxDlu5U86QgVis/3EWrZf4QEVa++8CZLPtw99Mz41KA7WcsSy5hLx1XN0D+APNIVi fGzqom7k8bDId2NGMWHxOP4uvqSvgjAL008FFGvJyL79JPXET8FY/lueBWPbJ0XBv3QT TFIJuhJZUuayDWcS91adRd5PTWySUYZiHir0f9x4AG7186/66U3+czEjkfA74Y561MNb 1bWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728158207; x=1728763007; 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=q4nfym4aHRABgeK2o4kYgh7MQauDKY/5wnwGVKCXL/U=; b=TAyFX6rpJhWSqSiq9TDIOTo921rQ9b20YcqrtZqYOVSXL6BtlHOcmLZbpEqOSDc7TT bXPFSR7vQhaHauJeEtJ+ZMCOdm+N2F/55tt+nUlH3kQ/PhYHh1Z1/0RrCW5xQbiPskZ9 olsXkF4qUCDfRG8/Gbop+zEEZDBld8/V0JknqPlDwMa6zofLkTffZlok3Bz6Ifr3SOt2 kigXlzxx24IdXE6aLwKx7gjHOWHOTn0Wj4/BMTYj3tTLJKHeK1+c1M9ZVrJ9kLo8IAbb eC65xREkOILqhqX1/9Rs/TcO0QkCyVs2bz4iPFo3DhQZnKHTIH6ZkAomguWMdS5o5//F 2fUw== X-Forwarded-Encrypted: i=1; AJvYcCWmhj03x7MFgKHvRCpbCLN99G0da/xDC2xQb++Fe6WMaTzdxLnKgv68tGadakH6Pg6jRzsc1QDIhReaPXw=@vger.kernel.org X-Gm-Message-State: AOJu0YxfQVBLLHa6avtu/GRI9Qct6leu+QJY1G+Y6M3lLF+hFrJ8pIoc 8kisqpumP9NUq9PAk/MQ/EmI9wWHF9FT4ygN/WotGumZLShGeiEBsflB+otGnOaWFCF8YezTn9F z5KvTyg== X-Google-Smtp-Source: AGHT+IGwFa7Hd++IIPfhdwWa5aoWpwfc5FH4Qfd2Wi5L5CDLWvwjg7FsZhYuik7PKcUvMabRjFi+c5q2jqfZ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:4c2:5b4d:8797:7249]) (user=irogers job=sendgmr) by 2002:a81:93c7:0:b0:6b1:8b74:978a with SMTP id 00721157ae682-6e2c728f13bmr1856917b3.4.1728158207463; Sat, 05 Oct 2024 12:56:47 -0700 (PDT) Date: Sat, 5 Oct 2024 12:55:32 -0700 In-Reply-To: <20241005195541.380070-1-irogers@google.com> Message-Id: <20241005195541.380070-23-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 22/31] perf loongarch: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 loongarch in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/loongarch/util/Build | 1 - tools/perf/arch/loongarch/util/dwarf-regs.c | 34 --------------------- tools/perf/util/dwarf-regs.c | 4 +-- tools/perf/util/include/dwarf-regs.h | 3 +- 4 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 tools/perf/arch/loongarch/util/dwarf-regs.c diff --git a/tools/perf/arch/loongarch/util/Build b/tools/perf/arch/loongar= ch/util/Build index 06ff95394921..0aa31986ecb5 100644 --- a/tools/perf/arch/loongarch/util/Build +++ b/tools/perf/arch/loongarch/util/Build @@ -1,7 +1,6 @@ perf-util-y +=3D header.o perf-util-y +=3D perf_regs.o =20 -perf-util-$(CONFIG_LIBDW) +=3D dwarf-regs.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) +=3D unwind-libunwind.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) +=3D unwind-libdw.o perf-util-$(CONFIG_LIBTRACEEVENT) +=3D kvm-stat.o diff --git a/tools/perf/arch/loongarch/util/dwarf-regs.c b/tools/perf/arch/= loongarch/util/dwarf-regs.c deleted file mode 100644 index bee08fdcf2fd..000000000000 --- a/tools/perf/arch/loongarch/util/dwarf-regs.c +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * dwarf-regs.c : Mapping of DWARF debug register numbers into register na= mes. - * - * Copyright (C) 2020-2023 Loongson Technology Corporation Limited - */ - -#include -#include /* for EINVAL */ -#include /* for strcmp */ -#include - -struct pt_regs_dwarfnum { - const char *name; - unsigned int dwarfnum; -}; - -static struct pt_regs_dwarfnum loongarch_gpr_table[] =3D { - {"%r0", 0}, {"%r1", 1}, {"%r2", 2}, {"%r3", 3}, - {"%r4", 4}, {"%r5", 5}, {"%r6", 6}, {"%r7", 7}, - {"%r8", 8}, {"%r9", 9}, {"%r10", 10}, {"%r11", 11}, - {"%r12", 12}, {"%r13", 13}, {"%r14", 14}, {"%r15", 15}, - {"%r16", 16}, {"%r17", 17}, {"%r18", 18}, {"%r19", 19}, - {"%r20", 20}, {"%r21", 21}, {"%r22", 22}, {"%r23", 23}, - {"%r24", 24}, {"%r25", 25}, {"%r26", 26}, {"%r27", 27}, - {"%r28", 28}, {"%r29", 29}, {"%r30", 30}, {"%r31", 31}, - {NULL, 0} -}; - -const char *get_arch_regstr(unsigned int n) -{ - n %=3D 32; - return loongarch_gpr_table[n].name; -} diff --git a/tools/perf/util/dwarf-regs.c b/tools/perf/util/dwarf-regs.c index 9a76f83af62c..efc41d0fbee9 100644 --- a/tools/perf/util/dwarf-regs.c +++ b/tools/perf/util/dwarf-regs.c @@ -32,7 +32,7 @@ const char *get_dwarf_regstr(unsigned int n, unsigned int machine, unsigne= d int flags) { #if EM_HOST =3D=3D EM_X86_64 || EM_HOST =3D=3D EM_386 || EM_HOST =3D=3D EM= _AARCH64 || EM_HOST =3D=3D EM_ARM \ - || EM_HOST =3D=3D EM_CSKY + || EM_HOST =3D=3D EM_CSKY || EM_HOST =3D=3D EM_LOONGARCH if (machine =3D=3D EM_NONE) { /* Generic arch - use host arch */ machine =3D EM_HOST; @@ -40,7 +40,7 @@ const char *get_dwarf_regstr(unsigned int n, unsigned int= machine, unsigned int #endif switch (machine) { #if EM_HOST !=3D EM_X86_64 && EM_HOST !=3D EM_386 && EM_HOST !=3D EM_AARCH= 64 && EM_HOST !=3D EM_ARM \ - && EM_HOST !=3D EM_CSKY + && EM_HOST !=3D EM_CSKY && EM_HOST !=3D EM_LOONGARCH 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 b72d9d308ce4..4f205a58db89 100644 --- a/tools/perf/util/include/dwarf-regs.h +++ b/tools/perf/util/include/dwarf-regs.h @@ -79,7 +79,8 @@ #define DWARF_REG_FB 0xd3affb /* random number */ =20 #ifdef HAVE_LIBDW_SUPPORT -#if !defined(__x86_64__) && !defined(__i386__) && !defined(__aarch64__) &&= !defined(__arm__) +#if !defined(__x86_64__) && !defined(__i386__) && !defined(__aarch64__) &&= !defined(__arm__) \ + && !defined(__loongarch__) const char *get_arch_regstr(unsigned int n); #endif =20 --=20 2.47.0.rc0.187.ge670bccf7e-goog