views:

296

answers:

4

I need to find out the CPU utilization of a service DLL. I have looked in existing samples and we can find CPU utilization for processes.

I think DLL will be loaded by services.exe. So is it possible to find out CPU utilization by DLL.

I am working in C++ on the Windows platform.

+1  A: 

The only performance counters available in Windows are at the process level. What do you mean by service DLL? The only service.DLL I know of is a trojan virus.

But are you talking about generic service DLLs or a specific file?

Marcus Erickson
I am taking about the generic service dlls which are hosted in svchost.exe or servicee.exe
Alien01
+1  A: 

Try this:

  1. Use Perfmon to log all counters for the process object.
  2. Before or after your test, run tasklist /svc from a command console. Look through the output for the svchost.exe that's hosting your service. Note the PID of this process.
  3. After the test, use Perfmon to load your log file, the add the process measurements for the process in step 2.
Patrick Cuff
+3  A: 

Make a copy of svchost.exe and call it dbgsrvc.exe; then, go into the service entry in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog for example), and change the ImagePath to use dbgsrvc instead of services. That way, you've isolated your service into its own process so you can get perf counters on it.

Paul Betts
A: 

You should monitor the process hosting the dll.

lsalamon