Hi

I have a driver that also uses dispatch table hooking.
I want to monitor it's performance and memory usage.

I know that numega's bounds checker should handle part of these things
but it sometimes crashes (maybe because of the hooking?) and i can't
see the place in the diver's source of the error or memory leak.

Any other recommended tool / way ? (also want to check handle leaks..)

Also, is there a way to monitor CPU usage of a driver ?

Thanks!

Re: How to check Memory & Handle leaks and CPU usage in a Driver? by Don

Don
Wed Jun 01 06:57:03 CDT 2005

Well first the standard comment, hooking is a very bad idea that will cause
your system to become unstable. This should not be used for a commercial
product.

For driver performance you can use Kernrate from the DDK, or Vtune from
Intel. For memory tracking, if you are using tags on your allocations, use
pooltag from the DDK, or poolmon from OSR to monitor youir memory usage.

Of course you should be sure the driver runs clean under a checked build of
the kernel, and with Driver Verifier. If possble it should also run clean
under the Call Usage Verifier.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Omer" <Omerb99@gmail.com> wrote in message
news:1117617268.848913.324580@g14g2000cwa.googlegroups.com...
> Hi
>
> I have a driver that also uses dispatch table hooking.
> I want to monitor it's performance and memory usage.
>
> I know that numega's bounds checker should handle part of these things
> but it sometimes crashes (maybe because of the hooking?) and i can't
> see the place in the diver's source of the error or memory leak.
>
> Any other recommended tool / way ? (also want to check handle leaks..)
>
> Also, is there a way to monitor CPU usage of a driver ?
>
> Thanks!
>



Re: How to check Memory & Handle leaks and CPU usage in a Driver? by Omer

Omer
Wed Jun 01 09:33:06 CDT 2005

and if i'm not using allocations with tag ?


Re: How to check Memory & Handle leaks and CPU usage in a Driver? by Don

Don
Wed Jun 01 09:37:41 CDT 2005

Then you are writing a lousy driver, pool tagging like not hooking is one of
those basic goodness things.. There is no way to track memory without
tagging. For that matter, if you are targeting XP and later use
ExFreePoolWithTag to check the memory when you free it.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply


"Omer" <Omerb99@gmail.com> wrote in message
news:1117636385.823531.120140@g47g2000cwa.googlegroups.com...
> and if i'm not using allocations with tag ?
>



Re: How to check Memory & Handle leaks and CPU usage in a Driver? by Calvin

Calvin
Wed Jun 01 11:51:06 CDT 2005

"Don Burn" <burn@stopspam.acm.org> wrote in message
news:VKjne.102$QX1.100@fe06.lga...
[snip]
> tagging. For that matter, if you are targeting XP and later use
> ExFreePoolWithTag to check the memory when you free it.

Could use Alloc/FreeWithTag in w2k too. It's exported by not defined in w2k
ddk header.

--
Calvin Guan Windows DDK MVP
Staff SW Engineer, NetXtreme MINIPORT
Enterprise Network Controller Engineering
Broadcom Corporation www.broadcom.com



Re: How to check Memory & Handle leaks and CPU usage in a Driver? by Maxim

Maxim
Thu Jun 02 01:53:50 CDT 2005

For memory leaks - only use tagged allocations, and use the WinDbg's
!poolused command. For this to work, the bit 0x400 must be set in the
GlobalFlag registry value.

For CPU usage - there are the kernel profilers, like Intel VTune.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Omer" <Omerb99@gmail.com> wrote in message
news:1117617268.848913.324580@g14g2000cwa.googlegroups.com...
> Hi
>
> I have a driver that also uses dispatch table hooking.
> I want to monitor it's performance and memory usage.
>
> I know that numega's bounds checker should handle part of these things
> but it sometimes crashes (maybe because of the hooking?) and i can't
> see the place in the diver's source of the error or memory leak.
>
> Any other recommended tool / way ? (also want to check handle leaks..)
>
> Also, is there a way to monitor CPU usage of a driver ?
>
> Thanks!
>



Re: How to check Memory & Handle leaks and CPU usage in a Driver? by Omer

Omer
Thu Jun 02 03:52:53 CDT 2005

I can use RtlUnicodeStringToAnsiString and AllocateDestinationString =
TRUE without freeing that string with
RtlFreeAnsiString().

How can i find such a leak ?