Author 32 bit counters op een 64 bit systeem  
wim
Tovenaar



11930 Posts
Posted - 26/02/2009 :  10:02:13  Show Profile

Solution Part 1: Using 32-bit Counters Interactively

On a Windows x64 system, if you want to collect performance counters from a 32-bit application, you must run the 32-bit version of System Monitor (Perfmon). By default, if you just run Perfmon from the Start/Run dialog box, you’ll get the 64-bit version.

To find the 32-bit version of System Monitor on an x64 Windows Server or XP system, just find Perfmon.exe in the following folder:

C:\WINDOWS\SysWOW64
(This assumes you let Windows install itself into a Windows folder. If not, just go find the SysWOW64 folder.)

You can create a shortcut to this executable on the desktop for all users, and rename it as “32-bit Perfmon”. Now when you run the 32-bit version of System Monitor, notice that you still have access to all the counters for 64-bit applications!

Solution Part 2: Using 32-bit Counter Logs

In order to collect data into performance logs from 32-bit applications, you must replace the 64-bit service with the 32-bit service. There are some complex ways to do this using registry hacking, but the most effective and safe way is to use the Windows sc.exe utility, which sets a service. I found this solution on Todd Carter’s blog: http://blogs.msdn.com/toddca/archive/2007/05/08/logging-32bit-asp-net-performance-counters-on-a-windows-2003-64bit-os.aspx.

I adapted the following example from Todd’s blog:

sc config sysmonlog binPath=
%systemroot%\syswow64\smlogsvc.exe

You run this from the Command window, all in one line. Basically I’m telling the sc.exe command to configure the sysmonlog service to use smlogsvc.exe from the 32-bit \syswow64 path, and not the original path.

The above example assumes you are running it on the server and not from a remote server; that’s why the command does not reference a server name. Also, note that there is a single blank right after the = sign. The command will fail without it!

What’s nice now is that like its interactive 32-bit Perfmon.exe cousin, the 32-bit smlogsvc.exe utility will also capture both 32-bit and 64-bit counters.


http://www.code-magazine.com/Article.aspx?quickid=080015