Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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?

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.

You should monitor the process hosting the dll.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top