From: vladimir.mezentsev@oracle.com
To: binutils@sourceware.org
Cc: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Subject: [PATCH] gprofng: Add hardware counter profiling for the Ampere system
Date: Thu, 22 Feb 2024 20:49:54 -0800 [thread overview]
Message-ID: <20240223044954.544990-1-vladimir.mezentsev@oracle.com> (raw)
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
gprofng should recognize Ampere and other ARM systems.
gprofng/ChangeLog
2024-02-22 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
* common/hwc_cpus.h: Declare the enum values ARM_CPU_IMP_*.
* common/core_pcbe.c (core_pcbe_init): Accept new systems ARM_CPU_IMP_*.
---
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_VENDORSTR_ARM);
events_table = events_generic;
num_gpc = 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++ */
-// 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 = 0x41,
ARM_CPU_IMP_BRCM = 0x42,
ARM_CPU_IMP_CAVIUM = 0x43,
+ ARM_CPU_IMP_FUJITSU = 0x46,
+ ARM_CPU_IMP_NVIDIA = 0x4E,
+ ARM_CPU_IMP_HISI = 0x48,
ARM_CPU_IMP_APM = 0x50,
- ARM_CPU_IMP_QCOM = 0x51
+ ARM_CPU_IMP_QCOM = 0x51,
+ ARM_CPU_IMP_APPLE = 0x61,
+ ARM_CPU_IMP_AMPERE = 0xC0
};
#define AARCH64_VENDORSTR_ARM "ARM"
--
2.31.1
reply other threads:[~2024-02-23 4:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240223044954.544990-1-vladimir.mezentsev@oracle.com \
--to=vladimir.mezentsev@oracle.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).