Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2017 19:50:04 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r435080 - in head/devel: . py-python-dtrace py-python-dtrace/files
Message-ID:  <201702281950.v1SJo4jm007963@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Tue Feb 28 19:50:04 2017
New Revision: 435080
URL: https://svnweb.freebsd.org/changeset/ports/435080

Log:
  devel/py-python-dtrace: create port
  
  DTrace consumer for Python based on libdtrace.
  
  Currently this package provides two modules: one wraps libdtrace using ctypes.
  The other one uses cython.
  
  WWW: http://tmetsch.github.com/python-dtrace/
  
  PR:		217419
  Submitted by:	Graeme Jenkinson <gcj21@cl.cam.ac.uk> (with changes)

Added:
  head/devel/py-python-dtrace/
  head/devel/py-python-dtrace/Makefile   (contents, props changed)
  head/devel/py-python-dtrace/distinfo   (contents, props changed)
  head/devel/py-python-dtrace/files/
  head/devel/py-python-dtrace/files/patch-dtrace__cython_consumer.pyx   (contents, props changed)
  head/devel/py-python-dtrace/files/patch-dtrace__cython_dtrace__h.pxd   (contents, props changed)
  head/devel/py-python-dtrace/files/patch-setup.py   (contents, props changed)
  head/devel/py-python-dtrace/pkg-descr   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Tue Feb 28 18:58:17 2017	(r435079)
+++ head/devel/Makefile	Tue Feb 28 19:50:04 2017	(r435080)
@@ -4565,6 +4565,7 @@
     SUBDIR += py-pytest-xdist
     SUBDIR += py-python-bugzilla
     SUBDIR += py-python-distutils-extra
+    SUBDIR += py-python-dtrace
     SUBDIR += py-python-editor
     SUBDIR += py-python-gflags
     SUBDIR += py-python-gist

Added: head/devel/py-python-dtrace/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-python-dtrace/Makefile	Tue Feb 28 19:50:04 2017	(r435080)
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+PORTNAME=	python-dtrace
+PORTVERSION=	0.0.9
+CATEGORIES=	devel python
+MASTER_SITES=	CHEESESHOP
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	gcj21@cl.cam.ac.uk
+COMMENT=	DTrace consumer for Python based on libdtrace
+
+LICENSE=	MIT
+
+BUILD_DEPENDS=	cython:lang/cython
+RUN_DEPENDS=	cython:lang/cython
+
+USES=		python zip
+USE_PYTHON=	autoplist distutils
+
+.include <bsd.port.mk>

Added: head/devel/py-python-dtrace/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-python-dtrace/distinfo	Tue Feb 28 19:50:04 2017	(r435080)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1476182943
+SHA256 (python-dtrace-0.0.9.zip) = 9daa24fe3b5d16c17c4afed00d3b2b2f869598efc5a8100b8570342713328912
+SIZE (python-dtrace-0.0.9.zip) = 21764

Added: head/devel/py-python-dtrace/files/patch-dtrace__cython_consumer.pyx
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-python-dtrace/files/patch-dtrace__cython_consumer.pyx	Tue Feb 28 19:50:04 2017	(r435080)
@@ -0,0 +1,35 @@
+--- dtrace_cython/consumer.pyx.orig	2015-01-24 23:40:08 UTC
++++ dtrace_cython/consumer.pyx
+@@ -2,7 +2,7 @@
+ import time
+ import threading
+ from threading import Thread
+-from dtrace_consumer.dtrace_h cimport *
++from dtrace_cython.dtrace_h cimport *
+ 
+ # ----------------------------------------------------------------------------
+ # The DTrace callbacks
+@@ -333,6 +333,11 @@ cdef class DTraceConsumer:
+                             dtrace_errmsg(self.handle,
+                                           dtrace_errno(self.handle)))
+ 
++    def setopt(self, key, value):
++        if dtrace_setopt(self.handle, key, value) != 0:
++            raise Exception(dtrace_errmsg(self.handle,
++                                          dtrace_errno(self.handle)))
++
+ 
+ cdef class DTraceContinuousConsumer:
+     """
+@@ -434,6 +439,11 @@ cdef class DTraceContinuousConsumer:
+ 
+         return status
+ 
++    def setopt(self, key, value):
++        if dtrace_setopt(self.handle, key, value) != 0:
++            raise Exception(dtrace_errmsg(self.handle,
++                                          dtrace_errno(self.handle)))
++
+ 
+ class DTraceConsumerThread(Thread):
+     """

Added: head/devel/py-python-dtrace/files/patch-dtrace__cython_dtrace__h.pxd
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-python-dtrace/files/patch-dtrace__cython_dtrace__h.pxd	Tue Feb 28 19:50:04 2017	(r435080)
@@ -0,0 +1,43 @@
+--- dtrace_cython/dtrace_h.pxd.orig	2015-01-24 23:30:44 UTC
++++ dtrace_cython/dtrace_h.pxd
+@@ -7,7 +7,7 @@ cdef extern from "libelf_workaround.h":
+     pass
+ 
+ 
+-IF UNAME_SYSNAME == "Darwin":
++IF UNAME_SYSNAME == "Darwin" or UNAME_SYSNAME == "FreeBSD":
+     cdef extern from "stdint.h":
+         # needed for quantize mths.
+         cdef int64_t INT64_MAX
+@@ -18,7 +18,6 @@ ELSE:
+         cdef int64_t INT64_MAX
+         cdef int64_t INT64_MIN
+ 
+-
+ cdef extern from "sys/dtrace.h":
+ 
+     ctypedef enum agg_actions:
+@@ -34,10 +33,12 @@ cdef extern from "sys/dtrace.h":
+         DTRACEAGG_QUANTIZE = (DTRACEACT_AGGREGATION + 7)
+         DTRACEAGG_LQUANTIZE = (DTRACEACT_AGGREGATION + 8)
+ 
+-    ctypedef enum quantize_types:
++    cdef int DTRACE_QUANTIZE_NBUCKETS
++    cdef int DTRACE_QUANTIZE_ZEROBUCKET
++    #ctypedef enum quantize_types:
+         # NBBY = 8
+-        DTRACE_QUANTIZE_NBUCKETS = (((sizeof (uint64_t) * 8) - 1) * 2 + 1)
+-        DTRACE_QUANTIZE_ZEROBUCKET = ((sizeof (uint64_t) * 8) - 1)
++    #    DTRACE_QUANTIZE_NBUCKETS = (((sizeof (uint64_t) * 8) - 1) * 2 + 1)
++    #    DTRACE_QUANTIZE_ZEROBUCKET = ((sizeof (uint64_t) * 8) - 1)
+ 
+     ctypedef struct dtrace_recdesc_t:
+         # Taken from sys/dtrace.h:931
+@@ -56,7 +57,6 @@ cdef extern from "sys/dtrace.h":
+     cdef int32_t DTRACE_LQUANTIZE_BASE(long x)
+     cdef int64_t DTRACE_QUANTIZE_BUCKETVAL(long buck)
+ 
+-
+ cdef extern from "dtrace.h":
+ 
+     ctypedef enum dtrace_probespec_t:

Added: head/devel/py-python-dtrace/files/patch-setup.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-python-dtrace/files/patch-setup.py	Tue Feb 28 19:50:04 2017	(r435080)
@@ -0,0 +1,18 @@
+--- setup.py.orig	2015-01-26 14:26:50 UTC
++++ setup.py
+@@ -14,9 +14,12 @@ try:
+     from Cython.Distutils import build_ext
+ 
+     BUILD_EXTENSION = {'build_ext': build_ext}
+-    EXT_MODULES = [Extension("dtrace", ["dtrace_cython/dtrace_h.pxd",
+-                                        "dtrace_cython/consumer.pyx"],
+-                             libraries=["dtrace"])]
++    EXT_MODULES = [Extension("dtrace",
++        ["dtrace_cython/dtrace_h.pxd", "dtrace_cython/consumer.pyx"],
++        libraries=["dtrace","proc","ctf","elf","z","rtld_db","pthread","util"],
++        include_dirs=['/sys/cddl/compat/opensolaris',
++		'/sys/cddl/contrib/opensolaris/uts/common',
++		'/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common'])]
+ 
+ except ImportError:
+     BUILD_EXTENSION = {}

Added: head/devel/py-python-dtrace/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-python-dtrace/pkg-descr	Tue Feb 28 19:50:04 2017	(r435080)
@@ -0,0 +1,6 @@
+DTrace consumer for Python based on libdtrace.
+
+Currently this package provides two modules: one wraps libdtrace using ctypes.
+The other one uses cython.
+
+WWW: http://tmetsch.github.com/python-dtrace/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702281950.v1SJo4jm007963>