From fd3efa526581a04fdf3ea57b28340c3b6bc3830e Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Wed, 3 Jan 2024 12:43:36 +0100 Subject: [PATCH] Skip NOTYPE units in finalize --- src/includes/perfmon_broadwell.h | 2 +- src/includes/perfmon_haswell.h | 2 +- src/includes/perfmon_icelake.h | 2 +- src/includes/perfmon_ivybridge.h | 2 +- src/includes/perfmon_sandybridge.h | 2 +- src/includes/perfmon_sapphirerapids.h | 2 +- src/includes/perfmon_skylake.h | 2 +- src/includes/perfmon_tigerlake.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/includes/perfmon_broadwell.h b/src/includes/perfmon_broadwell.h index 3d2dc1fea..6f60734f7 100644 --- a/src/includes/perfmon_broadwell.h +++ b/src/includes/perfmon_broadwell.h @@ -1955,7 +1955,7 @@ int perfmon_finalizeCountersThread_broadwell(int thread_id, PerfmonEventSet* eve default: break; } - if ((reg) && (((type == PMC)||(type == FIXED))||((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))||((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { CHECK_MSR_READ_ERROR(HPMread(cpu_id, dev, reg, &ovf_values_uncore)); VERBOSEPRINTPCIREG(cpu_id, dev, reg, ovf_values_uncore, SHOW_CTL); diff --git a/src/includes/perfmon_haswell.h b/src/includes/perfmon_haswell.h index 088501a79..d190b5afc 100644 --- a/src/includes/perfmon_haswell.h +++ b/src/includes/perfmon_haswell.h @@ -1974,7 +1974,7 @@ int perfmon_finalizeCountersThread_haswell(int thread_id, PerfmonEventSet* event }*/ break; } - if ((reg) && (((type == PMC)||(type == FIXED))||((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))||((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { ovf_values_uncore = 0x0ULL; VERBOSEPRINTPCIREG(cpu_id, dev, reg, 0x0ULL, CLEAR_CTL); diff --git a/src/includes/perfmon_icelake.h b/src/includes/perfmon_icelake.h index 702d6366d..a2bcdbf22 100644 --- a/src/includes/perfmon_icelake.h +++ b/src/includes/perfmon_icelake.h @@ -2110,7 +2110,7 @@ int perfmon_finalizeCountersThread_icelake(int thread_id, PerfmonEventSet* event default: break; } - if ((reg) && (((type == PMC)||(type == FIXED))||(type == METRICS)|| ((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))||(type == METRICS)|| ((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { CHECK_MSR_READ_ERROR(HPMread(cpu_id, dev, reg, &ovf_values_uncore)); VERBOSEPRINTPCIREG(cpu_id, dev, reg, ovf_values_uncore, SHOW_CTL); diff --git a/src/includes/perfmon_ivybridge.h b/src/includes/perfmon_ivybridge.h index 6287a5811..3f3c9cd4b 100644 --- a/src/includes/perfmon_ivybridge.h +++ b/src/includes/perfmon_ivybridge.h @@ -1629,7 +1629,7 @@ int perfmon_finalizeCountersThread_ivybridge(int thread_id, PerfmonEventSet* eve default: break; } - if ((reg) && (((type == PMC)||(type == FIXED))||((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))||((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { VERBOSEPRINTPCIREG(cpu_id, dev, reg, 0x0ULL, CLEAR_CTL); CHECK_PCI_WRITE_ERROR(HPMwrite(cpu_id, dev, reg, 0x0ULL)); diff --git a/src/includes/perfmon_sandybridge.h b/src/includes/perfmon_sandybridge.h index f0f96a08d..210f57cdf 100644 --- a/src/includes/perfmon_sandybridge.h +++ b/src/includes/perfmon_sandybridge.h @@ -1952,7 +1952,7 @@ int perfmon_finalizeCountersThread_sandybridge(int thread_id, PerfmonEventSet* e break; } if ((reg) && - (((type == PMC)||(type == FIXED)) || ((type >= UNCORE) && (haveLock) && (HPMcheck(dev, cpu_id))))) + (((type == PMC)||(type == FIXED)) || ((type >= UNCORE && type < NUM_UNITS) && (haveLock) && (HPMcheck(dev, cpu_id))))) { VERBOSEPRINTPCIREG(cpu_id, dev, reg, 0x0ULL, CLEAR_CTL); CHECK_MSR_WRITE_ERROR(HPMwrite(cpu_id, dev, reg, 0x0ULL)); diff --git a/src/includes/perfmon_sapphirerapids.h b/src/includes/perfmon_sapphirerapids.h index 5faaa6ecf..1a99dd517 100644 --- a/src/includes/perfmon_sapphirerapids.h +++ b/src/includes/perfmon_sapphirerapids.h @@ -2217,7 +2217,7 @@ int perfmon_finalizeCountersThread_sapphirerapids(int thread_id, PerfmonEventSet default: break; } - if ((reg) && (((type == PMC)||(type == FIXED))||(type == METRICS)|| ((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))||(type == METRICS)|| ((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { CHECK_MSR_READ_ERROR(HPMread(cpu_id, dev, reg, &ovf_values_uncore)); VERBOSEPRINTPCIREG(cpu_id, dev, reg, ovf_values_uncore, SHOW_CTL); diff --git a/src/includes/perfmon_skylake.h b/src/includes/perfmon_skylake.h index 0952e0067..934aa5701 100644 --- a/src/includes/perfmon_skylake.h +++ b/src/includes/perfmon_skylake.h @@ -1833,7 +1833,7 @@ int perfmon_finalizeCountersThread_skylake(int thread_id, PerfmonEventSet* event default: break; } - if ((reg) && (((type == PMC)||(type == FIXED))|| ((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))|| ((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { CHECK_MSR_READ_ERROR(HPMread(cpu_id, dev, reg, &ovf_values_uncore)); VERBOSEPRINTPCIREG(cpu_id, dev, reg, ovf_values_uncore, SHOW_CTL); diff --git a/src/includes/perfmon_tigerlake.h b/src/includes/perfmon_tigerlake.h index 4efdfe7e5..668df8504 100644 --- a/src/includes/perfmon_tigerlake.h +++ b/src/includes/perfmon_tigerlake.h @@ -527,7 +527,7 @@ int perfmon_finalizeCountersThread_tigerlake(int thread_id, PerfmonEventSet* eve default: break; } - if ((reg) && (((type == PMC)||(type == FIXED))||(type == METRICS)|| ((type >= UNCORE) && (haveLock)))) + if ((reg) && (((type == PMC)||(type == FIXED))||(type == METRICS)|| ((type >= UNCORE && type < NUM_UNITS) && (haveLock)))) { CHECK_MSR_READ_ERROR(HPMread(cpu_id, dev, reg, &ovf_values_uncore)); VERBOSEPRINTPCIREG(cpu_id, dev, reg, ovf_values_uncore, SHOW_CTL);