D e b c o n f 1 6 LTTng: Kernel and userspace tracing in - - PowerPoint PPT Presentation

d e b c o n f 1 6 lttng kernel and userspace tracing in
SMART_READER_LITE
LIVE PREVIEW

D e b c o n f 1 6 LTTng: Kernel and userspace tracing in - - PowerPoint PPT Presentation

D e b c o n f 1 6 LTTng: Kernel and userspace tracing in Debian mjeanson@effjcios.com w h o a mi Michael Jeanson, Software developer @ EffjciOS Debian Maintainer Ubuntu Member Fedora Packager Offjcial and


slide-1
SLIDE 1

LTTng: Kernel and userspace tracing in Debian

mjeanson@effjcios.com 

D e b c

  • n

f 1 6

slide-2
SLIDE 2

w h

  • a

mi

 Michael Jeanson, Software developer @ EffjciOS

  • Debian Maintainer
  • Ubuntu Member
  • Fedora Packager
  • Offjcial and unoffjcial packager for other distros
slide-3
SLIDE 3

C

  • n

t e n t

  • What is tracing?
  • A description of the difgerent tools involved
  • LTTng compared to other tracing tools like strace
  • The state of LTTng in Debian
  • Basic use cases and workfmows
  • Analysis of kernel traces
slide-4
SLIDE 4

Wh a t i s t r a c i n g ?

  • Like a black box / fmight recorder for your system
  • Record runtime information

– Syscalls – Function entry/exit

  • Enable/Disable event(s) at runtime
  • Low overhead
slide-5
SLIDE 5

Wh y u s e t r a c i n g ?

  • Problems that are not easily diagnosed with

traditional tools or debugging

– Narrow down bug causes – Identify performance hogs

  • Very low performance impact

– Can be used on production systems

slide-6
SLIDE 6

T

  • l

s

  • Tracers
  • Control utilities
  • Viewers
  • Post-processing / analysis
slide-7
SLIDE 7

T r a c e r s

  • lttng-modules: OOT kernel tracer modules

– compatible with kernels 2.6.38 to latest rc – you don’t need to recompile your kernel – lttng-modules-dkms in Debian

  • lttng-ust: user-space tracer, in-process library

– Java JUL and log4j agent – Python logging agent

slide-8
SLIDE 8

C

  • n

t r

  • l

u t i l i t i e s

  • lttng-tools: cli utilities and daemons for trace

control

– lttng: main cli command – lttng-ctl: tracing control library – lttng-sessiond: tracing registry daemon – lttng-consumerd: extract trace data – lttng-relayd: network streaming daemon

slide-9
SLIDE 9

V i e w e r s

  • babeltrace: cli text viewer and trace converter
  • tracecompass:

– GUI front-end for lttng – Collect, visualize and analyze traces – Eclipse plugin or standalone version

  • lttngtop: ncurse top-like viewer
slide-10
SLIDE 10

P

  • s

t

  • p

r

  • c

e s s i n g / A n a l y s i s

  • Lttng-analyses

– Record your system's activity – Do whatever it takes for your problem to occur. – Diagnose your problem's cause offmine (when

tracing is stopped).

slide-11
SLIDE 11

C

  • mp

a r e

  • strace: syscall and signal tracer
  • ftrace: in-kernel function and event tracer
  • perf: in-kernel profjler and tracer
slide-12
SLIDE 12

L T T n g i n D e b i a n

  • All the tools are packaged
  • 2 maintainers
  • Testing/unstable: latest 2.8 stack
  • Stable: 2.5 stack, unsupported :(
  • Stable-backports: 2.8 stack coming soon
  • Oldstable: Ancient stufg, don’t use it
slide-13
SLIDE 13

L T T n g i n U b u n t u

  • Xenial: 2.7 stack, supported
  • Trusty: 2.4 stack, unsupported :(
  • PPAs

– Daily builds – Stable branch builds – Release builds for latest LTS

slide-14
SLIDE 14

U s e c a s e s

  • Debugging complex and hard to reproduce

problems

  • Embedded development with remote tracing
  • Use snapshot mode for diffjcult to reproduce bugs
  • Low-level metric collection with network streaming
  • f traces
  • Low-overhead top-like monitoring with lttngtop
slide-15
SLIDE 15

Wo r k f l

  • w

s

  • Given a reproducible problem
  • Gather trace (high level at fjrst)
  • Analyze (narrow down the problem source)
  • Add instrumentation if needed
  • Rince, repeat
slide-16
SLIDE 16

L T T n g a n a l y s e s

  • Demo!

– lttng create – lttng enable-event -k -a – lttng start – ...wait for the problem to appear... – lttng stop – lttng destroy

slide-17
SLIDE 17

D e mo : I O u s a g e

$ lttng-iousagetop demo-trace/

slide-18
SLIDE 18

D e mo : I O l a t e n c y

$ lttng-iolatencystats demo-trace/ --minsize 2

slide-19
SLIDE 19

D e mo : I O l a t e n c y

$ lttng-iolog demo-trace --timerange [12:18:50.162776739,12:18:51.157522361]

  • Wouldn’t be a demo if everything worked
  • From the previous step, we know when the

latency happened, look at the log

  • Find the root cause
slide-20
SLIDE 20

Q u e s t i

  • n

s

 https://{git | www}.lttng.org  lttng-dev@lists.lttng.org  @lttng_project  #lttng on irc.oftc.net

?

LTTng Project