Search code examples
c++windowscpuutilization

CPU Utilization of Service DLL?


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.


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.