TraceVis

From BP Wiki
Revision as of 09:48, 5 August 2013 by Assaf (Talk | contribs)

Jump to: navigation, search

= Debugging and visualizing behavioral Java programs with TraceVis

The TraceVis tools provides visualization for the concurrent execution of multiple b-threads, with indications of the events that are requested, waited-for and blocked at each synchronization point, providing insights into why a certain event is triggered and others are not.

This can be used for general program comprehension and for debugging specific flows.

TraceVis Setup and Activation

  • Add the following parameter in run configuration -> arguments -> vm arguments:
-DgeneVisTrace=true
  • Run the program as usual. The input to the trace visualization will be stored in <BProgram name>_log.xml.
  • Open the file TraceVis.htm with the FIREFOX browser.
  • In the BPJ Trace Visualization Menu browse and select the file <BProgram name>_log.xml.
  • Choose the type of b-threads you want to display. B-threads are classified into 4 types, based on their actions in the traced run:
    • Non-Active: b-threads that did not block or request anything, and did not advance; they waited for event sequences that did not occur.
    • Active-follower: b-threads that advanced when certain events occurred, but did not block or request events.
    • Active: b-threads that requested or blocked events, but didn’t lead the run, i.e., none of their requests affected the run.
    • Active-leader: b-threads that contributed to driving the run, i.e., at least one of their requests was chosen for triggering.
  • Optionally, choose “Group into classes” to group all b-threads of the same class in one column. The sets of requested, waited-for and blocked events shown in each cell are the union of the corresponding sets over all instances.
  • Optionally, choose “Group events” to show only one representative event in each cell for the requested/waited-for/blocked events, even if multiple such events exist. Clicking on the button next to the representative name shows the rest of the events.
  • Optionally, choose “Static view” in order to get a print-friendly view, without buttons or dynamic content.
  • Optionally, choose the syncpoints you want to display: how many syncpoints you want to view per page (or all), and the starting syncpoint number. The first syncpoint shown can be changed later via navigation. Note that the length of the trace that is shown affects the loading time, so it is highly advisable not to display all syncpoints for large traces.
  • Press “show” to view the visualization. Note that the loading might take a few minutes.

== Understanding and Navigating TraceVis display

  • Each row corresponds to a syncpoint. The syncpoint index and triggered event are displayed on the left.
  • Each column corresponds to a b-thread, or to a class of b-threads. The b-thread name and type (leader, etc.) are displayed.
  • Each cell contains the declarations of the corresponding b-thread at the corresponding syncpoint, after an event is chosen at the syncpoint, before execution is resumed.
    • The b-thread's declarations of requested/waited-for/blocked events are shown.
    • Instances of the triggered event are emphasized by a green star icon.
    • Requested and waited-for events that are blocked are marked by a red square icon.
  • The leader cell for the syncpoint , i.e., the one whose request was triggered is emphasized by a dark color and solid bold border.
    • An active cell, which also requested and/or waited for the executed event, but didn’t cause it is shown with medium color and solid border.
    • ToDo MISSING DESCRIPTION OF ACTIVE FOLLOWER.
    • A non-active cell, where the b-thread did not advance, as it neither waited for nor requested is shown with Light color and dashed border)