techniques for efficiently recording state changes of a computer environment to support reversible...

17
TECHNIQUES FOR EFFICIENTLY RECORDING TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Upload: rudolph-green

Post on 13-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

TECHNIQUES FOR EFFICIENTLY RECORDING TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT STATE CHANGES OF A COMPUTER ENVIRONMENT

TO SUPPORT REVERSIBLE DEBUGGINGTO SUPPORT REVERSIBLE DEBUGGING

Steve Lewis

Page 2: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Outline of PresentationOutline of Presentation

Introduction to Reversible DebuggingRelated WorkState History Recording TechniquesFuture WorkJ.I.M.S. Demonstration

Page 3: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

IntroductionIntroduction What is reversible

debugging?– Reverse Execution– Undo

Why is it useful?– Learning tool– Reduce debugging time– Parallel Programs

Page 4: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Related WorkRelated Work EXDAMS (Balzer)

– Flowback Analysis, History Tape IGOR (Fieldman, Brown)

– Incremental Checkpoints, Modified Memory Pages SPYDER (Agrawal, DeMillo, Spafford)

– Execution-History Backtracking vs. Structured Backtracking LEONARDO (Demetrescu, Finocchi)

– Reversible virtual CPU, virtual O/S, history recording Bidirectional Debugging (Bob Boothe)

– Event counters which facilitate re-execution

Page 5: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

History Logging TechniquesHistory Logging Techniques

Data Representation of State ChangesCheckpoint CreationWhen to Create CheckpointsCheckpoint Culling Algorithm

Page 6: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Data Representation of State ChangesData Representation of State Changes

Checkpoints record the entire state of the machine at some time index t.

State change records record incremental changes to the state of the machine.

Page 7: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Data Representation of State ChangesData Representation of State Changes

Page 8: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Data Representation of State ChangesData Representation of State Changes

Page 9: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Checkpoint CreationCheckpoint Creation

Page 10: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Checkpoint CreationCheckpoint Creation

Page 11: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

When to Create CheckpointsWhen to Create CheckpointsCompromise between…

– Space conserved by using checkpoints– Distance between checkpoints

Page 12: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

When to Create CheckpointsWhen to Create CheckpointsIf (StateHistorySize >= K * CheckpointSize) Then createCheckpoint()

Requires estimating size of next checkpoint Perform every cycle? What is a good value for K? Larger values of K…

– Decrease the growth rate of state history– Increase the distance between checkpoints

Page 13: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Checkpoint Culling AlgorithmCheckpoint Culling Algorithm

Motivation– Maintain the condition that the time to go

backwards u steps is proportional to u.– Reduce state history growth rate from a linear

function to a logarithmic function.

Page 14: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Checkpoint Culling AlgorithmCheckpoint Culling Algorithm

Page 15: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Checkpoint Culling AlgorithmCheckpoint Culling Algorithm

Page 16: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

State History GrowthState History GrowthByte Size of State History Over Time (SORT program)

4000

9000

14000

19000

100 1100 2100 3100 4100 5100 6100 7100 8100 9100 10100

Cycle Index

Siz

e o

f S

tate

His

tory

(byte

s)

Byte Size of State History

Byte Size of State History Over Time (FACTOR program)

5000

6000

7000

8000

9000

1 3 5 7 9 11

13

15

17

19

21

23

25

27

29

31

Cycle Index (x1000)

Siz

e o

f S

tate

His

tory

(byte

s)

Byte Size of State History

Page 17: TECHNIQUES FOR EFFICIENTLY RECORDING STATE CHANGES OF A COMPUTER ENVIRONMENT TO SUPPORT REVERSIBLE DEBUGGING Steve Lewis

Future WorkFuture Work Merging checkpoints

– Save space by storing checkpoint deltas and still be able to use the Checkpoint Culling Algorithm

Investigate alternative methods for deciding when to create checkpoints

Implement circular state history record buffer– Necessary to maintain O(u) runtime for undo operation

More work on JIMS– More authentic simulation (e.g. memory mapped I/O)– Improved GUI (threads, exceptions)

Case study – To find patterns regarding the use of undo.