From owner-svn-ports-head@freebsd.org Tue Feb 28 19:50:06 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 121BDCF1F37; Tue, 28 Feb 2017 19:50:06 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C703938F; Tue, 28 Feb 2017 19:50:05 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SJo464007970; Tue, 28 Feb 2017 19:50:04 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SJo4jm007963; Tue, 28 Feb 2017 19:50:04 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201702281950.v1SJo4jm007963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Tue, 28 Feb 2017 19:50:04 +0000 (UTC) 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 X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 19:50:06 -0000 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 (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 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/