diff -urN intel-pcm.orig/Makefile intel-pcm/Makefile --- intel-pcm.orig/Makefile 2014-04-16 01:01:17.000000000 +0800 +++ intel-pcm/Makefile 2014-10-09 17:12:20.000000000 +0800 @@ -2,11 +2,10 @@ # $FreeBSD: head/sysutils/intel-pcm/Makefile 351350 2014-04-15 17:01:17Z imp $ PORTNAME= intel-pcm -PORTVERSION= 2.6 -PORTREVISION= 2 +PORTVERSION= 2.7 CATEGORIES= sysutils MASTER_SITES= LOCAL/imp -DISTNAME= intelperformancecountermonitorv${PORTVERSION} +DISTNAME= IntelPerformanceCounterMonitorV2b.7 MAINTAINER= imp@FreeBSD.org COMMENT= Intel PCM toolkit diff -urN intel-pcm.orig/distinfo intel-pcm/distinfo --- intel-pcm.orig/distinfo 2014-03-13 06:43:12.000000000 +0800 +++ intel-pcm/distinfo 2014-10-09 17:11:44.000000000 +0800 @@ -1,2 +1,2 @@ -SHA256 (intelperformancecountermonitorv2.6.zip) = 781dcaa0bfa49593878e16db131c31e8f0a401e6e58f8c2786a6d70b1be67857 -SIZE (intelperformancecountermonitorv2.6.zip) = 907379 +SHA256 (IntelPerformanceCounterMonitorV2b.7.zip) = 9a4e79ef04dab84b6d28f9e06f80d666ce0b2ccbf4c2988066248c62b0079ce7 +SIZE (IntelPerformanceCounterMonitorV2b.7.zip) = 927569 diff -urN intel-pcm.orig/files/patch-cpucounters-cpp intel-pcm/files/patch-cpucounters-cpp --- intel-pcm.orig/files/patch-cpucounters-cpp 2014-03-13 06:43:12.000000000 +0800 +++ intel-pcm/files/patch-cpucounters-cpp 1970-01-01 08:00:00.000000000 +0800 @@ -1,12 +0,0 @@ -diff -ru cpucounters.cpp cpucounters.cpp ---- cpucounters.cpp 2013-11-04 05:43:31.000000000 -0700 -+++ cpucounters.cpp 2014-03-07 05:47:24.000000000 -0700 -@@ -681,7 +681,7 @@ - else - apic_ids_per_core = 1; - -- for (i = 0; i < num_cores; i++) -+ for (int i = 0; i < num_cores; i++) - { - char cpuctl_name[64]; - int apic_id; diff -urN intel-pcm.orig/files/patch-cpuctl_check intel-pcm/files/patch-cpuctl_check --- intel-pcm.orig/files/patch-cpuctl_check 2014-04-16 01:01:17.000000000 +0800 +++ intel-pcm/files/patch-cpuctl_check 1970-01-01 08:00:00.000000000 +0800 @@ -1,60 +0,0 @@ -commit f87e1f30a39055cdb3b10964a805a9b5e41e6a77 -Author: Jim Harris -Date: Mon Apr 14 22:59:44 2014 -0700 - - FreeBSD: ensure cpuctl(4) driver is loaded. - - Also do a couple of sanity checks on some of the apic cpuid parsing. - This just ensures we get a sensible error messages rather than an - FPE if some logic bug is found in the apic parsing code. - -diff --git cpucounters.cpp cpucounters.cpp -index df8a802..0a9fc26 100644 ---- cpucounters.cpp -+++ cpucounters.cpp -@@ -63,6 +63,8 @@ int convertUnknownToInt(size_t size, char* value); - #endif - - #if defined (__FreeBSD__) -+#include -+#include - #include - #include - #include -@@ -735,11 +737,23 @@ PCM::PCM() : - std::cerr << "Unable to get kern.smp.cpus from sysctl." << std::endl; - return; - } -+ -+ if (modfind("cpuctl") == -1) -+ { -+ std::cout << "cpuctl(4) not loaded." << std::endl; -+ return; -+ } - - do_cpuid(1, cpuid_args.data); - - apic_ids_per_package = (cpuid_args.data[1] & 0x00FF0000) >> 16; - -+ if (apic_ids_per_package == 0) -+ { -+ std::cout << "apic_ids_per_package == 0" << std::endl; -+ return; -+ } -+ - cpuid_count(0xb, 0x0, cpuid_args.data); - - if ((cpuid_args.data[2] & 0xFF00) == 0x100) -@@ -747,6 +761,12 @@ PCM::PCM() : - else - apic_ids_per_core = 1; - -+ if (apic_ids_per_core == 0) -+ { -+ std::cout << "apic_ids_per_core == 0" << std::endl; -+ return; -+ } -+ - for (int i = 0; i < num_cores; i++) - { - char cpuctl_name[64];