CDT meets Trace Compass EclipseCon, March 2015 Marc Khouzam - - PowerPoint PPT Presentation

cdt meets trace compass
SMART_READER_LITE
LIVE PREVIEW

CDT meets Trace Compass EclipseCon, March 2015 Marc Khouzam - - PowerPoint PPT Presentation

The great troubleshooting encounter: CDT meets Trace Compass EclipseCon, March 2015 Marc Khouzam Marc-Andr Laperle ABOUT US Marc Khouzam Software Developer at Ericsson since 1998 CDT project co-lead, focusing on Debugging


slide-1
SLIDE 1

The great troubleshooting encounter:

CDT meets Trace Compass

EclipseCon, March 2015

Marc Khouzam Marc-André Laperle

slide-2
SLIDE 2

2

2

 Marc Khouzam  Software Developer at Ericsson since 1998  CDT project co-lead, focusing on Debugging  Working with CDT since 2009  Marc-André Laperle  Software Developer at Ericsson since 2013  Committer for Trace Compass, CDT and Linux Tools  Contributor to other projects (Platform UI, SWT, EGit, Mylyn, PDE)

ABOUT US

slide-3
SLIDE 3

3

AGENDA

 A bit of background: Debug and Tracing  CDT Debug and Trace Compass integration

– An integration in 4 parts

 Conclusion

slide-4
SLIDE 4

A little background: Advanced Debugging

slide-5
SLIDE 5

5

5

Non-Stop Debugging

› Program continues execution while suspending some threads › Reduced intrusiveness

slide-6
SLIDE 6

6 DYNAMIC PRINTF INSERTED AT RUNTIME WITH GDB

DYNAMIC-PRINTF

COMPILED PRINTF DEBUGGER › Sometimes traces are necessary › Printf without recompiling or redeploying!

slide-7
SLIDE 7

7

OS Awareness

Sockets Shared Memory Segments Process Groups All Processes All Threads File Descriptors Loaded Kernel Modules Semaphores Message Queues

› Access to system information while debugging

slide-8
SLIDE 8

More background: Tracing with Trace Compass

slide-9
SLIDE 9

9

TRACE COMPASS

slide-10
SLIDE 10

10

Common Features

› Data-driven state system and views

– XML description of state changes to convert trace events to states – XML description of view representation of the computed state system – Can be created without changing source code or recompiling

› For example: 50 lines of XML created the view below

slide-11
SLIDE 11

11

Control flow view

› Displays processes state changes (color-coded) over time

slide-12
SLIDE 12

12

Resources view

› Displays system resource states (color-coded) over time

slide-13
SLIDE 13

13

CPU USAGE View

slide-14
SLIDE 14

AGENDA

 A bit of background: Debug and Tracing  CDT Debug and Trace Compass integration

  • 1. Enhanced Post-mortem troubleshooting
  • 2. Debugging with Trace snapshots
  • 3. Tracing with the (Multicore) Visualizer
  • 4. GDB Traces with Trace Compass

 Conclusion

slide-15
SLIDE 15

Enhanced Post-Mortem Troubleshooting

slide-16
SLIDE 16

16

Post-Mortem Debug

› Use GDB to examine core file › Variables, Registers, Memory

slide-17
SLIDE 17

17

Post-Mortem Trace

› Standard visualization of traces taken upon a crash

slide-18
SLIDE 18

18

Core + Traces

› Joint Debug/Tracing visualization for most flexibility

slide-19
SLIDE 19

19

System setup

  • 1. Enable Tracing e.g., LTTng, UST, etc
  • 2. Register crash handler with Linux kernel (man core)
  • 3. Crash Handler collects/stores traces as well as core file
slide-20
SLIDE 20

20

Debug LauncH

1) Use Post-Mortem launch 2) Specify location of Traces

slide-21
SLIDE 21

21

Core + Traces

slide-22
SLIDE 22

AGENDA

 A bit of background: Debug and Tracing  CDT Debug and Trace Compass integration

  • 1. Enhanced Post-mortem troubleshooting
  • 2. Debugging with Trace snapshots
  • 3. Tracing with the (Multicore) Visualizer
  • 4. GDB Traces with Trace Compass

 Conclusion

slide-23
SLIDE 23

Debugging with Trace Snapshots

slide-24
SLIDE 24

24

Debugging with Trace Snapshots

› Acquire snapshot and open on suspended debugger

Suspended

CDT Debug Trace Compass LTTng

Take snapshot Snapshot acquired

Open snapshot!

slide-25
SLIDE 25

25

Debugging with Trace Snapshots

› Advantages: – Very low overhead – Minimal disk usage › Disadvantage: – Limited data available (as big as buffer allows)

slide-26
SLIDE 26

26

The Prototype

1) Create a tracing session 2) Select session in Debug configuration 3) Suspend (or hit a breakpoint)

slide-27
SLIDE 27

27

The Prototype

slide-28
SLIDE 28

28

Future improvements

› Configure session from Debug configuration

  • Choose tracer
  • Choose trace points
  • Tracer specific options
  • Persisted
slide-29
SLIDE 29

29

Future improvements

› Callstacks of the last few seconds

Current stack frames (GDB)

+

