summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2020-07-14 18:11:05 +0000
committerAlexander Motin <mav@FreeBSD.org>2020-07-14 18:11:05 +0000
commit1791cad0a99ffa1cba463ac97e4fde7cb78869e0 (patch)
treed1b169f3061906b412060708a4c3e7de0438dad2 /lib
parent083c26289906f8c9628a5ad0abb4a6cf7cc14f1f (diff)
downloadsrc-test2-1791cad0a99ffa1cba463ac97e4fde7cb78869e0.tar.gz
src-test2-1791cad0a99ffa1cba463ac97e4fde7cb78869e0.zip
Add stepping to the kern.hwpmc.cpuid string on x86.
It follows the equivalent Linux change to be able to differentiate skylakex and cascadelakex, sharing the same model but not stepping. This fixes skylakex handling broken by r363144. MFC after: 6 days
Notes
Notes: svn path=/head/; revision=363188
Diffstat (limited to 'lib')
-rw-r--r--lib/libpmc/libpmc_pmu_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index f451c37a0592..11949a3ad3cd 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -169,7 +169,7 @@ pmu_events_map_get(const char *cpuid)
{
regex_t re;
regmatch_t pmatch[1];
- size_t s, len;
+ size_t s;
char buf[64];
int match;
const struct pmu_events_map *pme;
@@ -193,8 +193,8 @@ pmu_events_map_get(const char *cpuid)
match = regexec(&re, buf, 1, pmatch, 0);
regfree(&re);
if (match == 0) {
- len = pmatch[0].rm_eo - pmatch[0].rm_so;
- if(len == strlen(buf))
+ if (pmatch[0].rm_so == 0 && (buf[pmatch[0].rm_eo] == 0
+ || buf[pmatch[0].rm_eo] == '-'))
return (pme);
}
}