From ler@lerctr.org  Fri Feb 24 00:23:06 2006
Return-Path: <ler@lerctr.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C052816A423
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Feb 2006 00:23:06 +0000 (GMT)
	(envelope-from ler@lerctr.org)
Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [192.147.25.65])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E2C5843D58
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Feb 2006 00:23:03 +0000 (GMT)
	(envelope-from ler@lerctr.org)
Received: from ler by thebighonker.lerctr.org with local (Exim 4.60 (FreeBSD))
	(envelope-from <ler@lerctr.org>)
	id 1FCQjf-0000Qg-9P
	for FreeBSD-gnats-submit@freebsd.org; Thu, 23 Feb 2006 18:23:03 -0600
Message-Id: <E1FCQjf-0000Qg-9P@thebighonker.lerctr.org>
Date: Thu, 23 Feb 2006 18:23:03 -0600
From: Larry Rosenman <ler@lerctr.org>
Reply-To: Larry Rosenman <ler@lerctr.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: kldloaded hwpmc doesn't see all 4 cpu's...
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         93773
>Category:       kern
>Synopsis:       [hwpmc] kldloaded hwpmc doesn't see all 4 cpu's...
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jkoshy
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 24 00:30:10 GMT 2006
>Closed-Date:    Mon Feb 27 14:27:51 GMT 2006
>Last-Modified:  Mon Feb 27 14:27:51 GMT 2006
>Originator:     Larry Rosenman
>Release:        FreeBSD 6.1-PRERELEASE amd64
>Organization:
LERCTR Consulting
>Environment:
System: FreeBSD thebighonker.lerctr.org 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #14: Thu Feb 23 16:01:40 CST 2006 root@thebighonker.lerctr.org:/usr/obj/usr/src/sys/THEBIGHONKER amd64


>Description:
Being the curious type, I tried to play with the hwpmc stuff.  When I issue
a pmccontrol -l, it complains about cpu 1 device not configured.  

I had kldloaded hwpmc.


$ sysctl hw
hw.machine: amd64
hw.model: Intel(R) Xeon(TM) CPU 3.00GHz
hw.ncpu: 4
hw.byteorder: 1234
hw.physmem: 4286386176
hw.usermem: 4071378944
hw.pagesize: 4096
hw.floatingpoint: 1
hw.machine_arch: amd64
hw.realmem: 5368709120
hw.ata.wc: 1
hw.ata.atapi_dma: 1
hw.ata.ata_dma: 1
hw.pci.do_power_resume: 1
hw.pci.do_power_nodriver: 0
hw.pci.enable_io_modes: 1
hw.pci.host_mem_start: 2147483648
hw.intr_storm_threshold: 500
hw.availpages: 1046481
hw.bus.devctl_disable: 0
hw.busdma.total_bpages: 34
hw.busdma.zone0.total_bpages: 1
hw.busdma.zone0.free_bpages: 1
hw.busdma.zone0.reserved_bpages: 0
hw.busdma.zone0.active_bpages: 0
hw.busdma.zone0.total_bounced: 0
hw.busdma.zone0.total_deferred: 0
hw.busdma.zone0.lowaddr: 0xfffffffffffffff
hw.busdma.zone0.alignment: 128
hw.busdma.zone0.boundary: 0
hw.busdma.zone1.total_bpages: 1
hw.busdma.zone1.free_bpages: 1
hw.busdma.zone1.reserved_bpages: 0
hw.busdma.zone1.active_bpages: 0
hw.busdma.zone1.total_bounced: 0
hw.busdma.zone1.total_deferred: 0
hw.busdma.zone1.lowaddr: 0xffffffff
hw.busdma.zone1.alignment: 4096
hw.busdma.zone1.boundary: 0
hw.busdma.zone2.total_bpages: 32
hw.busdma.zone2.free_bpages: 32
hw.busdma.zone2.reserved_bpages: 0
hw.busdma.zone2.active_bpages: 0
hw.busdma.zone2.total_bounced: 0
hw.busdma.zone2.total_deferred: 0
hw.busdma.zone2.lowaddr: 0xffffffff
hw.busdma.zone2.alignment: 2
hw.busdma.zone2.boundary: 65536
hw.clockrate: 2992
hw.instruction_sse: 1
hw.psm.tap_timeout: 125000
hw.psm.tap_threshold: 25
hw.kbd.keymap_restrict_change: 0
hw.syscons.kbd_debug: 1
hw.syscons.kbd_reboot: 1
hw.syscons.bell: 1
hw.syscons.saver.keybonly: 1
hw.syscons.sc_no_suspend_vtswitch: 0
hw.acpi.supported_sleep_state: S1 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S1
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: S1
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 1
hw.acpi.s4bios: 0
hw.acpi.verbose: 0
hw.acpi.cpu.cx_supported: C1/0
hw.acpi.cpu.cx_lowest: C1
hw.acpi.cpu.cx_usage: 100.00%
hw.dri.0.name: mach64 0x26
hw.dri.0.vm: 
slot	 offset	      size type flags	 address mtrr

