Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Create DTrace probes at runtime

License

NotificationsYou must be signed in to change notification settings

chrisa/libusdt

Repository files navigation

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

The idea here is to allow the specification of a DTrace providerdynamically in code and then create the provider at runtime. Thisallows providers to be specified in dynamic languages, given suitablebindings.

The general approach is to create two stub functions for each probe,one for the is-enabled check and one for the probe itself. Thesecontain the appropriate instruction sequences to appear to DTrace ascompiled-in tracepoints. A minimal DOF document is built describingthe provider and indicating these stub functions as the tracepoints,then submitted to the kernel, creating the provider. The API thenexposes 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 onFreeBSD 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 ARCHvariable may be set to either i386 or x86_64 to force a particularbuild.

FreeBSD builds suffer from broken argument handling; this is a knownissue with the current state of DTrace generally on FreeBSD: only thefirst 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 oftracepoints for closer integration with language VMs.

  • support structured types, with close integration with the hostDTrace system.

About

Create DTrace probes at runtime

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp