SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Collaboration Summit 2013




LTTng-UST: Efficient System-Wide
      User-Space Tracing


                  christian.babeux@efficios.com 
                                       @c_bab   1
whoami

   Christian Babeux, Software Developer, EfficiOS,

       Background in embedded and ASIC tools,

       Active contributor to the LTTng projects:
    ●   lttng-tools & lttng-ust,
    ●   CI infra, Website, Twitter.

       AUR package maintainer for Arch Linux.

                                                    2
Content

    Overview of LTTng 2.x and UST,

    User-space instrumentation sources,

    Trace format standardisation efforts,

    Tales from a user-space tracer,

     Recent features & future work.
                                             3
Overview of LTTng 2.x



                       4
Overview of LTTng 2.x
   Unified user interface, API, kernel and user
space tracers,


   Trace output in a unified format,


   Low overhead,


  Shipped in distros: Ubuntu, Debian, Suse,
Fedora, Linaro, Wind River, etc.
                                                   5
Project overview




                  

                       6
Tracers




●   lttng-modules: kernel tracer module, compatible
    with kernels from 2.6.38* to 3.9,
●   lttng-ust: user-space tracer, in-process library.
* Kernel tracing is now possible on 2.6.32 to 2.6.37 by backport of
3 Linux Kernel patches [1].

                                                                      7
Utilities


     
●   lttng-tools: cli utilities and daemons for trace control,
           –   lttng: cli utility for tracing control,
           –   lttng-sessiond: tracing registry daemon,
           –   lttng-consumerd: consume trace data,
           –   lttng-relayd: network streaming daemon.

                                                                8
Viewers


     
●   babeltrace: cli text viewer, trace converter,
    plugin system,
●   lttngtop: ncurse top-like viewer,
●   Eclipse lttng plugin: front-end for lttng, collect,
    visualize and analyze traces, highly extensible.
                                                          9
Overview of LTTng-UST



                       10
LTTng-UST – Features
      Pure userspace implementation,
        –   Shared memory map between apps and trace
            consumers,
        –   Portable to other OS: BSDs, Cygwin
            (experimental).


      Optimized for low-overhead, high-throughput
[2],
        –   Generic kernel ringbuffer ported to userspace,
        –   Efficient concurrent data structures for trace
            control.
                                                             11
LTTng-UST – Features (cont.)

    Dynamically enabled, statically defined
instrumentation,


    Per user tracing and system-wide tracing,
      –   Tracing group for system-wide tracing.


   Traces recoverable even after application crash.


                                                   12
LTTng-UST – How does it work?

    Users instrument their applications with
 static tracepoints,
    liblttng-ust, in-process library, dynamically
 linked with application,
    Session setup, etc.,
    Run app, collect traces,
    Post analysis with viewers.


                                                     13
Tracing session - Setup




           Session setup     $ lttng create
User-space event enabling    $ lttng enable-event -u -a
             Start tracing   $ lttng start



                                                          14
Tracing session - A wild app appears




●   Listener thread spawned via
    constructor (GCC extension),
●   App registration,
●   Send SHM and wait fd.




                                       15
Tracing session – App. execution & teardown




●   App running,
●   Events written to ringbuffer,
●   Notification of data
    availability via pipe,
●   App unregistered via
    destructor.




                                          16
User-space instrumentation
         sources



                            17
Tracepoints - Declaration
TRACEPOINT_EVENT(
    /* Provider name */
    ust_tests_hello,

    /* Tracepoint name */
    tptest,

    /* Type, variable name */
    TP_ARGS(int, anint,
            long *, values,
            float, floatarg),

    /* Type, field name, expression */
    TP_FIELDS(ctf_integer(int, intfield, anint),
              ctf_array(long, arrfield1, values, 3),
              ctf_float(float, floatfield, floatarg))
)

                                                        18