hw.dri.0.clients: 
a dev	pid    uid	magic	  ioctls

hw.dri.0.debug: 0
$ kldstat

Id Refs Address            Size     Name
 1    3 0xffffffff80100000 619198   kernel
 2    1 0xffffffff8071a000 1c310    geom_mirror.ko
 3    1 0xffffffffb5f97000 9329     hwpmc.ko
$ 
>How-To-Repeat:
$ pmccontrol -l
#CPU 0:
#N  NAME             CLASS  STATE    ROW-DISP
 0  TSC              TSC    ENABLED  FREE
 1  BPU_COUNTER0     P4     ENABLED  FREE
 2  BPU_COUNTER1     P4     ENABLED  FREE
 3  BPU_COUNTER2     P4     ENABLED  FREE
 4  BPU_COUNTER3     P4     ENABLED  FREE
 5  MS_COUNTER0      P4     ENABLED  FREE
 6  MS_COUNTER1      P4     ENABLED  FREE
 7  MS_COUNTER2      P4     ENABLED  FREE
 8  MS_COUNTER3      P4     ENABLED  FREE
 9  FLAME_COUNTER0   P4     ENABLED  FREE
 10 FLAME_COUNTER1   P4     ENABLED  FREE
 11 FLAME_COUNTER2   P4     ENABLED  FREE
 12 FLAME_COUNTER3   P4     ENABLED  FREE
 13 IQ_COUNTER0      P4     ENABLED  FREE
 14 IQ_COUNTER1      P4     ENABLED  FREE
 15 IQ_COUNTER2      P4     ENABLED  FREE
 16 IQ_COUNTER3      P4     ENABLED  FREE
 17 IQ_COUNTER4      P4     ENABLED  FREE
 18 IQ_COUNTER5      P4     ENABLED  FREE
pmccontrol: Unable to get PMC status for CPU 1: Device not configured
$

I can provide shell and priv'd access if y'all want.....
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jkoshy 
Responsible-Changed-By: jkoshy 
Responsible-Changed-When: Fri Feb 24 01:14:39 UTC 2006 
Responsible-Changed-Why:  
I'll look into this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93773 

From: Joseph Koshy <jkoshy@FreeBSD.org>
To: 4@FreeBSD.org, all@FreeBSD.org, cpus...@FreeBSD.org,
        freebsd-gnats-submit@FreeBSD.org, see@FreeBSD.org
Cc: ler@lerctr.org
Subject: Re: kern/93773: kldloaded hwpmc doesnt
Date: Fri, 24 Feb 2006 01:21:08 GMT

 Could you please the output of "dmesg".  Was any CPU turned off using machdep.htl_cpus or machdep.hlt_logical_cpus.
 

From: Larry Rosenman <ler@lerctr.org>
To: Joseph Koshy <jkoshy@FreeBSD.org>
Cc: 4@FreeBSD.org, all@FreeBSD.org, cpus...@FreeBSD.org,
    freebsd-gnats-submit@FreeBSD.org, see@FreeBSD.org
