View | Details | Raw Unified | Return to bug 217419 | Differences between
and this patch

Collapse All | Expand All

(-)b/devel/py-python-dtrace/Makefile (+23 lines)
Added Link Here
1
# $FreeBSD$
2
3
PORTNAME= 	python-dtrace
4
PORTVERSION=	0.0.9
5
PORTREVISION=	1
6
CATEGORIES=	misc devel python
7
MASTER_SITES=	CHEESESHOP
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
9
10
MAINTAINER=	gcj21@cl.cam.ac.uk
11
COMMENT=	DTrace consumer for Python based on libdtrace
12
13
LICENSE=	MIT
14
15
BUILD_DEPENDS+=	cython:lang/cython
16
17
RUN_DEPENDS+=	${BUILD_DEPENDS}
18
19
USES+=		zip
20
USES+=		python
21
USE_PYTHON=	autoplist distutils
22
23
.include <bsd.port.mk>
(-)b/devel/py-python-dtrace/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1476182943
2
SHA256 (python-dtrace-0.0.9.zip) = 9daa24fe3b5d16c17c4afed00d3b2b2f869598efc5a8100b8570342713328912
3
SIZE (python-dtrace-0.0.9.zip) = 21764
(-)b/devel/py-python-dtrace/files/patch-dtrace__cython_consumer.pyx (+35 lines)
Added Link Here
1
--- dtrace_cython/consumer.pyx.orig
2
+++ dtrace_cython/consumer.pyx
3
@@ -2,7 +2,7 @@
4
 import time
5
 import threading
6
 from threading import Thread
7
-from dtrace_consumer.dtrace_h cimport *
8
+from dtrace_cython.dtrace_h cimport *
9
 
10
 # ----------------------------------------------------------------------------
11
 # The DTrace callbacks
12
@@ -333,6 +333,11 @@ cdef class DTraceConsumer:
13
                             dtrace_errmsg(self.handle,
14
                                           dtrace_errno(self.handle)))
15
 
16
+    def setopt(self, key, value):
17
+        if dtrace_setopt(self.handle, key, value) != 0:
18
+            raise Exception(dtrace_errmsg(self.handle,
19
+                                          dtrace_errno(self.handle)))
20
+
21
 
22
 cdef class DTraceContinuousConsumer:
23
     """
24
@@ -434,6 +439,11 @@ cdef class DTraceContinuousConsumer:
25
 
26
         return status
27
 
28
+    def setopt(self, key, value):
29
+        if dtrace_setopt(self.handle, key, value) != 0:
30
+            raise Exception(dtrace_errmsg(self.handle,
31
+                                          dtrace_errno(self.handle)))
32
+
33
 
34
 class DTraceConsumerThread(Thread):
35
     """
(-)b/devel/py-python-dtrace/files/patch-dtrace__cython_dtrace_h.pxd (+43 lines)
Added Link Here
1
--- dtrace_cython/dtrace_h.pxd.orig
2
+++ dtrace_cython/dtrace_h.pxd
3
@@ -7,7 +7,7 @@ cdef extern from "libelf_workaround.h":
4
     pass
5
 
6
 
7
-IF UNAME_SYSNAME == "Darwin":
8
+IF UNAME_SYSNAME == "Darwin" or UNAME_SYSNAME == "FreeBSD":
9
     cdef extern from "stdint.h":
10
         # needed for quantize mths.
11
         cdef int64_t INT64_MAX
12
@@ -18,7 +18,6 @@ ELSE:
13
         cdef int64_t INT64_MAX
14
         cdef int64_t INT64_MIN
15
 
16
-
17
 cdef extern from "sys/dtrace.h":
18
 
19
     ctypedef enum agg_actions:
20
@@ -34,10 +33,12 @@ cdef extern from "sys/dtrace.h":
21
         DTRACEAGG_QUANTIZE = (DTRACEACT_AGGREGATION + 7)
22
         DTRACEAGG_LQUANTIZE = (DTRACEACT_AGGREGATION + 8)
23
 
24
-    ctypedef enum quantize_types:
25
+    cdef int DTRACE_QUANTIZE_NBUCKETS
26
+    cdef int DTRACE_QUANTIZE_ZEROBUCKET
27
+    #ctypedef enum quantize_types:
28
         # NBBY = 8
29
-        DTRACE_QUANTIZE_NBUCKETS = (((sizeof (uint64_t) * 8) - 1) * 2 + 1)
30
-        DTRACE_QUANTIZE_ZEROBUCKET = ((sizeof (uint64_t) * 8) - 1)
31
+    #    DTRACE_QUANTIZE_NBUCKETS = (((sizeof (uint64_t) * 8) - 1) * 2 + 1)
32
+    #    DTRACE_QUANTIZE_ZEROBUCKET = ((sizeof (uint64_t) * 8) - 1)
33
 
34
     ctypedef struct dtrace_recdesc_t:
35
         # Taken from sys/dtrace.h:931
36
@@ -56,7 +57,6 @@ cdef extern from "sys/dtrace.h":
37
     cdef int32_t DTRACE_LQUANTIZE_BASE(long x)
38
     cdef int64_t DTRACE_QUANTIZE_BUCKETVAL(long buck)
39
 
40
-
41
 cdef extern from "dtrace.h":
42
 
43
     ctypedef enum dtrace_probespec_t:
(-)b/devel/py-python-dtrace/files/patch-setup.py (+18 lines)
Added Link Here
1
--- setup.py.orig
2
+++ setup.py
3
@@ -14,9 +14,12 @@ try:
4
     from Cython.Distutils import build_ext
5
 
6
     BUILD_EXTENSION = {'build_ext': build_ext}
7
-    EXT_MODULES = [Extension("dtrace", ["dtrace_cython/dtrace_h.pxd",
8
-                                        "dtrace_cython/consumer.pyx"],
9
-                             libraries=["dtrace"])]
10
+    EXT_MODULES = [Extension("dtrace",
11
+        ["dtrace_cython/dtrace_h.pxd", "dtrace_cython/consumer.pyx"],
12
+        libraries=["dtrace","proc","ctf","elf","z","rtld_db","pthread","util"],
13
+        include_dirs=['/sys/cddl/compat/opensolaris',
14
+		'/sys/cddl/contrib/opensolaris/uts/common',
15
+		'/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common'])]
16
 
17
 except ImportError:
18
     BUILD_EXTENSION = {}
(-)b/devel/py-python-dtrace/pkg-comment (+1 lines)
Added Link Here
1
DTrace consumer for Python based on libdtrace.
(-)b/devel/py-python-dtrace/pkg-descr (+6 lines)
Added Link Here
1
DTrace consumer for Python based on libdtrace.
2
3
Currently this package provides two modules: one wraps libdtrace using ctypes.
4
The other one uses cython.
5
6
WWW: http:// tmetsch.github.com/python-dtrace/

Return to bug 217419