Re: I want to write my own profiler

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Jun 2, 12:27 am, not_a_commie <notacom...@xxxxxxxxx> wrote:
I want to write myself a simple profiler. It would run a .NET
application and wait for the application to exit. When it exits I want
to see a grid containing 1) fully-qualified method/property name, 2)
the number of times it was called, 3) the amount of CPU time spent in
that function.

I can start a process, but I'm unsure what to look for. Is there some
global output pipe that .NET applications allow other applications to
hook into? How does that work? How does Visual Studio monitor all the
managed modules that were loaded when you execute in debug mode?

I think you can find out the assembly references and associated method
references. Use some counting mechanism for these references. I'm not
sure how the execution breaks down into countable blocks. Probably we
can use a dictionary to store the assembly name and the count.

.



Relevant Pages

  • Re: [PATCH RFD] alternative kobject release wait mechanism
    ... exit() routines will have to ... where the driver cannot afford to wait for all the references ... exit routine, but to make things work the routine would have to wait for ... pass an owner to the embedded kobject, but I want to try it out a little ...
    (Linux-Kernel)
  • Re: [PATCH] powernow-k8: Fix section mismatch
    ... The function __exit powernowk8_exitreferences a variable ... the __cpuinitdata annotation of cpb_nb so it may be used outside an init ... annotation or the annotation of cpu_chain is wrong. ...
    (Linux-Kernel)
  • Re: Linux 2.6.28-rc1
    ... The function reserve_region_with_splitreferences ... fixed by patch in http://lkml.org/lkml/2008/10/12/38 but not yet in mainline ... uses functionality in the exit path. ... The fix is often to remove the __exit annotation of ...
    (Linux-Kernel)
  • Re: MS Access 2000 Automation, cant quit process...
    ... killed automatically on successful exit of the application (but it doesn't ... other references). ... > Dim o As Access.Application ... > Set a breakpoint on the End Sub line. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: [PATCH] powernow-k8: Fix section mismatch
    ... The function __exit powernowk8_exitreferences a variable ... the __cpuinitdata annotation of cpb_nb so it may be used outside an init ... This code needs work. ...
    (Linux-Kernel)