Subject: Re: kern/93773: kldloaded hwpmc doesnt
Date: Thu, 23 Feb 2006 19:24:43 -0600

 Joseph Koshy writes:
 
 > 
 > Could you please the output of "dmesg".  
 Below...
 >Was any CPU turned off using machdep.htl_cpus or machdep.hlt_logical_cpus.
 > 
 
 not intentionally...
 
 $ sysctl machdep
 machdep.adjkerntz: 21600
 machdep.disable_rtc_set: 0
 machdep.wall_cmos_clock: 1
 machdep.acpi_timer_freq: 3579545
 machdep.acpi_root: 1009888
 machdep.disable_mtrrs: 0
 machdep.cpu_idle_hlt: 1
 machdep.hlt_cpus: 10
 machdep.panic_on_nmi: 1
 machdep.tsc_freq: 2992510058
 machdep.i8254_freq: 1193182
 machdep.conspeed: 9600
 machdep.gdbspeed: 9600
 machdep.conrclk: 1843200
 machdep.enable_panic_key: 0
 machdep.hlt_logical_cpus: 0
 machdep.logical_cpus_mask: 10
 machdep.hyperthreading_allowed: 0
 $ 
 
 
 Dmesg:
 
 Copyright (c) 1992-2006 The FreeBSD Project.
 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
 	The Regents of the University of California. All rights reserved.
 FreeBSD 6.1-PRERELEASE #14: Thu Feb 23 16:01:40 CST 2006
     root@thebighonker.lerctr.org:/usr/obj/usr/src/sys/THEBIGHONKER
 Timecounter "i8254" frequency 1193182 Hz quality 0
 CPU: Intel(R) Xeon(TM) CPU 3.00GHz (2992.51-MHz K8-class CPU)
   Origin = "GenuineIntel"  Id = 0xf43  Stepping = 3
   Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
   Features2=0x641d<SSE3,RSVD2,MON,DS_CPL,CNTX-ID,CX16,<b14>>
   AMD Features=0x20100800<SYSCALL,NX,LM>
   Hyperthreading: 2 logical CPUs
 real memory  = 5368709120 (5120 MB)
 avail memory = 4117876736 (3927 MB)
 ACPI APIC Table: <PTLTD  	 APIC  >
 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
  cpu0 (BSP): APIC ID:  0
  cpu1 (AP): APIC ID:  1
  cpu2 (AP): APIC ID:  6
  cpu3 (AP): APIC ID:  7
 ioapic0 <Version 2.0> irqs 0-23 on motherboard
 ioapic1 <Version 2.0> irqs 24-47 on motherboard
 ioapic2 <Version 2.0> irqs 48-71 on motherboard
 acpi0: <PTLTD   RSDT> on motherboard
 acpi0: Power Button (fixed)
 Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
 cpu0: <ACPI CPU> on acpi0
 cpu1: <ACPI CPU> on acpi0
 cpu2: <ACPI CPU> on acpi0
 cpu3: <ACPI CPU> on acpi0
 pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
 pci0: <ACPI PCI bus> on pcib0
 pci0: <unknown> at device 0.1 (no driver attached)
 pci0: <base peripheral> at device 1.0 (no driver attached)
 pcib1: <ACPI PCI-PCI bridge> irq 16 at device 2.0 on pci0
 pci1: <ACPI PCI bus> on pcib1
 pcib2: <ACPI PCI-PCI bridge> at device 0.0 on pci1
 pci2: <ACPI PCI bus> on pcib2
 ahd0: <Adaptec AIC7902 Ultra320 SCSI adapter> port 0x2400-0x24ff,0x2000-0x20ff mem 0xdd200000-0xdd201fff irq 32 at device 2.0 on pci2
 ahd0: [GIANT-LOCKED]
 aic7902: Ultra320 Wide Channel A, SCSI Id=7, PCI-X 101-133Mhz, 512 SCBs
 ahd1: <Adaptec AIC7902 Ultra320 SCSI adapter> port 0x2c00-0x2cff,0x2800-0x28ff mem 0xdd202000-0xdd203fff irq 33 at device 2.1 on pci2
 ahd1: [GIANT-LOCKED]
 aic7902: Ultra320 Wide Channel B, SCSI Id=7, PCI-X 101-133Mhz, 512 SCBs
 pci1: <base peripheral, interrupt controller> at device 0.1 (no driver attached)
 pcib3: <ACPI PCI-PCI bridge> at device 0.2 on pci1
 pci3: <ACPI PCI bus> on pcib3
 em0: <Intel(R) PRO/1000 Network Connection Version - 3.2.18> port 0x3000-0x303f mem 0xdd300000-0xdd31ffff irq 54 at device 2.0 on pci3
 em0: Ethernet address: 00:30:48:2e:99:ba
 em1: <Intel(R) PRO/1000 Network Connection Version - 3.2.18> port 0x3040-0x307f mem 0xdd320000-0xdd33ffff irq 55 at device 2.1 on pci3
 em1: Ethernet address: 00:30:48:2e:99:bb
 pci1: <base peripheral, interrupt controller> at device 0.3 (no driver attached)
 pcib4: <ACPI PCI-PCI bridge> irq 16 at device 4.0 on pci0
 pci4: <ACPI PCI bus> on pcib4
 pcib5: <ACPI PCI-PCI bridge> irq 16 at device 6.0 on pci0
 pci5: <ACPI PCI bus> on pcib5
 uhci0: <Intel 82801EB (ICH5) USB controller USB-A> port 0x1400-0x141f irq 16 at device 29.0 on pci0
 uhci0: [GIANT-LOCKED]
 usb0: <Intel 82801EB (ICH5) USB controller USB-A> on uhci0
 usb0: USB revision 1.0
 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub0: 2 ports with 2 removable, self powered
 uhci1: <Intel 82801EB (ICH5) USB controller USB-B> port 0x1420-0x143f irq 19 at device 29.1 on pci0
 uhci1: [GIANT-LOCKED]
 usb1: <Intel 82801EB (ICH5) USB controller USB-B> on uhci1
 usb1: USB revision 1.0
 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub1: 2 ports with 2 removable, self powered
 uhci2: <Intel 82801EB (ICH5) USB controller USB-C> port 0x1440-0x145f irq 18 at device 29.2 on pci0
 uhci2: [GIANT-LOCKED]
 usb2: <Intel 82801EB (ICH5) USB controller USB-C> on uhci2
 usb2: USB revision 1.0
 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub2: 2 ports with 2 removable, self powered
 uhci3: <Intel 82801EB (ICH5) USB controller USB-D> port 0x1460-0x147f irq 16 at device 29.3 on pci0
 uhci3: [GIANT-LOCKED]
 usb3: <Intel 82801EB (ICH5) USB controller USB-D> on uhci3
 usb3: USB revision 1.0
 uhub3: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub3: 2 ports with 2 removable, self powered
 ehci0: <Intel 82801EB/R (ICH5) USB 2.0 controller> mem 0xdd001000-0xdd0013ff irq 23 at device 29.7 on pci0
 ehci0: [GIANT-LOCKED]
 usb4: EHCI version 1.0
 usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
 usb4: <Intel 82801EB/R (ICH5) USB 2.0 controller> on ehci0
 usb4: USB revision 2.0
 uhub4: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
 uhub4: 8 ports with 8 removable, self powered
 pcib6: <ACPI PCI-PCI bridge> at device 30.0 on pci0
 pci6: <ACPI PCI bus> on pcib6
 drm0: <Rage XL> port 0x4000-0x40ff mem 0xde000000-0xdeffffff,0xdd400000-0xdd400fff irq 17 at device 1.0 on pci6
 info: [drm] Initialized mach64 1.0.0 20020904
 isab0: <PCI-ISA bridge> at device 31.0 on pci0
 isa0: <ISA bus> on isab0
 atapci0: <Intel ICH5 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x14a0-0x14af at device 31.1 on pci0
 ata0: <ATA channel 0> on atapci0
 ata1: <ATA channel 1> on atapci0
 ichsmb0: <Intel 82801EB (ICH5) SMBus controller> port 0x1100-0x111f irq 17 at device 31.3 on pci0
 ichsmb0: [GIANT-LOCKED]
 smbus0: <System Management Bus> on ichsmb0
 smb0: <SMBus generic I/O> on smbus0
 acpi_button0: <Power Button> on acpi0
 atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
 sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
 sio0: type 16550A
 sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0
 sio1: type 16550A
 fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
 fdc0: [FAST]
 fd0: <1440-KB 3.5" drive> on fdc0 drive 0
 orm0: <ISA Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xc8fff,0xd3000-0xd3fff,0xd4000-0xd4fff on isa0
 sc0: <System console> at flags 0x100 on isa0
 sc0: VGA <16 virtual consoles, flags=0x300>
 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
 Timecounters tick every 1.000 msec
 acd0: DVDROM <MATSHITADVD-ROM SR-8177/NE16> at ata1-slave UDMA33
 Waiting 5 seconds for SCSI devices to settle
 (probe6:ahd0:0:6:0): No or incomplete CDB sent to device.
 ahd0: Issued Channel A Bus Reset. 12 SCBs aborted
 ses0 at ahd0 bus 0 target 6 lun 0
 ses0: <SUPER GEM318 0> Fixed Processor SCSI-2 device 
 ses0: 3.300MB/s transfers
 ses0: SAF-TE Compliant Device
 da0 at ahd0 bus 0 target 0 lun 0
 da0: <SEAGATE ST3146707LC 0004> Fixed Direct Access SCSI-3 device 
 da0: 320.000MB/s transfers (160.000MHz, offset 63, 16bit), Tagged Queueing Enabled
 da0: 140014MB (286749488 512 byte sectors: 255H 63S/T 17849C)
 da1 at ahd0 bus 0 target 1 lun 0
 da1: <SEAGATE ST3146707LC 0004> Fixed Direct Access SCSI-3 device 
 da1: 320.000MB/s transfers (160.000MHz, offset 63, 16bit), Tagged Queueing Enabled
 da1: 140014MB (286749488 512 byte sectors: 255H 63S/T 17849C)
 SMP: AP CPU #1 Launched!
 SMP: AP CPU #2 Launched!
 SMP: AP CPU #3 Launched!
 GEOM_MIRROR: Device gm0 created (id=2704749101).
 GEOM_MIRROR: Device gm0: provider da0 detected.
 GEOM_MIRROR: Device gm0: provider da1 detected.
 GEOM_MIRROR: Device gm0: provider da1 activated.
 GEOM_MIRROR: Device gm0: provider da0 activated.
 GEOM_MIRROR: Device gm0: provider mirror/gm0 launched.
 Trying to mount root from ufs:/dev/mirror/gm0s1a
 hwpmc: TSC/1/0x20<REA> P4/18/0xfff<INT,USR,SYS,EDG,THR,REA,WRI,INV,QUA,PRC,TAG,CSC>
 pid 18178 (conftest), uid 0: exited on signal 12 (core dumped)
 pid 40895 (conftest), uid 0: exited on signal 12 (core dumped)

