1

i m a new programmer in .Net Profiler and Visual C++,

i read many forums and weblogs for .Net Profiling and i have this question.

my Profiler application must be a unmanaged code or i can use some class in .Net in my application? and what type of project i must create ATL with MFC Or ..?

another question is how can i register my profiler dll file that every application of my computer use this profiler?

where the best situation for re-write IL of a method (Enter method of profiler or JITCompilationStarted)?

how can i get input variables of old method and send to new method?

how can i change IL of a property or whole of a class?

i want chane all datetime format of my dlls, and i think that i must search name of those method in JITCompilationStarted and then rewrite that methods,Do u have any better solution? thanks alot.

daniel
  • 11
  • 1
  • This may help you: http://www.eggheadcafe.com/software/aspnet/30067403/i-want-to-write-my-own-pr.aspx – Marek Apr 08 '10 at 07:52

1 Answers1

0

It is good that you want to try this. I would suggest that you be aware of some old ideas about profiling that are less than helpful, and try to improve on them.

I would suggest that the primary focus should be on lines of code, not functions, and that the most useful statistic to get is, for each line, the percent of time it is responsible for (i.e. on the call stack). (The advantage of getting percentage is that you don't have to care how long things take, how many times they are invoked, or whether they are competing with other processes.)

I think the best way to get that information is by means of stack samples taken at random wall-clock times. Don't exclude samples just because they occur when the program is blocked, unless you want to be blind to needless I/O. A good approach is to let the user turn sampling on/off, so you don't take a lot of samples while waiting for user input.

An example of a good profiler that takes this approach is RotateRight/Zoom. Good luck.

Community
  • 1
  • 1
Mike Dunlavey
  • 38,662
  • 12
  • 86
  • 126
  • thank you for your answer but i dont understand completely 1. this link have problem please correct that! 2. how can i use stack in my COM application? 3. my profiler wants to change any function about date time before JIT compile that! How can i use Stack for changing compilation? 4. my applications is in windows not linux! thanks a lot again. – daniel Apr 08 '10 at 14:37
  • @daniel: 1. I'm not sure what's wrong with either link. 3. Stack sampling doesn't require any information about date/time. 4. I just gave Zoom as an example - stack sampling works in any environment. 2. I can't help you there. Various IDEs can "pause" and get the call stack, so I'm assuming there is a way. – Mike Dunlavey Apr 08 '10 at 18:49