Difference between revisions of "Profiling Actions"

Line 30: Line 30:
 
* The actions are then displayed with a comparison of the execution times and with detailed profiling information.
 
* The actions are then displayed with a comparison of the execution times and with detailed profiling information.
 
= Screenshots =
 
= Screenshots =
 +
[[Image:action_timer_screenshot.jpg]]

Revision as of 08:32, 19 June 2006

Overview

The goal of this project is to add the concept of actions to the Eiffel Studio profiler to make the timing of GUI applications easier.

Main Functionality

  • In the code the user can add
action_timer.start_action ("myAction")

-- action to time

action_timer.stop_action
around interesting parts of code.
  • The tool checks if the directory already contains a file named myAction.br (base run). If it does a file named myAction.cr (comparison run) is created, otherwise the base run file is created.
  • Then the user can view the timed actions (requires base and comparison runs exist) to see if his code modifications slowed down or speeded up the code

Implementation

  • I modified the files eif_option.h and option.c in the run-time. When an action ends I save the profiling information into a file with the name of the action. After that the profiling stack is freed and reinitialized:
ht_free(class_table);
prof_stack_free();
initprf();
  • For this to work stop_profile has been modified to check a flag and not report a profile stack corruption if the flag is true.
  • When the Action Timer is invoked it checks the given directory for .br and .cr files and if both are present with the same name the action is added to the list.
    • The files are parsed using a subclass of PROFILE_CONVERTER which overrides a feature so the converted information isn't written to disk.
  • A new class inheriting from PROFILE_INFORMATION has been added to make total execution time always available.
  • The actions are then displayed with a comparison of the execution times and with detailed profiling information.

Screenshots

Action timer screenshot.jpg