comprehensive kernel instrumentation via dynamic binary …peter/feiner_slides_asplos_2012.pdf ·...

102
01 / 17 Comprehensive Kernel Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown Ashvin Goel University of Toronto Peter Feiner

Upload: others

Post on 17-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Comprehensive Kernel Instrumentation

viaDynamic Binary Translation

1

Angela Demke Brown Ashvin Goel

University of Toronto

Peter Feiner

Page 2: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Complexity of Operating Systems

2

Page 3: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Complexity of Operating SystemsGrowth in code size

‣ Palix, ASPLOS 2011

‣ Many new drivers!

2

Page 4: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Complexity of Operating SystemsGrowth in code size

‣ Palix, ASPLOS 2011

‣ Many new drivers!

More swearing

‣ Vidar Holen, 2012

2

200

150

100

50

$^&@!%&%!*&#@$%!^%*penguin

Swea

r C

ount

1.0 2.1.2 2.3.36 2.6.12 2.6.24 2.6.36

Page 5: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Complexity of Operating SystemsGrowth in code size

‣ Palix, ASPLOS 2011

‣ Many new drivers!

More swearing

‣ Vidar Holen, 2012

Bugs are inevitable!

‣ Need coping strategies

2

200

150

100

50

$^&@!%&%!*&#@$%!^%*penguin

Swea

r C

ount

1.0 2.1.2 2.3.36 2.6.12 2.6.24 2.6.36

Page 6: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Tools would be niceAwesome tools for user code

‣ Memcheck

‣ Program Shepherding

Use Dynamic Binary Translation (DBT)

‣ Rewrite binaries as they execute

‣ No need for source

Frameworks make building DBT tools easy

‣ DynamoRIO, Valgrind, Pin

No framework for OS code

3

Page 7: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Our Framework

4

Page 8: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Our FrameworkPorted DynamRIO to Linux kernel

‣ Runs on bare metal

4

Page 9: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Our FrameworkPorted DynamRIO to Linux kernel

‣ Runs on bare metal

Port took 18 Months

4

Page 10: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Our FrameworkPorted DynamRIO to Linux kernel

‣ Runs on bare metal

Port took 18 Months

Built OS debugging tools in 5 days

‣ Heap debugging

• Use after free

• Heap corruption

‣ Stack overflow monitor

4

Page 11: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Our FrameworkPorted DynamRIO to Linux kernel

‣ Runs on bare metal

Port took 18 Months

Built OS debugging tools in 5 days

‣ Heap debugging

• Use after free

• Heap corruption

‣ Stack overflow monitor

Practical

‣ One author ran system on her desktop for 1 month

4

Page 12: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

What About Hypervisors?

5

Page 13: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

What About Hypervisors?VMWare can use DBT on guests

‣ No instrumentation API

5

Page 14: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

What About Hypervisors?VMWare can use DBT on guests

‣ No instrumentation API

PinOS has instrumentation API

‣ PinOS = Pin + Xen

‣ Guest needs emulated devices

• Useless for most driver code

5

Page 15: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

What About Hypervisors?VMWare can use DBT on guests

‣ No instrumentation API

PinOS has instrumentation API

‣ PinOS = Pin + Xen

‣ Guest needs emulated devices

• Useless for most driver code

5

Other6%

Arch25%

FS9%

Net6%

Sound6%

Drivers47%

Palix, ASPLOS 2011

Page 16: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

What About Hypervisors?VMWare can use DBT on guests

‣ No instrumentation API

PinOS has instrumentation API

‣ PinOS = Pin + Xen

‣ Guest needs emulated devices

• Useless for most driver code

So add DBT to a hypervisor with pass-through devices?

‣ Then you’d have the problems we show you how to solve

‣ ... problems with interrupts!5

Other6%

Arch25%

FS9%

Net6%

Sound6%

Drivers47%

Palix, ASPLOS 2011

Page 17: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

OS Code

Framework Overview

6

User Code

ExceptionsInterrupts

1. Boot normally

2. Take over

3. JIT the OS

