From nobody Sun Nov 24 00:45:39 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 3D8AD21E116 for ; Fri, 8 Nov 2024 23:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731109616; cv=none; b=c/GwQmwFYVOcpmJ9HqiU7pUWMWLhFj7TRkDzcIgfniy1nHDfviIPBVJgD/A3okZwsRyWtSw3QKxB7vcKcd2VqPTOHxdgEoP75bjK54sinTyv3BuU9Sji3Nth1AzdIviowddO1W9NISXIBlXK2246DyCqPmTqdMlSU13M7L9JlVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731109616; c=relaxed/simple; bh=X1DpwGLvH8kRSONBEEndIwSnJXP1g5GqNf3d+yx7nTc=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=DJoXyl//WjAOcPkWJRkKdVR4Wck4srqW5KiLZabqYcxMLoVhl2uZFURlWh0TBQCs1iUXZlyUmnyLfBaZhwBzmq2E5zmuJtb6Ol7DSQqUiDYFG+SGfZpHoZKOu9sMU6Xf4PgicGrr7cj/sQElLE7QnRuTYbwsyaTTrGiv3MEqO78= 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=n+Ewc+XT; arc=none smtp.client-ip=209.85.219.202 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="n+Ewc+XT" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e28fc8902e6so4981708276.0 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=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=hYN4r2dXiDDQ1/umm78N+WhLJG6p8WQgWglBPVDyni0=; b=n+Ewc+XTUjT4SPzF3kfKH8ecOV73LDwBiMSUsBxdL+U8BPSBBMwvDzbU39QCgtkOwM Y4hbAsdCVccf2f6LiIZRXSKrW2GPUtDcQPvnbcaxmgLNBwtyjH14G/os7OAOIC90T4TM 1eLfdO80+2ka/jUvABUp/vDuw/Mzw/D/n4weQLRaBpLI0NteaK77YaSbla5HeX+kiZ0m 2HNf77eOm8FYIQ1RzHvUwJRK91STNWrefNO58iyxAtXXYGg2aSK2NAbK6IvDP0y6SIyv ucrsyJY1V2p4CH8IVxE+bv13xrK9ef3V66lugWBKaaiOa/SLvTonU7dppbZUQDxfJCYX 3pgg== 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=J6NKHIMV6R0sKnslgua5eCKo0Yef7F7+UUqmEb3CU+Q693ohO+2xQyREAyTQlFScH1 5PgFE1K9fyIaTWc8T4FEvoH9Dej1n32zSVKnjRnDYxgFj/h+04xfXIyaJWtWAQm/x6ty IK/P+SUKifsTpzUNCbPjoaqkysxzEFu960vjxjN8DAmm52tRb2+FWPd/XS9tSspwSzDT Ha5or1dUPGKdlp7MC4oaZzG//cZ/Qfql6KHyG8M5twB2DTEui6x95E6JBsdfNzd7Te6N lK7GP2Cq3mlDPQ0jOp4dGLZqLmPKxz1iviKTy22n+wzMeAi7d8eNhBJzMVWJqQvQMwU8 h/GA== X-Forwarded-Encrypted: i=1; AJvYcCX2Hy2OYgrvsM7wi+GnYP53aYf5uaOQqexwlzgYVKq7i9B43edYEKvRJlgVG7IlRo0au/c8Dbw/1Z3Y4Dc=@vger.kernel.org X-Gm-Message-State: AOJu0YzEnnGsK/bI88UnT8AA4JOsMA7Ihq3jcVIwG61Zn+1NDoN0+RIC 8IqXIeeILSc4yfy3729L71BFnFF32XDj3eECHKVFHqEl2Vxxg9Vng7juBC+RYG4OJIummEy5e3b DJhr7cA== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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. 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 +=3D util/ diff --git a/tools/perf/arch/xtensa/util/Build b/tools/perf/arch/xtensa/uti= l/Build deleted file mode 100644 index 2d1a48696ad9..000000000000 --- a/tools/perf/arch/xtensa/util/Build +++ /dev/null @@ -1 +0,0 @@ -perf-$(CONFIG_LIBDW) +=3D dwarf-regs.o diff --git a/tools/perf/arch/xtensa/util/dwarf-regs.c b/tools/perf/arch/xte= nsa/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] =3D { - "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 =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_LOONGARCH || EM_HOST = =3D=3D EM_MIPS || EM_HOST =3D=3D EM_PPC \ || EM_HOST =3D=3D EM_PPC64 || EM_HOST =3D=3D EM_RISCV || EM_HOST =3D= =3D EM_S390 || EM_HOST =3D=3D EM_SH \ - || EM_HOST =3D=3D EM_SPARC || EM_HOST =3D=3D EM_SPARCV9 + || EM_HOST =3D=3D EM_SPARC || EM_HOST =3D=3D EM_SPARCV9 || EM_HOST =3D= =3D EM_XTENSA if (machine =3D=3D EM_NONE) { /* Generic arch - use host arch */ machine =3D EM_HOST; @@ -45,7 +45,7 @@ const char *get_dwarf_regstr(unsigned int n, unsigned int= machine, unsigned int #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_LOONGARCH && EM_HOST !=3D E= M_MIPS && EM_HOST !=3D EM_PPC \ && EM_HOST !=3D EM_PPC64 && EM_HOST !=3D EM_RISCV && EM_HOST !=3D EM_S= 390 && EM_HOST !=3D EM_SH \ - && EM_HOST !=3D EM_SPARC && EM_HOST !=3D EM_SPARCV9 + && EM_HOST !=3D EM_SPARC && EM_HOST !=3D EM_SPARCV9 && EM_HOST !=3D 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 =20 --=20 2.47.0.277.g8800431eea-goog