dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Call for volunteers: method profiler


From: Rhys Weatherley
Subject: [DotGNU]Call for volunteers: method profiler
Date: Thu, 20 Feb 2003 19:13:05 +1000
User-agent: KMail/1.4.3

Hi all,

Currently, there is some support for method profiling in ilrun, but it is very 
hacky.  If anyone is looking for something to do on the engine, then writing 
a better method profiling system may be worth looking into.

To turn on method profiling at present, one has to edit "cvm_config.h" and 
uncomment the IL_PROFILE_CVM_METHODS define.  Then, you have to run with 
"ilrun --method-profile".  The reason why this isn't on by default is that it 
can adversely affect the performance of regular non-profiled code.

I'd like someone to look into an alternative design, which shouldn't be too 
hard to implement.  The basics are as follows:

1. Remove the old method counting code from cvm_call.c.
2. Add a new CVM instruction called "profile_count", which effectively
   does ++(method->count) on the current method (edit cvm.h, cvm_dasm.c,
   and cvm_lengths.c to add the new instruction details, and cvm_call.c
   to implement the instruction).
3. Modify the CVM coder to output a "profile_count" instruction at the
   start of every method (CVMEntryGen), but only if the command-line
   option "--method-profile" was supplied.  This way, it won't affect the
   performance of regular code.  Output the instruction just before the
   "unroll_method" instruction.
4. Get rid of IL_PROFILE_CVM_METHODS, as it shouldn't be needed
   any more.

This is basically a first step.  After you've done this, you may want to look 
into generating gprof-style profile data (i.e. gmon.out) and/or writing tools 
for analysing the profile data in interesting ways.  Extra instructions can 
be added to track method exit, exception throws, etc, if you like, but get 
the basics working first.

Any takers?  It shouldn't take too long to get the basics in place, and you'll 
become more familiar with how the engine is structured in the process.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]