Girish Mahajan (Editor)

Branch trace

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

Branch trace is a computer program debugging tool or analysis technique. It is an abbreviated instruction trace in which only the successful branch instructions are recorded. On IBM System/360 this was implemented as part of Program-Event Recording (PER) but was seldom used at the application programming level. Program Event Recording hardware was used and due to the overhead of this tool, it was removed from customer-available MVS systems.

Contents

Branch tracing is also available for Pentium 4, Intel Xeon and later Intel processors. There are dedicated processor commands to enable branch tracing and save executed branches into special Branch Trace Store area of resident memory. The Branch Trace Store can be also configured to be a circular buffer, so that last executed branches are recorded. Branch tracing on Intel processors can cause 40x application run-time slow down.

Use

With the availability and reference to a compiler listing of the program together with a branch trace, the full path of executed instructions can be reconstructed. With a lot more effort, the full path can even be reconstructed with a memory dump (containing the program storage) and a branch trace.

Alternatives

A more comprehensive trace of all the instructions (including instructions between branches) can be obtained by the use of an instruction set simulator (where available on some platforms). A full instruction trace can provide additional information such as address/length and value of memory alterations.

References

Branch trace Wikipedia