x86 → instrumented x86

Page 18: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

OS Code Framework

Framework Overview

6

User Code

ExceptionsInterrupts

1. Boot normally

2. Take over

3. JIT the OS

x86 → instrumented x86

Page 19: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Instrumented OS Code

OS Code Framework

Framework Overview

6

User Code

ExceptionsInterrupts

1. Boot normally

2. Take over

3. JIT the OS

x86 → instrumented x86

Page 20: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Instrumented OS Code

ExceptionsInterrupts

Page 21: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code

Code Cache

ExceptionsInterrupts

Page 22: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

ExceptionsInterrupts

Page 23: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

Page 24: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

System call example

‣ bb1 is entry point

Page 25: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

System call example

‣ bb1 is entry point

Page 26: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

System call example

‣ bb1 is entry point

Page 27: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb1

System call example

‣ bb1 is entry point

Page 28: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb1

System call example

‣ bb1 is entry point

Page 29: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb1

System call example

‣ bb1 is entry point

Page 30: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb1

System call example

‣ bb1 is entry point

Page 31: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 32: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 33: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 34: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 35: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 36: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 37: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 38: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Dynamic Instrumentation

7

User Code

OS Code Code Cache

bb1

bb2

bb3

bb2

bb1

System call example

‣ bb1 is entry point

Page 39: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Complications

8

User Code

OS Code

bb1

bb2

bb3

bb2

bb1

Code Cache

Page 40: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Complications

8

User Code

OS Code

bb1

bb2

bb3

bb2

bb1

Code Cache

Reentrance

‣ How do you do I/O?

‣ Can’t use OS

Page 41: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Complications

8

User Code

OS Code

bb1

bb2

bb3

bb2

bb1

Code Cache

Reentrance

‣ How do you do I/O?

‣ Can’t use OS

Concurrency

‣ Multiple CPUs using and building cache

Page 42: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

bb3

Framework

Complications

8

User Code

OS Code

bb1

bb2

bb3

bb2

bb1

Code Cache

Reentrance

‣ How do you do I/O?

‣ Can’t use OS

Concurrency

‣ Multiple CPUs using and building cache

Interrupts

Page 43: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IH*iret

Interrupts

Page 44: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IH*iret

Interrupts

Page 45: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IH*iret

arrival

Interrupts

Page 46: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IH*iret

arrival

Interrupts

Page 47: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IH*

What should framework do with interrupt?

iret

arrival

Interrupts

Page 48: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

iret

arrival

Interrupts

Page 49: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

iret

arrival

Interrupts

Page 50: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

iret

arrival

Interrupts

Page 51: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

iret

arrival

Interrupts

Page 52: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

iret

arrival

tailInterrupts

Page 53: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

• Problem if instrumentation isn’t reentrant

iret

arrival

tailInterrupts

Page 54: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

• Problem if instrumentation isn’t reentrant

iret

arrival

tail

lock(l)

Interrupts

Page 55: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

• Problem if instrumentation isn’t reentrant

iret

arrival

tail

lock(l)

lock(l)

Interrupts

Page 56: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

• Problem if instrumentation isn’t reentrant

iret

arrival

tail

lock(l)

lock(l)

deadlockInterrupts

Page 57: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Framework

Handling Interrupts

9

User Code

OS Code

bb1 bb1

Code Cache

IHIH*

What should framework do with interrupt?

‣ Can it run interrupt handler IH immediately?

• Problem if instrumentation isn’t reentrant

iret

arrival

tail

lock(l)

lock(l)

deadlock

Need to delay

Interrupts

Page 58: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Framework

bb1

arrival

Page 59: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until? Framework

bb1

arrival

Page 60: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

Framework

bb1

arrival

delivery

Page 61: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

Framework

bb1

arrival

delivery

Page 62: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

Framework

bb1

arrival

delivery

pendinginterrupt

Page 63: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

Framework

bb1

arrival

delivery

pendinginterrupt

Page 64: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

Framework

bb1

arrival

delivery

pendinginterrupt

Page 65: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