Previous events with function entry and exit (LTTng snaphot)

slide-30
SLIDE 30

30

Future improvements

Result (example)

Callstack can be visualized moments before suspend!

slide-31
SLIDE 31

AGENDA

 A bit of background: Debug and Tracing  CDT Debug and Trace Compass integration

  • 1. Enhanced Post-mortem troubleshooting
  • 2. Debugging with Trace snapshots
  • 3. Tracing with the (Multicore) Visualizer
  • 4. GDB Traces with Trace Compass

 Conclusion

slide-32
SLIDE 32

Trace (Multicore) Visualizer

slide-33
SLIDE 33

33

multicore visualizer

slide-34
SLIDE 34

34

Trace Visualizer

› Show all threads except sleeping

 All of them could run

› Coloured by kernel state › CPU Usage › We can have a better grasp

  • f level of overload

› Which processes are affected by the overload?

slide-35
SLIDE 35

35

TRACE Visualizer

› Colouring by process › Sorting as improvement

slide-36
SLIDE 36

36

TRACE COMPASS and Trace Visualizer

slide-37
SLIDE 37

37

TRACE Visualizer

› Another example › Notice partial CPU usage even with overload › Could it be the Kernel using CPU? › Could indicate even stronger

  • verload
slide-38
SLIDE 38

38

› Coloured by kernel state (RUNNING & SYSCALL) ›

Visualizer with Xeon Phi

slide-39
SLIDE 39

39

› Coloured by process

Visualizer with Xeon Phi

slide-40
SLIDE 40

40

› Filtering of cores to display

Visualizer with Xeon Phi

slide-41
SLIDE 41

AGENDA

 A bit of background: Debug and Tracing  CDT Debug and Trace Compass integration

  • 1. Enhanced Post-mortem troubleshooting
  • 2. Debugging with Trace snapshots
  • 3. Tracing with the (Multicore) Visualizer
  • 4. GDB Traces with Trace Compass

 Conclusion

slide-42
SLIDE 42

GDB Traces with Trace Compass

slide-43
SLIDE 43

43

GDB TRACEpoints

› Instrumentation, collection and visualization in CDT

slide-44
SLIDE 44

44

Debug GDB Traces

Collected Data Line where trace was collected Tracepoint that was hit

slide-45
SLIDE 45

45

GDB TRACEs event table

› Synchronized Trace Compass's Events Table

slide-46
SLIDE 46

Conclusion

slide-47
SLIDE 47

47

MULTICORE DEBUG GROUP

› Joint effort to bring multicore debugging to the CDT

– Visualizer, Pin&Clone, Multiprocess, etc

› Support for those that want to add new features › Monthly conference calls (open to all interested and free )

– http://wiki.eclipse.org/CDT/MultiCoreDebugWorkingGroup

slide-48
SLIDE 48

48

More on Tracing

› Learn more about tracing and Trace Compass: › Thursday 12 noon in Harbour AB with Marc-Andre:

 “Analyzing Eclipse Applications with Trace Compass”

slide-49
SLIDE 49

Some References

› Integration on GitHub, https://github.com/MarkZ3/Trace-Compass/tree/dsf-mv-integration › CDT Project, http://www.eclipse.org/cdt › Trace Compass, https://projects.eclipse.org/projects/tools.tracecompass › CDT FAQ, http://wiki.eclipse.org/CDT/User/FAQ › CDT Debug workgroup http://wiki.eclipse.org/CDT/MultiCoreDebugWorkingGroup › CDT Wiki, http://wiki.eclipse.org/CDT

slide-50
SLIDE 50

50

50

Feedback

slide-51
SLIDE 51

51

Final Q&A

slide-52
SLIDE 52

BONUS SLIDES

slide-53
SLIDE 53

Other CDT Debug News

slide-54
SLIDE 54

54

Debug View Labels

› GDB binary name/version › Thread Names

slide-55
SLIDE 55

55

Per-Element Format

› Ability to set format per element › Variables, Expressions, Registers views

slide-56
SLIDE 56

56

Register Groups

› Ability to create groups of registers

slide-57
SLIDE 57

57

Pin&Clone for Visualizer

› Ability to pin a Multicore Visualizer to a session › Allows to monitor multiple systems concurrently

slide-58
SLIDE 58

58

Mini core dumps

› Effort of the Linux Diamon workgroup (diamon.org) › Mini core dumps: – Configurable excerpt of full core dump – Space savings (good for embedded) – Storage of multiple mini core dumps › Coming to a Linux distribution in the near future!

slide-59
SLIDE 59

59

Future Plans

slide-60
SLIDE 60

60

Global Breakpoints

Applies to every process Auto attach when hit

Un-started or short lived process

› Contribution to Linux Kernel ongoing

slide-61
SLIDE 61

61

Integrated GDB Console

prompt

Eclipse’s GDB-console

Event reporting Command history Command completion Synchronized with GUI Integrated Or stand-alone

› Coming in 2015!

slide-62
SLIDE 62

62

PTC SETS

Process Thread Core (PTC) sets control groups of debug elements:

– Step threads numbered between 34 and 59 – Step all threads running on core 2 – Stop everything running on cores 5 to 7, preventing new threads from being started