Reading P3 counters on Dual Machine

Hi all,
I have written a kernel mode module to read P3 performance counters.
It works fine on Uniprocessor Machine.
But on Dual Processor machine it fails.
I dont know how to read the counters of a particualr CPU on Dual machine.

Any suggestions will be of great help.
Thanx,
Manish

CPU0 can’t read the registers of CPU1 and vice versa. IOW, when your code
executes it reads the counters of whichever processor is executing. I’ve not had
to write code to set affinity at KM, but what you could do is something like this:

UM Program:
SetProcessAffinityMask to limit execution to intended processor (or you could have
x threads for each processor and use SetThreadAffinityMask for each).
Call DeviceIoControl with a custom IOCTL to call your KM driver
KM Driver:
Reads the processor’s registers and returns the information to the IOCTL.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Sapariya Manish.j [mailto:xxxxx@zensar.com]
Sent: Tuesday, December 05, 2000 3:29 AM
To: NT Developers Interest List
Subject: [ntdev] Reading P3 counters on Dual Machine

Hi all,
I have written a kernel mode module to read P3 performance counters.
It works fine on Uniprocessor Machine.
But on Dual Processor machine it fails.
I dont know how to read the counters of a particualr CPU on Dual machine.

Hi,
thanx,
It worked perfectly.

Manish

-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: Wednesday, December 06, 2000 3:38 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Reading P3 counters on Dual Machine

CPU0 can’t read the registers of CPU1 and vice versa. IOW, when your code
executes it reads the counters of whichever processor is executing. I’ve
not had
to write code to set affinity at KM, but what you could do is something like
this:

UM Program:
SetProcessAffinityMask to limit execution to intended processor (or you
could have
x threads for each processor and use SetThreadAffinityMask for each).
Call DeviceIoControl with a custom IOCTL to call your KM driver
KM Driver:
Reads the processor’s registers and returns the information to the IOCTL.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Sapariya Manish.j [mailto:xxxxx@zensar.com]
Sent: Tuesday, December 05, 2000 3:29 AM
To: NT Developers Interest List
Subject: [ntdev] Reading P3 counters on Dual Machine

Hi all,
I have written a kernel mode module to read P3 performance counters.
It works fine on Uniprocessor Machine.
But on Dual Processor machine it fails.
I dont know how to read the counters of a particualr CPU on Dual machine.


You are currently subscribed to ntdev as: xxxxx@zensar.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)