User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13...
Transcript of User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13...
![Page 1: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/1.jpg)
User-space Tracing with UST
April 68, 2011Collaboration Summit
David [email protected]
Mathieu [email protected]
Michel [email protected]
![Page 2: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/2.jpg)
2 Userspace Tracing with UST
Presenters• David Goulet
• Focus on production systems• Academia (Ecole Polytechnique de Montréal)• Industry (Révolution Linux)
• Mathieu Desnoyers• EfficiOS Inc.• Work funded by Ericsson
![Page 3: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/3.jpg)
3 Userspace Tracing with UST
What is UST ?
● UST, a.k.a. LTTngUST, is the LTTng Userspace tracer
● Entirely standalone
i. Works on vanilla Linux kernels
● Trace
i. Applications
ii. Libraries
![Page 4: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/4.jpg)
4 Userspace Tracing with UST
Content
1. Current UST Features
2. LTTng User Interface Unification• Kernel / Userspace tracing
3. Collaboration
![Page 5: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/5.jpg)
5 Userspace Tracing with UST
Current UST FeaturesInterface Unification
Collaboration
![Page 6: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/6.jpg)
6 Userspace Tracing with UST
1. Current UST Features
● Flexibility Enable/Disable any tracepoint before and during tracing
● External data buffers● Crash : the UST consumer still able to get the data out!
● Performance● 190ns/event (high data volume tracer)
● Linear scalability● Disk output and flight recorder mode
![Page 7: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/7.jpg)
7 Userspace Tracing with UST
1. Current UST Features Instrumentation
● Markers
So easy to use! Here to stay!
● Tracepoints/TRACE_EVENT
![Page 8: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/8.jpg)
8 Userspace Tracing with UST
1. Current UST Features Trace Clock
● CLOCK_TRACE (13 Jan 2011)
LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized (kernel and userspace)
➔ Common time reference for simultaneous viewing Only for x86 and x86_64
➔ Very easy to do for other arch. We need that mainline :)
![Page 9: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/9.jpg)
9 Userspace Tracing with UST
Current UST FeaturesInterface Unification
Collaboration
![Page 10: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/10.jpg)
10 Userspace Tracing with UST
2. Interface Unification
● Goals
1. One command to rule them all (usability!)
2. Merge kernel and userspace tracer interfaces
3. Common fast time source
4. Aim for production environment
5. Security
![Page 11: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/11.jpg)
11 Userspace Tracing with UST
2. Unification – trace session daemon
● Introducing lttsessiond1. Manage tracing sessions
2. Manage consumers (UST and kernel)
3. Security
4. Thread/Process scaling
5. LTTng and UST : merge and control
6. Remote control and streaming
![Page 12: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/12.jpg)
12 Userspace Tracing with UST
2. Unification – liblttngctl
● LTTng Control Library
1. API for UST and kernel tracer control
2. Uses lttsessiond for session
Only a library is not enough right?!
![Page 13: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/13.jpg)
13 Userspace Tracing with UST
2. Unification – lttng
● LTTng Control command line tool lttng is the tracer control tool Uses liblttngctl Replaces ustctl and lttctl Main goal : strace alike tool (easy use)
Put this all together, we have ...
![Page 14: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/14.jpg)
14 Userspace Tracing with UST
2. Unification – lttsessiond
Big picture
![Page 15: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/15.jpg)
15 Userspace Tracing with UST
2. Unification – lttsessiond (3)Multiuser case (normal user):
![Page 16: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/16.jpg)
16 Userspace Tracing with UST
2. Unification – lttsessiond (2)
Multiuser case (tracing group):
write
![Page 17: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/17.jpg)
17 Userspace Tracing with UST
2. Unification – lttsessiond (4)
Kernel gets in!
![Page 18: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/18.jpg)
18 Userspace Tracing with UST
Current UST FeaturesInterface Unification
Collaboration
![Page 19: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/19.jpg)
19 Userspace Tracing with UST
3. Collaboration – export
● Userspace ringbuffer library From LTTng kernel ringbuffer Author : Mathieu Desnoyers
CTF (Common Trace Format) Ericsson Linux Foundation CELF Workgroup MultiCore Association Tool Infrastructure
Workgroup
![Page 20: User-space Tracing with UST · 2017. 11. 7. · 1. Current UST Features Trace Clock CLOCK_TRACE (13 Jan 2011) LTTng kernel 0.240 or higher UST 0.11 or higher Timestamp synchronized](https://reader036.fdocuments.us/reader036/viewer/2022071511/6130b4fb1ecc51586944449f/html5/thumbnails/20.jpg)
20 Userspace Tracing with UST
3. Collaboration – import
● TRACE_EVENT● Jump label integration
i. SIGSTOP and SIGCONT
ii.Breakpoint bypass● Dynamic probes
i. Perf dynamic probes
ii.GDB
iii.SystemTAP/uprobes