Framework

bb1

arrival

delivery

pendinginterrupt

Page 66: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

Framework

bb1

arrival

delivery

Page 67: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

‣ Problem if bb1 disables interrupt

Framework

bb1

arrival

delivery

disabled

Page 68: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

‣ Problem if bb1 disables interrupt

• Could be any MMIO

• Framework cannot detect if enabled

Framework

bb1

arrival

delivery

disabled

Page 69: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

‣ Problem if bb1 disables interrupt

• Could be any MMIO

• Framework cannot detect if enabled

Framework

bb1

arrival

delivery

disabled

Page 70: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

‣ Problem if bb1 disables interrupt

• Could be any MMIO

• Framework cannot detect if enabled

Must deliver before next OS instruction

Framework

bb1

arrival

delivery

disabled

delivery

Page 71: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

‣ Problem if bb1 disables interrupt

• Could be any MMIO

• Framework cannot detect if enabled

Must deliver before next OS instruction

‣ Delay until end of instrumentation

Framework

bb1

arrival

delivery

disabled

delivery

Page 72: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying Interrupts

10

Where do we delay it until?

Delay until end of bb1?

‣ Avoids tail

‣ Problem if bb1 disables interrupt

• Could be any MMIO

• Framework cannot detect if enabled

Must deliver before next OS instruction

‣ Delay until end of instrumentation

‣ Still duplicates tail

Framework

bb1

arrival

delivery

disabled

delivery

Page 73: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

How to Delay Interrupts

11

bb1

Page 74: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

How to Delay Interrupts

11

bb1

Page 75: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

How to Delay Interrupts

11

bb1

push, disable

Page 76: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

How to Delay Interrupts

11

bb1

push, disable pop

Page 77: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

How to Delay Interrupts

11

bb1

push, disable

push, disable pop

Page 78: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

How to Delay Interrupts

11

bb1

poppush, disable

push, disable pop

Page 79: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

But performance would be bad

How to Delay Interrupts

11

bb1

poppush, disable

push, disable pop

Page 80: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

But performance would be bad

Instead, have framework handle it

‣ Extra overhead for interrupt, cheaper instrumentation

How to Delay Interrupts

11

bb1

poppush, disable

push, disable pop

Page 81: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Could disable them on the CPU

But performance would be bad

Instead, have framework handle it

‣ Extra overhead for interrupt, cheaper instrumentation

‣ Instrumentation more frequent than interrupts

‣ Gigabit NIC sends interrupt every 100µs ≈ 100K instr.

How to Delay Interrupts

11

bb1

poppush, disable

push, disable pop

Page 82: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

12

Framework bb1

arrivalExample: interrupt 239

Page 83: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

12

Framework bb1

Interrupts enabled yes

Interrupt Stack Frame

arrival

...

Example: interrupt 239

Page 84: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

12

Framework bb1

Interrupts enabled yes

Interrupt Stack Frame

arrival

...

Example: interrupt 239

Page 85: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

...

Example: interrupt 239

Page 86: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no...

Example: interrupt 239

Page 87: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no...

Example: interrupt 239

Page 88: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no...

Example: interrupt 239

Page 89: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no...

Example: interrupt 239

Page 90: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frame

...

...

Example: interrupt 239

Page 91: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frame

...

...

Example: interrupt 239

Page 92: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

4. Removes patch

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frame

...

...

Example: interrupt 239

Page 93: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

4. Removes patch

5. Enables interrupts on iret

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frameyes

...

...

Example: interrupt 239

Page 94: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

4. Removes patch

5. Enables interrupts on iret

6. Run instrumented interrupt handler

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frameyes

...

...

Example: interrupt 239

Page 95: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

4. Removes patch

5. Enables interrupts on iret

6. Run instrumented interrupt handler

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frameyes

IH

...

...

Example: interrupt 239

Page 96: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Delaying with Patches

The framework

1. Patches next native instruction

2. Disables interrupts on iret

3. iret

4. Removes patch

5. Enables interrupts on iret

6. Run instrumented interrupt handler

