I want to write my own profiler

  • Thread starter Thread starter not_a_commie
  • Start date Start date
N

not_a_commie

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 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top