aboutsummaryrefslogtreecommitdiff
path: root/gprofng/common/hwc_cpus.h
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2024-01-08 22:00:24 -0800
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2024-01-10 09:31:08 -0800
commit8fe04eeb2cbb8c4cf7b6e8d9183fe09a8b2e8d51 (patch)
treec3c29dfecf57ea78d8de663665a8c4ab53706b6a /gprofng/common/hwc_cpus.h
parente1cab50d2dd3d416662b5399bd80e6311a6ade0e (diff)
downloadgdb-8fe04eeb2cbb8c4cf7b6e8d9183fe09a8b2e8d51.zip
gdb-8fe04eeb2cbb8c4cf7b6e8d9183fe09a8b2e8d51.tar.gz
gdb-8fe04eeb2cbb8c4cf7b6e8d9183fe09a8b2e8d51.tar.bz2
gprofng: 31123 improvements to hardware event implementation
Our hardware counter profiling is based on perf_event_open(). Our HWC tables are absent for new machines. I have added HWC tables for the following events: PERF_TYPE_HARDWARE, PERF_TYPE_SOFTWARE, PERF_TYPE_HW_CACHE. Other events require additional fixes. Did a little cleaning: marked the symbols as static, used Stringbuilder, created a function to read /proc/cpuinfo. gprofng/ChangeLog 2024-01-08 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/31123 * common/core_pcbe.c: Mark the symbols as static. Add events_generic[]. * common/hwc_cpus.h: Declare a new function read_cpuinfo. * common/hwcdrv.c: Add a new parameter in init_perf_event(). * common/hwcentry.h: Add use_perf_event_type in Hwcentry. * common/hwcfuncs.c (process_data_descriptor): Read use_perf_event_type, type, config. * common/hwctable.c: Add a new HWC table generic_list[]. * common/opteron_pcbe.c (opt_pcbe_init): Accept AMD machines. * src/collctrl.cc: Use StringBuilder in Coll_Ctrl::build_data_desc(). Add a new function read_cpuinfo.
Diffstat (limited to 'gprofng/common/hwc_cpus.h')
-rw-r--r--gprofng/common/hwc_cpus.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gprofng/common/hwc_cpus.h b/gprofng/common/hwc_cpus.h
index 634aa4f..34896d6 100644
--- a/gprofng/common/hwc_cpus.h
+++ b/gprofng/common/hwc_cpus.h
@@ -23,6 +23,19 @@
#ifndef __HWC_CPUS_H
#define __HWC_CPUS_H
+typedef struct
+{
+ int cpu_cnt;
+ int cpu_clk_freq;
+ int cpu_model;
+ int cpu_family;
+ int cpu_vendor;
+ char *cpu_vendorstr;
+ char *cpu_modelstr;
+} cpu_info_t;
+
+extern cpu_info_t *read_cpuinfo();
+
#define MAX_PICS 20 /* Max # of HW ctrs that can be enabled simultaneously */
/* type for specifying CPU register number */
@@ -91,6 +104,8 @@
#define CPC_AMD_FAM_10H 2501 /* Barcelona, Shanghai... */
#define CPC_AMD_FAM_11H 2502 /* Griffin... */
#define CPC_AMD_FAM_15H 2503
+#define CPC_AMD_Authentic 2504
+
#define CPC_KPROF 3003 // OBSOLETE (To support 12.3 and earlier)
#define CPC_FOX 3004 /* pseudo-chip */
@@ -191,6 +206,7 @@ enum {
{CPC_ULTRA2 , "UltraSPARC I&II"}, \
{CPC_ULTRA1 , "UltraSPARC I&II"}, \
{ARM_CPU_IMP_APM , AARCH64_VENDORSTR_ARM}, \
+ {CPC_AMD_Authentic , "AuthenticAMD"}, \
{0, NULL}
/* init like this:
static libcpc2_cpu_lookup_t cpu_table[]={LIBCPC2_CPU_LOOKUP_LIST};