View | Details | Raw Unified | Return to bug 194267 | Differences between
and this patch

Collapse All | Expand All

(-)intel-pcm/Makefile (-3 / +2 lines)
Lines 2-12 Link Here
2
# $FreeBSD: head/sysutils/intel-pcm/Makefile 351350 2014-04-15 17:01:17Z imp $
2
# $FreeBSD: head/sysutils/intel-pcm/Makefile 351350 2014-04-15 17:01:17Z imp $
3
3
4
PORTNAME=	intel-pcm
4
PORTNAME=	intel-pcm
5
PORTVERSION=	2.6
5
PORTVERSION=	2.7
6
PORTREVISION=	2
7
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
8
MASTER_SITES=	LOCAL/imp
7
MASTER_SITES=	LOCAL/imp
9
DISTNAME=	intelperformancecountermonitorv${PORTVERSION}
8
DISTNAME=	IntelPerformanceCounterMonitorV2b.7
10
9
11
MAINTAINER=	imp@FreeBSD.org
10
MAINTAINER=	imp@FreeBSD.org
12
COMMENT=	Intel PCM toolkit
11
COMMENT=	Intel PCM toolkit
(-)intel-pcm/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (intelperformancecountermonitorv2.6.zip) = 781dcaa0bfa49593878e16db131c31e8f0a401e6e58f8c2786a6d70b1be67857
1
SHA256 (IntelPerformanceCounterMonitorV2b.7.zip) = 9a4e79ef04dab84b6d28f9e06f80d666ce0b2ccbf4c2988066248c62b0079ce7
2
SIZE (intelperformancecountermonitorv2.6.zip) = 907379
2
SIZE (IntelPerformanceCounterMonitorV2b.7.zip) = 927569
(-)intel-pcm/files/patch-cpucounters-cpp (-12 lines)
Lines 1-12 Link Here
1
diff -ru cpucounters.cpp cpucounters.cpp
2
--- cpucounters.cpp	2013-11-04 05:43:31.000000000 -0700
3
+++ cpucounters.cpp	2014-03-07 05:47:24.000000000 -0700
4
@@ -681,7 +681,7 @@
5
     else
6
         apic_ids_per_core = 1;
7
 
8
-    for (i = 0; i < num_cores; i++)
9
+    for (int i = 0; i < num_cores; i++)
10
     {
11
         char cpuctl_name[64];
12
         int apic_id;
(-)intel-pcm/files/patch-cpuctl_check (-60 lines)
Lines 1-60 Link Here
1
commit f87e1f30a39055cdb3b10964a805a9b5e41e6a77
2
Author: Jim Harris <james.r.harris@intel.com>
3
Date:   Mon Apr 14 22:59:44 2014 -0700
4
5
    FreeBSD: ensure cpuctl(4) driver is loaded.
6
    
7
    Also do a couple of sanity checks on some of the apic cpuid parsing.
8
    This just ensures we get a sensible error messages rather than an
9
    FPE if some logic bug is found in the apic parsing code.
10
11
diff --git cpucounters.cpp cpucounters.cpp
12
index df8a802..0a9fc26 100644
13
--- cpucounters.cpp
14
+++ cpucounters.cpp
15
@@ -63,6 +63,8 @@ int convertUnknownToInt(size_t size, char* value);
16
 #endif
17
 
18
 #if defined (__FreeBSD__)
19
+#include <sys/param.h>
20
+#include <sys/module.h>
21
 #include <sys/types.h>
22
 #include <sys/sysctl.h>
23
 #include <sys/sem.h>
24
@@ -735,11 +737,23 @@ PCM::PCM() :
25
         std::cerr << "Unable to get kern.smp.cpus from sysctl." << std::endl;
26
         return;
27
     }
28
+
29
+    if (modfind("cpuctl") == -1)
30
+    {
31
+        std::cout << "cpuctl(4) not loaded." << std::endl;
32
+        return;
33
+    }
34
  
35
     do_cpuid(1, cpuid_args.data);
36
 
37
     apic_ids_per_package = (cpuid_args.data[1] & 0x00FF0000) >> 16;
38
 
39
+    if (apic_ids_per_package == 0)
40
+    {
41
+        std::cout << "apic_ids_per_package == 0" << std::endl;
42
+        return;
43
+    }
44
+
45
     cpuid_count(0xb, 0x0, cpuid_args.data);
46
 
47
     if ((cpuid_args.data[2] & 0xFF00) == 0x100)
48
@@ -747,6 +761,12 @@ PCM::PCM() :
49
     else
50
         apic_ids_per_core = 1;
51
 
52
+    if (apic_ids_per_core == 0)
53
+    {
54
+        std::cout << "apic_ids_per_core == 0" << std::endl;
55
+        return;
56
+    }
57
+
58
     for (int i = 0; i < num_cores; i++)
59
     {
60
         char cpuctl_name[64];

Return to bug 194267