The trace viewer can be used to view and visualize (buggy) execution traces generated by the P# tester. Its goal is to provide highly-customizable trace views to significantly help the process of debugging your asynchronous application.
First run the following in your command line to restore the packages:
dotnet restore .\TraceViewer.sln
Then, open the .\TraceViewer.sln
solution and build.
To open the trace viewer use the following command:
.\bin\net46\TraceViewer.exe
The input to the trace viewer is a .pstrace
file, which is dumped by the PSharpTester.exe
. From the File
menu, choose the trace file to be loaded. The viewer will then populate the dynamic trace view.
The dynamic trace view can help you read and make sense of a specified .pstrace
file. By default it lists all the actions that occurred during the program execution, as seen in the following figure:
You can focus on specific steps of the trace by selecting a cell. The trace viewer will then highlight only the steps that are related to the selection. For example, in the following figure, the trace viewer focuses on any action related to machine Raft.Server(3)
.
In the following figure, the trace viewer focuses on any action that caused a VoteRequest
event to be sent.
You can use the search text box (Ctrl+F) to find strings in the trace. All rows that do not contain the searched string will fade. By pressing enter you can move to the next row containing the string.
You are also able to collapse the trace view by selecting a cell and then clicking the Collapse
menu button. This hides all actions not related to the selected cell, similar to the following figure:
To reset the trace view, click the Expand
menu button (or click outside the trace view).