This patch adds the detection of AMD Family 10h RevD (Istanbul) cpus. Signed-off-by: Robert Richter <robert.rich...@amd.com> --- lib/pfmlib_amd64.c | 14 ++++++++++---- lib/pfmlib_amd64_priv.h | 11 +++++++---- 2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/lib/pfmlib_amd64.c b/lib/pfmlib_amd64.c index 8f305de..f8bee8c 100644 --- a/lib/pfmlib_amd64.c +++ b/lib/pfmlib_amd64.c @@ -132,11 +132,17 @@ amd64_get_revision(int family, int model, int stepping) return AMD64_K8_REV_B; } } else if (family == 16) { - if (model <= 3) - return AMD64_FAM10H_REV_B; - if (model <= 6) + switch (model) { + case 4: + case 5: + case 6: return AMD64_FAM10H_REV_C; - return AMD64_FAM10H_REV_B; + case 8: + case 9: + return AMD64_FAM10H_REV_D; + default: + return AMD64_FAM10H_REV_B; + } } return AMD64_CPU_UN; diff --git a/lib/pfmlib_amd64_priv.h b/lib/pfmlib_amd64_priv.h index 51dea1d..661ca58 100644 --- a/lib/pfmlib_amd64_priv.h +++ b/lib/pfmlib_amd64_priv.h @@ -67,13 +67,14 @@ typedef enum { AMD64_K8_REV_G, AMD64_FAM10H_REV_B, AMD64_FAM10H_REV_C, + AMD64_FAM10H_REV_D, } amd64_rev_t; static const char *amd64_rev_strs[]= { - "?", "B", "C", "D", "E", "F", "G", "B", "C" + "?", "?", "B", "C", "D", "E", "F", "G", "B", "C", "D" }; -static const char *amd64_cpu_strs[]= { +static const char *amd64_cpu_strs[] = { "unknown model", "K7", "K8 RevB", @@ -82,8 +83,9 @@ static const char *amd64_cpu_strs[]= { "K8 RevE", "K8 RevF", "K8 RevG", - "Barcelona RevB", - "Barcelona RevC", + "Family 10h RevB, Barcelona", + "Family 10h RevC, Shanghai", + "Family 10h RevD, Istanbul", }; /* @@ -97,6 +99,7 @@ static const char *amd64_cpu_strs[]= { #define PFMLIB_AMD64_K8_REV_F PFMLIB_AMD64_FROM_REV(AMD64_K8_REV_F) #define PFMLIB_AMD64_FAM10H_REV_C PFMLIB_AMD64_FROM_REV(AMD64_FAM10H_REV_C) #define PFMLIB_AMD64_TILL_FAM10H_REV_C PFMLIB_AMD64_TILL_REV(AMD64_FAM10H_REV_C) +#define PFMLIB_AMD64_FAM10H_REV_D PFMLIB_AMD64_FROM_REV(AMD64_FAM10H_REV_D) static inline int from_revision(unsigned int flags) { -- 1.6.1.2 ------------------------------------------------------------------------------ _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel