• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    C
  • License
    Other
  • Created about 13 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create DTrace probes at runtime

libusdt

This is "libusdt", a library for creating DTrace USDT providers.

The idea here is to allow the specification of a DTrace provider dynamically in code and then create the provider at runtime. This allows providers to be specified in dynamic languages, given suitable bindings.

The general approach is to create two stub functions for each probe, one for the is-enabled check and one for the probe itself. These contain the appropriate instruction sequences to appear to DTrace as compiled-in tracepoints. A minimal DOF document is built describing the provider and indicating these stub functions as the tracepoints, then submitted to the kernel, creating the provider. The API then exposes the stubs, through which the probes may be fired.

Status

The implementation here works as shown in test_usdt.c on Mac OS X, i386 and x86_64, on Solaris-like systems, i386 and x86_64 and on FreeBSD and Oracle Linux, x86_64 only.

Is-enabled probes are supported and exposed in the API.

There is a "test" target which runs a number of tests of the library, for which perl is required.

OS X builds are Universal by default, and on Solaris, the ARCH variable may be set to either i386 or x86_64 to force a particular build.

FreeBSD builds suffer from broken argument handling; this is a known issue with the current state of DTrace generally on FreeBSD: only the first five arguments work reliably. See:

http://wiki.freebsd.org/DTraceTODO

See Also

There are various language bindings available:

Lua:

https://github.com/chrisa/lua-usdt

Ruby (by Kevin Chan):

https://github.com/kevinykchan/ruby-usdt

Node.JS:

https://github.com/chrisa/node-dtrace-provider

Perl:

https://github.com/chrisa/perl-Devel-DTrace-Provider

To Do

Platform support:

  • add support for FreeBSD 9.0 i386
  • add support for Mac OS X PowerPC
  • add support for Solaris SPARC

Features:

  • add a "low level" API, allowing alternative provision of tracepoints for closer integration with language VMs.

  • support structured types, with close integration with the host DTrace system.

More Repositories

1

node-dtrace-provider

Native DTrace probes for node.js apps
JavaScript
320
star
2

ruby-dtrace

Ruby bindings for DTrace
C
64
star
3

node-rsa

OpenSSL RSA library for nodejs
C++
43
star
4

perl-Net-SAML2

Perl Net::SAML2 module
Perl
13
star
5

perl-dtrace

DTrace probes and consumer API for Perl
C
12
star
6

acts_as_encrypted

Transparent database encryption plugin for Rails
Erlang
8
star
7

node-esi

A really basic ESI processor with node.js
JavaScript
6
star
8

lua-usdt

libusdt bindings for Lua
C
6
star
9

perl-Net-ZooKeeper

Net::ZooKeeper Perl module
Perl
6
star
10

mmb-fuse

Fuse wrapper for BBC Micro MMB and SSD filesystems.
Perl
4
star
11

monoimage

Old attempt to build a kexec-based boot environment
C
3
star
12

moosex-types-varchar

A Moose Str type parameterised by length
Perl
3
star
13

transitive_authorization

Addon to the rails "authorization" plugin, allowing for transitive authorization between related models
Ruby
2
star
14

funknet-tools

The Funknet Tools
Perl
2
star
15

perl-Devel-DTrace-Helper

Experimental ustack helper for Perl
C
2
star
16

Net-AS2

rfc4130 "AS2" for Perl
Perl
2
star
17

cryptopals-perl

Solutions to the Matasano Crypto Challenges, in Perl
Perl
2
star
18

arduino

Arduino experimentation
C
1
star
19

funkbot-ng

Funkbot
Perl
1
star
20

perl-Devel-DTrace-Provider

Devel::DTrace::Provider - Perl wrapper for libusdt
C
1
star
21

node-crypto-extras

Extra OpenSSL functions for node.js
C++
1
star
22

perl-Crypt-OpenSSL-VerifyX509

Crypt::OpenSSL::VerifyX509 Perl module
Perl
1
star
23

perl-XMLCompileSOAP-PSGI

Serve XML::Compile::SOAP up as PSGI
Perl
1
star
24

ipc-semaphore-memcached

IPC::Semaphore::Memcached - cluster semaphores in memcached
Perl
1
star