From: "Larry Rosenman" <ler@lerctr.org>
To: "'Joseph Koshy'" <jkoshy@FreeBSD.org>,
	<freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: RE: kern/93773: kldloaded hwpmc doesnt
Date: Thu, 23 Feb 2006 20:34:31 -0600

 I set machdep.hyperthreading_allowed=1 in /boot/loader.conf, and rebooted,
 Now I get:
 $ pmccontrol -l
 #CPU 0:
 #N  NAME             CLASS  STATE    ROW-DISP
  0  TSC              TSC    ENABLED  FREE
  1  BPU_COUNTER0     P4     ENABLED  FREE
  2  BPU_COUNTER1     P4     ENABLED  FREE
  3  BPU_COUNTER2     P4     ENABLED  FREE
  4  BPU_COUNTER3     P4     ENABLED  FREE
  5  MS_COUNTER0      P4     ENABLED  FREE
  6  MS_COUNTER1      P4     ENABLED  FREE
  7  MS_COUNTER2      P4     ENABLED  FREE
  8  MS_COUNTER3      P4     ENABLED  FREE
  9  FLAME_COUNTER0   P4     ENABLED  FREE
  10 FLAME_COUNTER1   P4     ENABLED  FREE
  11 FLAME_COUNTER2   P4     ENABLED  FREE
  12 FLAME_COUNTER3   P4     ENABLED  FREE
  13 IQ_COUNTER0      P4     ENABLED  FREE
  14 IQ_COUNTER1      P4     ENABLED  FREE
  15 IQ_COUNTER2      P4     ENABLED  FREE
  16 IQ_COUNTER3      P4     ENABLED  FREE
  17 IQ_COUNTER4      P4     ENABLED  FREE
  18 IQ_COUNTER5      P4     ENABLED  FREE
 pmccontrol: Unable to get PMC status for CPU 1: Invalid argument
 $
 
 $ sysctl machdep
 machdep.adjkerntz: 21600
 machdep.disable_rtc_set: 0
 machdep.wall_cmos_clock: 1
 machdep.acpi_timer_freq: 3579545
 machdep.acpi_root: 1009888
 machdep.disable_mtrrs: 0
 machdep.cpu_idle_hlt: 1
 machdep.hlt_cpus: 0
 machdep.panic_on_nmi: 1
 machdep.tsc_freq: 2992512113
 machdep.i8254_freq: 1193182
 machdep.conspeed: 9600
 machdep.gdbspeed: 9600
 machdep.conrclk: 1843200
 machdep.enable_panic_key: 0
 machdep.hlt_logical_cpus: 0
 machdep.logical_cpus_mask: 10
 machdep.hyperthreading_allowed: 1
 $ 
 
 
 -- 
 Larry Rosenman                     http://www.lerctr.org/~ler
 Phone: +1 512-248-2683                 E-Mail: ler@lerctr.org
 US Mail: 430 Valona Loop, Round Rock, TX 78681-3683 US
 
 -----Original Message-----
 From: Joseph Koshy [mailto:jkoshy@FreeBSD.org] 
 Sent: Thursday, February 23, 2006 7:21 PM
 To: 4@FreeBSD.org; all@FreeBSD.org; cpus...@FreeBSD.org;
 freebsd-gnats-submit@FreeBSD.org; see@FreeBSD.org
 Cc: ler@lerctr.org
 Subject: Re: kern/93773: kldloaded hwpmc doesnt
 
 
 Could you please the output of "dmesg".  Was any CPU turned off using
 machdep.htl_cpus or machdep.hlt_logical_cpus.
 
 

