From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2041) id 09A39385840D; Mon, 26 Feb 2024 01:31:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09A39385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708911066; bh=iBU6VzGF8o+BgZkvMQUIBj2BVHiJ/uyoVZNvmeC2m8o=; h=From:To:Subject:Date:From; b=e/IGBgUjDxAmJF2+yiNac/XVgyUL3wDKOT5vc6t+Cx/5CscMzwroM6sb2/tlqm2AC KBnMFTqqVcNGGZLPmLFxCFV40DUmEbpiqPdIIWim5fG3k4dABg2Sh0ZXLvIqGvP2eY SbSSDeHek8niYvNbJdF3le67um9U741GszBSRCVE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Vladimir Mezentsev To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] gprofng: Add hardware counter profiling for the Ampere system X-Act-Checkin: binutils-gdb X-Git-Author: Vladimir Mezentsev X-Git-Refname: refs/heads/master X-Git-Oldrev: 29c238c5fb4699b463b4c68d5719586b0675afdd X-Git-Newrev: f8c018bcd4ef50bc68c01b19da287a9caaa89c15 Message-Id: <20240226013106.09A39385840D@sourceware.org> Date: Mon, 26 Feb 2024 01:31:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df8c018bcd4ef= 50bc68c01b19da287a9caaa89c15 commit f8c018bcd4ef50bc68c01b19da287a9caaa89c15 Author: Vladimir Mezentsev Date: Thu Feb 22 15:30:40 2024 -0800 gprofng: Add hardware counter profiling for the Ampere system =20 gprofng should recognize Ampere and other ARM systems. =20 gprofng/ChangeLog 2024-02-22 Vladimir Mezentsev =20 * common/hwc_cpus.h: Declare the enum values ARM_CPU_IMP_*. * common/core_pcbe.c (core_pcbe_init): Accept new systems ARM_C= PU_IMP_*. Diff: --- gprofng/common/core_pcbe.c | 5 +++++ gprofng/common/hwc_cpus.h | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gprofng/common/core_pcbe.c b/gprofng/common/core_pcbe.c index 25bf484d7f2..30977f0ebb2 100644 --- a/gprofng/common/core_pcbe.c +++ b/gprofng/common/core_pcbe.c @@ -2746,6 +2746,11 @@ core_pcbe_init (void) case ARM_CPU_IMP_CAVIUM: case ARM_CPU_IMP_APM: case ARM_CPU_IMP_QCOM: + case ARM_CPU_IMP_FUJITSU: + case ARM_CPU_IMP_NVIDIA: + case ARM_CPU_IMP_HISI: + case ARM_CPU_IMP_APPLE: + case ARM_CPU_IMP_AMPERE: snprintf (core_impl_name, sizeof (core_impl_name), "%s", AARCH64_VEN= DORSTR_ARM); events_table =3D events_generic; num_gpc =3D 4; // MEZ: a real implementation is needed diff --git a/gprofng/common/hwc_cpus.h b/gprofng/common/hwc_cpus.h index 34896d6fb46..4b770832b15 100644 --- a/gprofng/common/hwc_cpus.h +++ b/gprofng/common/hwc_cpus.h @@ -117,13 +117,19 @@ extern cpu_info_t *read_cpuinfo(); #define CPC_SPARC64_X 4006 /* Athena */ #define CPC_SPARC64_XII 4010 /* Athena++ */ =20 -// aarch64. Constants from arch/arm64/include/asm/cputype.h +// aarch64. Constants from tools/arch/arm64/include/asm/cputype.h +// in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git enum { ARM_CPU_IMP_ARM =3D 0x41, ARM_CPU_IMP_BRCM =3D 0x42, ARM_CPU_IMP_CAVIUM =3D 0x43, + ARM_CPU_IMP_FUJITSU =3D 0x46, + ARM_CPU_IMP_NVIDIA =3D 0x4E, + ARM_CPU_IMP_HISI =3D 0x48, ARM_CPU_IMP_APM =3D 0x50, - ARM_CPU_IMP_QCOM =3D 0x51 + ARM_CPU_IMP_QCOM =3D 0x51, + ARM_CPU_IMP_APPLE =3D 0x61, + ARM_CPU_IMP_AMPERE =3D 0xC0 }; =20 #define AARCH64_VENDORSTR_ARM "ARM"