Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst...

14
Debugging Session Preview Xu Zhao University of Toronto Session: 3:50 pm - 5:10 pm, Tuesday

Transcript of Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst...

Page 1: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Debugging Session Preview

Xu Zhao

University of Toronto

Session: 3:50 pm - 5:10 pm, Tuesday

Page 2: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Why Care About Debugging?

I More than 50% of development time are on debugging

I Service down time is critical

Google’s blackout in 2013 caused40% drop in global Internet traffic

Amazon service down on prime day

Page 3: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Debugging is Hard

Debugging is twice as hard as writing the code in the firstplace. So if you write the code as cleverly as possible, you are,by definition, not smart enough to debug it.

– Brian Kernighan

Page 4: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Topics of Tomorrow’s Papers

Speedup Failure Resolution

Bug localization Identify the energy hotspot

Performance debugging Cluster-fueled debugger

Page 5: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

I Quick service recovery by reverting the buggy commit

Traditional Debugging

CollectInformation

Understanding FailureFixingBug

DeployFix

Orca

CollectInformation

LocateBuggy

Commit

Revert toPre-bugVersion

Page 6: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

I Quick service recovery by reverting the buggy commit

Traditional Debugging

CollectInformation

Understanding FailureFixingBug

DeployFix

Orca

CollectInformation

LocateBuggy

Commit

Revert toPre-bugVersion

Page 7: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

I Power is the most contraining resource on mobile devicesI both iOS and Android provide following user interfaces

Page 8: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

I Power is the most contraining resource on mobile devicesI Which part of the application is the energy hotspot?

I Breakdown the app into basic execution units calledapplication tasks.

ObservationEnergy consuming pattern can be very different even for similarapplication tasks.

Example: energy consumption breakdown of two IM apps

Other App TasksUI Task

UI Task Other App Tasks

Page 9: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Key Question

I Where is the bottleneck?

A

B

Disk

f1( )

f2( )

Idle

wait B

wait Disk

Disk write

Page 10: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Key Question

I Where is the bottleneck?

A

B

Disk

f1( )

f2( )

Idle

wait B

wait Disk

Disk write

On-CPU Analysis: does not reveal the blocking pattern

Page 11: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Key Question

I Where is the bottleneck?

A

B

Disk

f1( )

f2( )

Idle

wait B

wait Disk

Disk write

Off-CPU Analysis: result could be misleading

Page 12: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Key Question

I Where is the bottleneck?

A

B

Disk

f1( )

f2( )

Idle

wait B

wait Disk

Disk write

wPerf: correctly identify bottlenecking wait events

Page 13: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Highlights

I The best way to understand a failure is to replay it

I First distributed deterministic replay tool

I Debugging distributed systems as easy as GDB

Page 14: Debugging Session Preview - USENIX · Debugging is twice as hard as writing the code in the rst place. So if you write the code as cleverly as possible, you are, ... I both iOS and

Conclusion

Attend the 3:50pm session on Tuesday!