This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Profiling suggestions


In a message dated 2/17/2000 3:48:36 AM Pacific Standard Time, 
ehliar@lysator.liu.se writes:

> I thought it would be a good idea to make it possible to use rdtsc (or
>  similar instructions on non ia32 platforms) to improve the granularity of
>  profiling.

I believe this would not be at all portable, even among machines which 
support these instructions.  While rdtsc calls give satisfactory timings on 
this old P II 232 Mhz, the same calls are totally unsatisfactory on the HP 
Kayak XW (P III running 547 to 549 Mhz).  If you wish to attempt it, it 
should be a simply matter of linking in your own replacement for the 
necessary timing functions.  It would be interesting to know which are used 
for profiling.  You should compare the possible alternatives, including use 
of the slightly higher level Windows API QueryPerformance functions.  Yes, 
until I made this comparison, I assumed that these were simple 
implementations based on rdtsc instructions for those machines which support 
them.

Tim
tprince@computer.org

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]