Tracepoints - Invocation
void function(void)
{
    int i = 0;
    long vals[3] = { 0x42, 0xCC, 0xC001CAFE };
    float flt = M_PI;

    [...]
    tracepoint(ust_tests_hello,
               tptest,
               i,
               &vals,
               flt);
    [...]
}
                                                 19
SystemTAP SDT Providers

 Integration result of Collaboration Summit 2011
discussions,



 Compatibility with SystemTAP SDT,
     –   Users can use SystemTAP with tracepoint()
         instrumented code.



                                                     20
Uprobes

   Kernel patchset merged in 3.5,



   LTTng integration:
     – Initial lttng-modules patchset proposed [4],
     – Need usability improvement
     – Interface not exported by kernel



                                                      21
Trace format standardisation efforts




                                       22
Trace format standardisation efforts




Source: xkcd.com/927



                                       23
Trace format standardisation efforts
   Joking aside: We need a common open format,
   Collaboration: Multicore Association, Ericsson,
   Goals of the Common Trace Format (CTF):
     –   Common format for SW and HW traces,
     –   Portable,
     –   Compact,
   Tools based on CTF:
     –   LTTng 2.x, Babeltrace, Eclipse LTTng plugin
     –   GDB (save trace to CTF) [3],
     –   Javeltrace                                    24
Common Trace Format




    Self-described, packet-based format.
                                            25
Common Trace Format – More info.

   “Interoperability Between Tracing Tools with the
 Common Trace Format”,
       –   Mathieu Desnoyers at Linux Plumbers 2012 [5]


    Common Trace Format (CTF) Specification [6],


    Common Trace Format compliance testsuite [7].


                                                          26
Tales from a user-space
         tracer



                         27
Non-intrusive handling of SIGPIPE

    Ringbuffer delivery notification use a pipe,
      –   Traced applications can receive SIGPIPE if
          consumer end dies abruptly.


    Suppress SIGPIPE only in our lib without
 affecting signal handling for the rest of the
 process [8].



                                                       28
TLS & constructors
●   Thread Local Storage (TLS) variable storage in
    dynamically libs. allocated when first used [9],

●   Rely on internal glibc mutex to protect against
    dynamic linker,

●   Same mutex is held while running ctor/dtor,



                                                       29
TLS & constructors (cont.)




                             30
TLS & constructors (cont.)


●   Take mutex within constructors while TLS fixup
    performed,
                    Deadlock!

●   Workaround: Force TLS fixup within lib ctor.




                                                     31
Tracing of apps closing all fds




                                  32
Close all the things

●   When daemonizing, some apps close all
    available fds,




                                            33
Tracing of apps closing all fds

●   When daemonizing, some apps close all
    available fds,


           No communication == No tracing.

●   Fix: None for the moment.




                                              34
Recent features & future
         work



                          35
Recent features
    2.1 (Basse Messe)
          Network streaming over TCP,
           ●   Introduce lttng-relayd, receive traces from
               remote consumers.


          Filtering before data collection,
           ●   C-like syntax, bytecode interpreter.
           ●   UST only for the moment.



              Session daemon health monitoring API.
                                                             36
Network streaming over TCP




                             37
Filtering (1)




 Filter:
 “(intfield > 42 && intfield <= 44) || longfield == 1”



                                                         38
Filtering (2)




 “(intfield > 42 && intfield <= 44) || longfield == 1”
                                                         39
Recent features (cont.)

    2.2 (Cuda, Currently in RC)
          Per-uid buffers in UST,


          Context filtering,
           ●   '$ctx.procname == “demo*”',
           ●   '$ctx.vpid > 9000'.


          Trace file size limits,

                                             40
Future work

    Flight recorder mode tracing (2.3),



    Trace data extracted on core dump (2.3),



     Java tracing.

                                                41
Future work (cont.)

   Tracer triggers actions on specific events & filters


   Compressed, encrypted streaming and storage,


 LTTng accepted in Google Summer of Code [10].
     –   Dynamic instrumentation support in UST,
     –   Android port.


                                                      42