From: jkoshy@FreeBSD.ORG (Joseph Koshy)
To: freebsd-gnats-submit@FreeBSD.ORG
Cc:  
Subject: Re: kern/93773: kldloaded hwpmc doesn't see all 4 cpu's...
Date: Sat, 25 Feb 2006 04:21:31 +0000 (GMT)

 Could you please try the following patch?  It should fix pmccontrol(8)
 on Intel CPUs in AMD64 mode.
 
  # cd /usr/src/usr.sbin/pmccontrol
  # patch < [THIS-PATCH]
  # make && make install
  # pmccontrol -l
 
 <><><><> PATCH <><><><>
 --- pmccontrol.c
 +++ pmccontrol.c
 @@ -237,7 +237,7 @@
  	ncpu = pc->pm_ncpu;
  
  	for (c = cpu = 0; cpu < ncpu; cpu++) {
 -#if	i386
 +#if	__i386__ || __amd64__
  		if (pc->pm_cputype == PMC_CPU_INTEL_PIV &&
  		    (logical_cpus_mask & (1 << cpu)))
  			continue; /* skip P4-style 'logical' cpus */
 <><><><> PATCH <><><><>
State-Changed-From-To: open->feedback 
State-Changed-By: jkoshy 
State-Changed-When: Mon Feb 27 13:19:37 UTC 2006 
State-Changed-Why:  
Awaiting confirmation of the bugfix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93773 

From: Larry Rosenman <ler@lerctr.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/93773: [hwpmc] kldloaded hwpmc doesn't see all 4
         cpu's...Re: kern/93773: [hwpmc] kldloaded hwpmc doesn't see all 4
         cpu's...
Date: Mon, 27 Feb 2006 07:33:17 -0600

 seems to work:
 
 
 #CPU 0:
 #N  NAME             CLASS  STATE    ROW-DISP
  0  TSC              TSC    ENABLED  FREE      
  1  BPU_COUNTER0     P4     ENABLED  FREE      
  2  BPU_COUNTER1     P4     ENABLED  FREE      
  3  BPU_COUNTER2     P4     ENABLED  FREE      
  4  BPU_COUNTER3     P4     ENABLED  FREE      
  5  MS_COUNTER0      P4     ENABLED  FREE      
  6  MS_COUNTER1      P4     ENABLED  FREE      
  7  MS_COUNTER2      P4     ENABLED  FREE      
  8  MS_COUNTER3      P4     ENABLED  FREE      
  9  FLAME_COUNTER0   P4     ENABLED  FREE      
  10 FLAME_COUNTER1   P4     ENABLED  FREE      
  11 FLAME_COUNTER2   P4     ENABLED  FREE      
  12 FLAME_COUNTER3   P4     ENABLED  FREE      
  13 IQ_COUNTER0      P4     ENABLED  FREE      
  14 IQ_COUNTER1      P4     ENABLED  FREE      
  15 IQ_COUNTER2      P4     ENABLED  FREE      
  16 IQ_COUNTER3      P4     ENABLED  FREE      
  17 IQ_COUNTER4      P4     ENABLED  FREE      
  18 IQ_COUNTER5      P4     ENABLED  FREE      
 #CPU 1:
 #N  NAME             CLASS  STATE    ROW-DISP
  0  TSC              TSC    ENABLED  FREE      
  1  BPU_COUNTER0     P4     ENABLED  FREE      
  2  BPU_COUNTER1     P4     ENABLED  FREE      
  3  BPU_COUNTER2     P4     ENABLED  FREE      
  4  BPU_COUNTER3     P4     ENABLED  FREE      
  5  MS_COUNTER0      P4     ENABLED  FREE      
  6  MS_COUNTER1      P4     ENABLED  FREE      
  7  MS_COUNTER2      P4     ENABLED  FREE      
  8  MS_COUNTER3      P4     ENABLED  FREE      
  9  FLAME_COUNTER0   P4     ENABLED  FREE      
  10 FLAME_COUNTER1   P4     ENABLED  FREE      
  11 FLAME_COUNTER2   P4     ENABLED  FREE      
  12 FLAME_COUNTER3   P4     ENABLED  FREE      
  13 IQ_COUNTER0      P4     ENABLED  FREE      
  14 IQ_COUNTER1      P4     ENABLED  FREE      
  15 IQ_COUNTER2      P4     ENABLED  FREE      
  16 IQ_COUNTER3      P4     ENABLED  FREE      
  17 IQ_COUNTER4      P4     ENABLED  FREE      
  18 IQ_COUNTER5      P4     ENABLED  FREE      
 
 
 This is assuming that the PIV-logical cpus applies to Xeon HTT siblings.
 
 Thanks!
 
 LER
 
State-Changed-From-To: feedback->closed 
State-Changed-By: jkoshy 
State-Changed-When: Mon Feb 27 14:26:08 UTC 2006 
State-Changed-Why:  
Fixed in rev 1.6 of "src/usr.sbin/pmccontrol/pmccontrol.c". 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93773 
>Unformatted:
