diff --git a/src/includes/perfmon_broadwell.h b/src/includes/perfmon_broadwell.h index 3d2dc1fe..6f60734f 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 088501a7..d190b5af 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 702d6366..a2bcdbf2 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 6287a581..3f3c9cd4 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 f0f96a08..210f57cd 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 5faaa6ec..1a99dd51 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 0952e006..934aa570 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 4efdfe7e..668df850 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);