Conclusion




  Usability of user space tracing in production




                                                   43
Questions ?




   ?
                 www.efficios.com




               lttng.org
               lttng-dev@lists.lttng.org
               @lttng_project           44
References
●   [1] – Userspace tracing in small footprint devices – Jason Wessel
●   [2] – lttng-modules README -
●   [3] – [lttng-dev] [lttng-modules PATCH] Add uprobes support – Yannick Brosseau
●   [4] – [PATCH v3 00/15] CTF Support – Yao Qi
●   [5] -
    “Interoperability Between Tracing Tools with the Common Trace Format” - Mathieu Desnoyers
    , Linux Plumbers 2012
●   [6] - Common Trace Format (CTF) Specification
●   [7] - Common Trace Format compliance testsuite
●   [8] – LTTng-UST – 2C44F5B9 - Fix UST SIGPIPE handling
●   [9] – ELF Handling for Thread-Local Storage – Ulrich Drepper (page 8)
●   [10] – LTTng GSoC 2013 Ideas list




                                                                                         45

Más contenido relacionado

La actualidad más candente

New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingScyllaDB
 
OpenStack networking juno l3 h-a, dvr
OpenStack networking   juno l3 h-a, dvrOpenStack networking   juno l3 h-a, dvr
OpenStack networking juno l3 h-a, dvrSim Janghoon
 
xFlow分析の基礎と実例
xFlow分析の基礎と実例xFlow分析の基礎と実例
xFlow分析の基礎と実例Hirotaka Tajima
 
大規模サービスを支えるネットワークインフラの全貌
大規模サービスを支えるネットワークインフラの全貌大規模サービスを支えるネットワークインフラの全貌
大規模サービスを支えるネットワークインフラの全貌LINE Corporation
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)Kentaro Ebisawa
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFBrendan Gregg
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜Ryousei Takano
 
安全なWebアプリケーションの作り方2018
安全なWebアプリケーションの作り方2018安全なWebアプリケーションの作り方2018
安全なWebアプリケーションの作り方2018Hiroshi Tokumaru
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt AffinityについてTakuya ASADA
 
Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Moriyoshi Koizumi
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabMichelle Holley
 
