Index: sys/amd64/include/pmc_mdep.h =================================================================== RCS file: /usr/home/kmacy/devel/ncvs/src/sys/amd64/include/pmc_mdep.h,v retrieving revision 1.3 diff -d -u -r1.3 pmc_mdep.h --- sys/amd64/include/pmc_mdep.h 9 Jun 2005 19:45:06 -0000 1.3 +++ sys/amd64/include/pmc_mdep.h 19 Feb 2007 05:04:09 -0000 @@ -33,10 +33,12 @@ #include #include +#include union pmc_md_op_pmcallocate { struct pmc_md_amd_op_pmcallocate pm_amd; struct pmc_md_p4_op_pmcallocate pm_p4; + struct pmc_md_ppro_op_pmcallocate pm_ppro; uint64_t __pad[4]; }; @@ -48,7 +50,8 @@ union pmc_md_pmc { struct pmc_md_amd_pmc pm_amd; + struct pmc_md_ppro_pmc pm_ppro; struct pmc_md_p4_pmc pm_p4; }; Index: sys/dev/hwpmc/hwpmc_x86.c =================================================================== RCS file: /usr/home/kmacy/devel/ncvs/src/sys/dev/hwpmc/hwpmc_x86.c,v retrieving revision 1.5 diff -d -u -r1.5 hwpmc_x86.c --- sys/dev/hwpmc/hwpmc_x86.c 4 Apr 2006 02:36:04 -0000 1.5 +++ sys/dev/hwpmc/hwpmc_x86.c 19 Feb 2007 05:05:21 -0000 @@ -64,7 +64,7 @@ cputype = -1; switch (cpu_id & 0xF00) { -#if defined(__i386__) +#if defined(__i386__) || defined(__amd64__) case 0x500: /* Pentium family processors */ cputype = PMC_CPU_INTEL_P5; break; @@ -82,9 +82,15 @@ case 0x7: case 0x8: case 0xA: case 0xB: cputype = PMC_CPU_INTEL_PIII; break; - case 0x9: case 0xD: case 0xE: + case 0x9: + case 0xD: + case 0xE: + case 0xF: /* XXX this might not be right */ cputype = PMC_CPU_INTEL_PM; break; + default: + printf("cpu_type=0x%x cpu_model=0x%x\n", (cpu_id & 0xF00), + ((cpu_id & 0xF0) >> 4)); } break; #endif @@ -97,6 +103,7 @@ } #endif + if ((int) cputype == -1) { printf("pmc: Unknown Intel CPU.\n"); return NULL; @@ -127,7 +134,7 @@ break; #endif -#if defined(__i386__) +#if defined(__i386__) || defined(__amd64__) /* * P6 Family Processors */ @@ -137,17 +144,17 @@ case PMC_CPU_INTEL_PII: case PMC_CPU_INTEL_PIII: case PMC_CPU_INTEL_PM: - error = pmc_initialize_p6(pmc_mdep); break; /* * Intel Pentium PMCs. */ - +#if defined(__i386__) case PMC_CPU_INTEL_P5: error = pmc_initialize_p5(pmc_mdep); break; +#endif #endif default: @@ -179,12 +186,16 @@ md = pmc_amd_initialize(); else if (strcmp(cpu_vendor, "GenuineIntel") == 0) md = pmc_intel_initialize(); - + else + printf("%s\n", cpu_vendor); /* disallow sampling if we do not have an LAPIC */ if (md != NULL && lapic == NULL) for (i = 1; i < md->pmd_nclass; i++) md->pmd_classes[i].pm_caps &= ~PMC_CAP_INTERRUPT; + if (md->pmd_init == NULL) + printf("pmd_init is NULL\n"); + return md; }