From 93cfd6e8d7bb6dd8893b813b47286f96ade4b1ee Mon Sep 17 00:00:00 2001 From: Nahum Shalman Date: Wed, 21 May 2014 11:00:07 -0400 Subject: [PATCH 1/2] expose usdt_fire_probedef This allows a much simpler wrapping of libusdt by Python's ctypes module since Python no longer needs to deference the probe from the probedef in order to fire it. --- usdt.c | 7 +++++++ usdt.h | 1 + 2 files changed, 8 insertions(+) diff --git a/usdt.c b/usdt.c index 2029e83..40db1ba 100644 --- a/usdt.c +++ b/usdt.c @@ -319,3 +319,10 @@ usdt_errstr(usdt_provider_t *provider) { return (provider->error); } + +void +usdt_fire_probedef(usdt_probedef_t *probedef, int argc, void **argv) +{ + if (usdt_is_enabled(probedef->probe)) + usdt_fire_probe(probedef->probe, argc, argv); +} diff --git a/usdt.h b/usdt.h index 69b4e90..3b5d3b8 100644 --- a/usdt.h +++ b/usdt.h @@ -59,3 +59,4 @@ void usdt_provider_free(usdt_provider_t *provider); void usdt_error(usdt_provider_t *provider, usdt_error_t error, ...); char *usdt_errstr(usdt_provider_t *provider); +void usdt_fire_probedef(usdt_probedef_t *probedef, int argc, void **argv); From 0d74864edccedabc90d69a735dd17a65644fd7a2 Mon Sep 17 00:00:00 2001 From: Nahum Shalman Date: Mon, 28 Jul 2014 15:52:48 -0400 Subject: [PATCH 2/2] Add a link to the Python bindings --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 660274a..f7a8db1 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ Perl: https://github.com/chrisa/perl-Devel-DTrace-Provider +Python: + + https://github.com/nshalman/python-usdt + To Do -----