12

Framework bb1

int 239

Interrupts enabled yes

Interrupt Stack Frame

arrival

no

Interrupts enabled no

Patch Interrupt Stack Frameyes

IH

...

...Okay, what’s the performance?

Example: interrupt 239

Page 97: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Performance

13

Ran framework with instruction counting tool

‣ Intel Quad Core i7 2.8Ghz, 8GB, 64-bit Ubuntu 10.10

Low application overhead

‣ JavaScript, Mozilla Kraken: 3% overhead

‣ Parallel Linux kernel compile: 30% overhead

• 18% user time increase

• 143% system time increase

Overhead commensurate with OS activity

‣ How bad can this get?

Page 98: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Stress Test SetupApachebench and Filebench

Configured benchmarks to stress CPUs and kernel

‣ Large buffer cache - no disk I/O

‣ Many threads - lots of context switching

‣ 100% utilization - shows interrupt processing overhead

14

to return to the dispatcher (line 15 of HANDLE-INTERRUPT).After the fragment is unlinked, execution returns to the inter-rupted translation with interrupts disabled (lines 33–37). Whenthe CPU executes the dispatcher next, it sees the pending in-terrupt and emulates its arrival. Translations for control transferinstructions involve emulation in some cases. For instance, areturn instruction’s translation involves spilling a register, pop-ping the return address off of the stack into the spilled register,jumping to the indirect branch lookup routine, and returning tothe dispatcher if the lookup fails to find the fragment for thereturn address. Interrupts during the first three steps (spilling,popping, and jumping), take place in the fragment and are thushandled by Case 2B. Interrupts during the last two steps arehandled by Case 3 and Case 4.

Case 2C: Interrupted during a native instruction translation.Native state is recreated and the dispatcher is invoked immedi-ately. The interrupt cannot be delayed because subsequent na-tive instructions might affect interrupt delivery.

Case 2D: Interrupted during instrumentation. Undoing in thiscase is unfeasible because instrumentation is arbitrary code.So the interrupt is delayed until the end of the instrumentation(line 20). The translation following the interrupted instrumenta-tion is patched with a control transfer to the dispatcher (line 21).Because DRK uses CPU-private code caches, this patch willnot affect other CPUs. However, a shared code cache couldbe patched atomically if instructions following instrumentationcode were padded to the proper alignment.

Case 3: Interrupted during indirect branch lookup routine.On the hit path of the indirect branch lookup routine, there isa final jump instruction that transfers control to the fragment.To delay interrupts in this case, this final jump is patched toreturn to the dispatcher (line 24), effectively delaying the inter-rupt. DRK uses CPU-private indirect branch lookup routines tomake patching simple and efficient. However, the patch couldbe done atomically for shared caches at the performance costof spurious code cache exits on other CPUs.

Case 4: Interrupted while exiting the code cache. DynamoRIOsaves the kernel’s native state when control exits the code cacheand enters the dispatcher. If interrupted during a context switch,DRK needs to delay the interrupt until the context switch fin-ishes to allowing the remaining native state to be saved. Todelay interrupts in this case, DRK simply makes note of thepending interrupt and returns to the interrupted context switch(line 27 of HANDLE-INTERRUPT).

Case 5: Interrupted while entering the code cache. DRK hasnothing to undo because the native state was recorded duringthe last code cache exit. DRK makes note of the pending inter-rupt and calls DISPATCH with the registers saved during the lastcode cache exit (line 29 of HANDLE-INTERRUPT).

5. Framework EvaluationBefore examining applications that are enabled by DRK, we evalu-ate the overhead of the framework alone and with a simple instru-mentation client. For these experiments, we operate with a largeenough maximum code cache size so that flushes do not occur. Weperform a number of stress tests with a high level of kernel ac-tivity, to show the robustness of DRK and to illustrate worst-casebehavior. As noted in Section 2, we have not yet ported certainDynamoRIO optimizations, such as traces, to DRK. The currentresults are therefore conservative.

nthreads data sizefileserver 50 1.25 GBwebserver 100 15.6 MBwebproxy 100 15.6 MBvarmail 16 15.6 MB

Table 1. Filebench parameters

5.1 Simple ToolsWe implemented two simple instrumentation clients to illustrate theoverhead of the DRK framework. Null Client does nothing. Thisclient illustrates DRK’s bare performance. Instruction Count keepsa per-CPU tally of the number of instructions that have executed.Instruction Count instruments every basic block to increment theCPU’s counter by the number of instructions in the basic block.Our implementation of this client uses a standard optimization thatavoids spilling and restoring the CPU’s arithmetic flags if they aredead. Note that if an interrupt arrives after the Instruction Countinstrumentation clobbers the flags, but before the native instructionkills the flags, then the interrupt handler will see the non-nativeflag state. During our experiments, we have not seen this affect thecorrectness of the kernel execution.

5.2 Experimental ResultsOur test system is a Dell Optiplex 980 with 8 GB of RAM and4 64-bit Intel Core i7 CPUs operating at 2.8GHz. We disabledhyperthreading in the BIOS for our performance experiments, butnote that DRK runs stably with all 8 cores that are available whenhyperthreading is enabled. We use lmbench version 3.0 to get afine-grained view of the performance during a variety of systemactivities4. We then present server and desktop benchmarks. Allresults are an average of five warm runs.

Figure 4 shows the lmbench results. We have grouped tests withsimilar original native performance into subfigures to better showthe performance. For simple system calls, our slowdown with theNull client ranges from 1.4 (for the null system call) to 2.7 foropen+close. Other “fast” kernel operations have higher overheads,with a worst-case slowdown of 4.9 during protection faults. Signaldelivery and page faults on file pages are more like system calls,with slowdowns of 2.8 and 2.1 respectively. The results for theother system calls are similar. The slowdowns on select and piperange from 1.9 to 2.5, although sock is worse. The slowdowns forthe fork calls are also similar, ranging from 2.2 up to 2.7. TheInstruction Count client adds significant additional overhead forthese simple microbenchmark tests, although as the complexityof the operation increases, the additional overhead of InstructionCount is less significant, as can be seen for the fork operations.

We observe that the overheads are lower for simple systemcalls than for protection faults because DRK points system callentries directly to their fragments in the code cache (as describedin Section 4.1.2), while other entry points to the kernel are morecostly. Based on these results, we are investigating optimizationsfor other entry points, especially page fault exceptions.

We use the Linux port of Filebench version 1.4.9, with four ofthe standard workload personalities, using the default settings foreach5. The relevant parameters for the workloads are in Table 1.With the default parameters, the datasets easily fit in memory onour test machine, so the workloads are not limited by the perfor-mance of I/O operations. The filebench workloads use a specifiednumber of threads to perform file system operations. These threads

4 We present the most interesting lmbench results here. The raw data forall experiments is available from our website at http://csng.cs.toronto.edu/projects/235 The oltp workload hung our native system regularly.

Apachebench Parameters

concurrency level 200

Page 99: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Stress Test Results

15

0

5000

10000

15000

20000

apachebench fileserver webserver webproxy varmail

Thr

ough

put

(ops

/s)

NativeInstrumented

Less than 5x - Reasonable overhead for debugging tools

Apachebench Filebench

Page 100: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Stress Test Results

15

0

5000

10000

15000

20000

apachebench fileserver webserver webproxy varmail

Thr

ough

put

(ops

/s)

NativeInstrumented

CPU-bound IO-bound

Less than 5x - Reasonable overhead for debugging tools

Apachebench Filebench

Page 101: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Summary

Enables dynamic binary instrumentation of OS

Makes it easy to write complex instrumentation

Built useful memory checking tools

Works with arbitrary devices & drivers

16

Page 102: Comprehensive Kernel Instrumentation via Dynamic Binary …peter/feiner_slides_asplos_2012.pdf · 2012-03-09 · Instrumentation via Dynamic Binary Translation 1 Angela Demke Brown

01 / 17

Questions?

17