ドローンの仕組み( #ABC2015S )
ドローンの仕組み( #ABC2015S )ドローンの仕組み( #ABC2015S )
ドローンの仕組み( #ABC2015S )博宣 今村
 
GoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティスGoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティスToshiki Tsuboi
 
plotnetcfg入門 | Introduction to plotnetcfg
plotnetcfg入門 | Introduction to plotnetcfgplotnetcfg入門 | Introduction to plotnetcfg
plotnetcfg入門 | Introduction to plotnetcfgKentaro Ebisawa
 
ARPSpoofing攻撃によるMITM攻撃
ARPSpoofing攻撃によるMITM攻撃ARPSpoofing攻撃によるMITM攻撃
ARPSpoofing攻撃によるMITM攻撃slankdev
 
51% 攻撃の原理とシミュレーション
51% 攻撃の原理とシミュレーション51% 攻撃の原理とシミュレーション
51% 攻撃の原理とシミュレーションYuto Takei
 
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみるいまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる裕士 常田
 

La actualidad más candente (20)

New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
 
IP Multicasting
IP MulticastingIP Multicasting
IP Multicasting
 
OpenStack networking juno l3 h-a, dvr
OpenStack networking   juno l3 h-a, dvrOpenStack networking   juno l3 h-a, dvr
OpenStack networking juno l3 h-a, dvr
 
xFlow分析の基礎と実例
xFlow分析の基礎と実例xFlow分析の基礎と実例
xFlow分析の基礎と実例
 
大規模サービスを支えるネットワークインフラの全貌
大規模サービスを支えるネットワークインフラの全貌大規模サービスを支えるネットワークインフラの全貌
大規模サービスを支えるネットワークインフラの全貌
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜
 
安全なWebアプリケーションの作り方2018
安全なWebアプリケーションの作り方2018安全なWebアプリケーションの作り方2018
安全なWebアプリケーションの作り方2018
 
Useful cli commands v1
Useful cli commands v1Useful cli commands v1
Useful cli commands v1
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
 
Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Phpをいじり倒す10の方法
Phpをいじり倒す10の方法
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
ドローンの仕組み( #ABC2015S )
ドローンの仕組み( #ABC2015S )ドローンの仕組み( #ABC2015S )
ドローンの仕組み( #ABC2015S )
 
GoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティスGoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティス
 
plotnetcfg入門 | Introduction to plotnetcfg
plotnetcfg入門 | Introduction to plotnetcfgplotnetcfg入門 | Introduction to plotnetcfg
plotnetcfg入門 | Introduction to plotnetcfg
 
ARPSpoofing攻撃によるMITM攻撃
ARPSpoofing攻撃によるMITM攻撃ARPSpoofing攻撃によるMITM攻撃
ARPSpoofing攻撃によるMITM攻撃
 
51% 攻撃の原理とシミュレーション
51% 攻撃の原理とシミュレーション51% 攻撃の原理とシミュレーション
51% 攻撃の原理とシミュレーション
 
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみるいまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
 

Similar a LTTng-UST: Efficient System-Wide User-Space Tracing

Bridging the gap between hardware and software tracing
Bridging the gap between hardware and software tracingBridging the gap between hardware and software tracing
Bridging the gap between hardware and software tracingChristian Babeux
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemdAlison Chaiken
 
Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Linaro
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For ArchitectsKevin Brockhoff
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOSICS
 
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Jakub Botwicz
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Kynetics
 
Pristine glif 2015
Pristine glif 2015Pristine glif 2015
Pristine glif 2015ICT PRISTINE
 
Implementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdfImplementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdfJose Manuel Ortega Candel
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 
Advanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTngAdvanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTngmarckhouzam
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overviewLinaro
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaSridhar Kumar N
 
Provenance for Data Munging Environments
Provenance for Data Munging EnvironmentsProvenance for Data Munging Environments
Provenance for Data Munging EnvironmentsPaul Groth
 
下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-final下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-finalcsdnmobile
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesSamsung Open Source Group
 

Similar a LTTng-UST: Efficient System-Wide User-Space Tracing (20)

Bridging the gap between hardware and software tracing
Bridging the gap between hardware and software tracingBridging the gap between hardware and software tracing
Bridging the gap between hardware and software tracing
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemd
 
Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For Architects
 
Tos tutorial
Tos tutorialTos tutorial
Tos tutorial
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
 
Pristine glif 2015
Pristine glif 2015Pristine glif 2015
Pristine glif 2015
 
Implementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdfImplementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdf
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
Advanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTngAdvanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTng
 
AMIT SRIVASTAVA
AMIT SRIVASTAVAAMIT SRIVASTAVA
AMIT SRIVASTAVA
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
 
Provenance for Data Munging Environments
Provenance for Data Munging EnvironmentsProvenance for Data Munging Environments
Provenance for Data Munging Environments
 
下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-final下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-final
 
Onnc intro
Onnc introOnnc intro
Onnc intro
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
D4 Project Presentation
D4 Project PresentationD4 Project Presentation
D4 Project Presentation
 

Último

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

LTTng-UST: Efficient System-Wide User-Space Tracing

  • 1. Collaboration Summit 2013 LTTng-UST: Efficient System-Wide User-Space Tracing christian.babeux@efficios.com  @c_bab  1
  • 2. whoami  Christian Babeux, Software Developer, EfficiOS,  Background in embedded and ASIC tools,  Active contributor to the LTTng projects: ● lttng-tools & lttng-ust, ● CI infra, Website, Twitter.  AUR package maintainer for Arch Linux. 2
  • 3. Content  Overview of LTTng 2.x and UST,  User-space instrumentation sources,  Trace format standardisation efforts,  Tales from a user-space tracer,  Recent features & future work. 3
  • 4. Overview of LTTng 2.x  4
  • 5. Overview of LTTng 2.x  Unified user interface, API, kernel and user space tracers,  Trace output in a unified format,  Low overhead,  Shipped in distros: Ubuntu, Debian, Suse, Fedora, Linaro, Wind River, etc. 5
  • 6. Project overview   6
  • 7. Tracers ● lttng-modules: kernel tracer module, compatible with kernels from 2.6.38* to 3.9, ● lttng-ust: user-space tracer, in-process library. * Kernel tracing is now possible on 2.6.32 to 2.6.37 by backport of 3 Linux Kernel patches [1]. 7
  • 8. Utilities  ● lttng-tools: cli utilities and daemons for trace control, – lttng: cli utility for tracing control, – lttng-sessiond: tracing registry daemon, – lttng-consumerd: consume trace data, – lttng-relayd: network streaming daemon. 8
  • 9. Viewers  ● babeltrace: cli text viewer, trace converter, plugin system, ● lttngtop: ncurse top-like viewer, ● Eclipse lttng plugin: front-end for lttng, collect, visualize and analyze traces, highly extensible. 9
  • 11. LTTng-UST – Features  Pure userspace implementation, – Shared memory map between apps and trace consumers, – Portable to other OS: BSDs, Cygwin (experimental).  Optimized for low-overhead, high-throughput [2], – Generic kernel ringbuffer ported to userspace, – Efficient concurrent data structures for trace control. 11
  • 12. LTTng-UST – Features (cont.)  Dynamically enabled, statically defined instrumentation,  Per user tracing and system-wide tracing, – Tracing group for system-wide tracing.  Traces recoverable even after application crash. 12
  • 13. LTTng-UST – How does it work?  Users instrument their applications with static tracepoints,  liblttng-ust, in-process library, dynamically linked with application,  Session setup, etc.,  Run app, collect traces,  Post analysis with viewers. 13
  • 14. Tracing session - Setup Session setup $ lttng create User-space event enabling $ lttng enable-event -u -a Start tracing $ lttng start 14
  • 15. Tracing session - A wild app appears ● Listener thread spawned via constructor (GCC extension), ● App registration, ● Send SHM and wait fd. 15
  • 16. Tracing session – App. execution & teardown ● App running, ● Events written to ringbuffer, ● Notification of data availability via pipe, ● App unregistered via destructor. 16
  • 17. User-space instrumentation sources  17
  • 18. Tracepoints - Declaration TRACEPOINT_EVENT( /* Provider name */ ust_tests_hello, /* Tracepoint name */ tptest, /* Type, variable name */ TP_ARGS(int, anint, long *, values, float, floatarg), /* Type, field name, expression */ TP_FIELDS(ctf_integer(int, intfield, anint), ctf_array(long, arrfield1, values, 3), ctf_float(float, floatfield, floatarg)) ) 18
  • 19. Tracepoints - Invocation void function(void) { int i = 0; long vals[3] = { 0x42, 0xCC, 0xC001CAFE }; float flt = M_PI; [...] tracepoint(ust_tests_hello, tptest, i, &vals, flt); [...] } 19
  • 20. SystemTAP SDT Providers  Integration result of Collaboration Summit 2011 discussions,  Compatibility with SystemTAP SDT, – Users can use SystemTAP with tracepoint() instrumented code. 20
  • 21. Uprobes  Kernel patchset merged in 3.5,  LTTng integration: – Initial lttng-modules patchset proposed [4], – Need usability improvement – Interface not exported by kernel 21
  • 23. Trace format standardisation efforts Source: xkcd.com/927 23
  • 24. Trace format standardisation efforts  Joking aside: We need a common open format,  Collaboration: Multicore Association, Ericsson,  Goals of the Common Trace Format (CTF): – Common format for SW and HW traces, – Portable, – Compact,  Tools based on CTF: – LTTng 2.x, Babeltrace, Eclipse LTTng plugin – GDB (save trace to CTF) [3], – Javeltrace 24
  • 25. Common Trace Format  Self-described, packet-based format. 25
  • 26. Common Trace Format – More info.  “Interoperability Between Tracing Tools with the Common Trace Format”, – Mathieu Desnoyers at Linux Plumbers 2012 [5]  Common Trace Format (CTF) Specification [6],  Common Trace Format compliance testsuite [7]. 26
  • 27. Tales from a user-space tracer  27
  • 28. Non-intrusive handling of SIGPIPE  Ringbuffer delivery notification use a pipe, – Traced applications can receive SIGPIPE if consumer end dies abruptly.  Suppress SIGPIPE only in our lib without affecting signal handling for the rest of the process [8]. 28
  • 29. TLS & constructors ● Thread Local Storage (TLS) variable storage in dynamically libs. allocated when first used [9], ● Rely on internal glibc mutex to protect against dynamic linker, ● Same mutex is held while running ctor/dtor, 29
  • 30. TLS & constructors (cont.) 30
  • 31. TLS & constructors (cont.) ● Take mutex within constructors while TLS fixup performed,  Deadlock! ● Workaround: Force TLS fixup within lib ctor. 31
  • 32. Tracing of apps closing all fds 32
  • 33. Close all the things ● When daemonizing, some apps close all available fds, 33
  • 34. Tracing of apps closing all fds ● When daemonizing, some apps close all available fds,  No communication == No tracing. ● Fix: None for the moment. 34
  • 35. Recent features & future work  35
  • 36. Recent features  2.1 (Basse Messe)  Network streaming over TCP, ● Introduce lttng-relayd, receive traces from remote consumers.  Filtering before data collection, ● C-like syntax, bytecode interpreter. ● UST only for the moment.  Session daemon health monitoring API. 36
  • 38. Filtering (1) Filter: “(intfield > 42 && intfield <= 44) || longfield == 1” 38
  • 39. Filtering (2) “(intfield > 42 && intfield <= 44) || longfield == 1” 39
  • 40. Recent features (cont.)  2.2 (Cuda, Currently in RC)  Per-uid buffers in UST,  Context filtering, ● '$ctx.procname == “demo*”', ● '$ctx.vpid > 9000'.  Trace file size limits, 40
  • 41. Future work  Flight recorder mode tracing (2.3),  Trace data extracted on core dump (2.3),  Java tracing. 41
  • 42. Future work (cont.)  Tracer triggers actions on specific events & filters  Compressed, encrypted streaming and storage,  LTTng accepted in Google Summer of Code [10]. – Dynamic instrumentation support in UST, – Android port. 42
  • 43. Conclusion  Usability of user space tracing in production 43
  • 44. Questions ? ?  www.efficios.com  lttng.org  lttng-dev@lists.lttng.org  @lttng_project 44
  • 45. References ● [1] – Userspace tracing in small footprint devices – Jason Wessel ● [2] – lttng-modules README - ● [3] – [lttng-dev] [lttng-modules PATCH] Add uprobes support – Yannick Brosseau ● [4] – [PATCH v3 00/15] CTF Support – Yao Qi ● [5] - “Interoperability Between Tracing Tools with the Common Trace Format” - Mathieu Desnoyers , Linux Plumbers 2012 ● [6] - Common Trace Format (CTF) Specification ● [7] - Common Trace Format compliance testsuite ● [8] – LTTng-UST – 2C44F5B9 - Fix UST SIGPIPE handling ● [9] – ELF Handling for Thread-Local Storage – Ulrich Drepper (page 8) ● [10] – LTTng GSoC 2013 Ideas list 45