Giter Club home page Giter Club logo

lttng's Introduction

LTTng: Linux Trace Toolkit - next generation

This Erlang application, lttng, leverages the LTTng-UST JUL (Java Utility Logging) interface to enable and disable Erlang call tracing. It pushes trace-data to LTTng's ConsumerD via tracepoints implemented in NIFs.

Note: This application is a prototype and should be considered as such.

Erlang has its own logging framework, the error_logger, which would probably be a better fit for the JUL interface but in this prototype we use it to define UST tracepoints instead.

Requirements

LTTng needs developer libs. You should compile and install:

  • first liburcu, git clone git://git.lttng.org/userspace-rcu.git
  • then LTTng-UST, git clone git://git.lttng.org/lttng-ust.git
  • then LTTng-tools. git clone git://git.lttng.org/lttng-tools.git

For details, see http://lttng.org/download

Build

To build, simply:

$ git clone [email protected]:psyeugenic/lttng.git
$ cd lttng
$ make

Make will fetch rebar via wget and then compile the source files.

Start

Start Erlang with the lttng application in the library path and add a handler.

In Erlang:

> application:start(lttng).
ok
> lttng:add_handler(myapp, <<"user1">>, [{{erlang,display,1},true}]).
ok

The handler will specify the application and a user-defined string that is associated with a set of match specification for call tracing.

Use lttng

In bash shell:

$ lttng create erlang
Session erlang created.
Traces will be written in /home/egil/lttng-traces/erlang-20140513-180105

$ lttng list -j
JUL events (Logger name):
-------------------------

PID: 14424 - Name: /opt/installs/lib/erlang/erts-6.0/bin/beam.smp
      - myapp:user1 [disabled]

$ lttng enable-event -j myapp:user1
JUL event myapp:user1 created in channel channel0

$ lttng start
Tracing started for session erlang

In Erlang shell:

> erlang:display(wat).
wat
true

In bash shell:

$ lttng stop
Waiting for data availability
Tracing stopped for session erlang

$ lttng view
Trace directory: /home/egil/lttng-traces/erlang-20140513-180105

[18:02:14.810789887] (+?.?????????) palantir lttng_jul:user_erlang_trace: { cpu_id = 3 }, { pid = "<0.33.0>", type = "call", msg = "{erlang,display,[wat]}" }

lttng's People

Contributors

psyeugenic avatar sverker avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.