From owner-svn-ports-head@freebsd.org Mon Feb 6 14:47:26 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 93F61CD32B4; Mon, 6 Feb 2017 14:47:26 +0000 (UTC) (envelope-from vanilla@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 608A811E8; Mon, 6 Feb 2017 14:47:26 +0000 (UTC) (envelope-from vanilla@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v16ElP5X011330; Mon, 6 Feb 2017 14:47:25 GMT (envelope-from vanilla@FreeBSD.org) Received: (from vanilla@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v16ElPZ5011325; Mon, 6 Feb 2017 14:47:25 GMT (envelope-from vanilla@FreeBSD.org) Message-Id: <201702061447.v16ElPZ5011325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vanilla set sender to vanilla@FreeBSD.org using -f From: "Vanilla I. Shu" Date: Mon, 6 Feb 2017 14:47:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r433492 - in head/devel/pecl-swoole: . 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: Mon, 06 Feb 2017 14:47:26 -0000 Author: vanilla Date: Mon Feb 6 14:47:24 2017 New Revision: 433492 URL: https://svnweb.freebsd.org/changeset/ports/433492 Log: Enable cpu affinity function. Added: head/devel/pecl-swoole/files/patch-include_swoole.h (contents, props changed) head/devel/pecl-swoole/files/patch-src_network_Server.c (contents, props changed) head/devel/pecl-swoole/files/patch-swoole__process.c (contents, props changed) Modified: head/devel/pecl-swoole/Makefile head/devel/pecl-swoole/files/patch-config.m4 Modified: head/devel/pecl-swoole/Makefile ============================================================================== --- head/devel/pecl-swoole/Makefile Mon Feb 6 14:32:00 2017 (r433491) +++ head/devel/pecl-swoole/Makefile Mon Feb 6 14:47:24 2017 (r433492) @@ -3,6 +3,7 @@ PORTNAME= swoole PORTVERSION= 1.9.5 +PORTREVISION= 1 CATEGORIES= devel net MASTER_SITES= http://pecl.php.net/get/ PKGNAMEPREFIX= pecl- Modified: head/devel/pecl-swoole/files/patch-config.m4 ============================================================================== --- head/devel/pecl-swoole/files/patch-config.m4 Mon Feb 6 14:32:00 2017 (r433491) +++ head/devel/pecl-swoole/files/patch-config.m4 Mon Feb 6 14:47:24 2017 (r433492) @@ -1,6 +1,20 @@ ---- config.m4.orig 2017-02-05 15:08:47 UTC +--- config.m4.orig 2017-01-24 02:05:48 UTC +++ config.m4 -@@ -178,7 +178,7 @@ if test "$PHP_SWOOLE" != "no"; then +@@ -85,7 +85,13 @@ AC_DEFUN([AC_SWOOLE_CPU_AFFINITY], + AC_MSG_CHECKING([for cpu affinity]) + AC_TRY_COMPILE( + [ ++ #ifdef __FreeBSD__ ++ #include ++ #include ++ typedef cpuset_t cpu_set_t; ++ #else + #include ++ #endif + ], [ + cpu_set_t cpu_set; + CPU_ZERO(&cpu_set); +@@ -178,7 +184,7 @@ if test "$PHP_SWOOLE" != "no"; then AC_CHECK_LIB(c, poll, AC_DEFINE(HAVE_POLL, 1, [have poll])) AC_CHECK_LIB(c, sendfile, AC_DEFINE(HAVE_SENDFILE, 1, [have sendfile])) AC_CHECK_LIB(c, kqueue, AC_DEFINE(HAVE_KQUEUE, 1, [have kqueue])) Added: head/devel/pecl-swoole/files/patch-include_swoole.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pecl-swoole/files/patch-include_swoole.h Mon Feb 6 14:47:24 2017 (r433492) @@ -0,0 +1,20 @@ +--- include/swoole.h.orig 2017-01-24 02:05:48 UTC ++++ include/swoole.h +@@ -40,7 +40,17 @@ extern "C" { + #include + #include + #include ++ ++#if defined(HAVE_CPU_AFFINITY) ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++typedef cpuset_t cpu_set_t; ++#else + #include ++#endif ++#endif + + #include + #include Added: head/devel/pecl-swoole/files/patch-src_network_Server.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pecl-swoole/files/patch-src_network_Server.c Mon Feb 6 14:47:24 2017 (r433492) @@ -0,0 +1,16 @@ +--- src/network/Server.c.orig 2017-02-06 09:30:50 UTC ++++ src/network/Server.c +@@ -522,7 +522,13 @@ int swServer_worker_init(swServer *serv, + { + CPU_SET(SwooleWG.id % SW_CPU_NUM, &cpu_set); + } ++ ++#ifdef __FreeBSD__ ++ if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, ++ sizeof(cpu_set), &cpu_set) < 0) ++#else + if (sched_setaffinity(getpid(), sizeof(cpu_set), &cpu_set) < 0) ++#endif + { + swSysError("sched_setaffinity() failed."); + } Added: head/devel/pecl-swoole/files/patch-swoole__process.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pecl-swoole/files/patch-swoole__process.c Mon Feb 6 14:47:24 2017 (r433492) @@ -0,0 +1,15 @@ +--- swoole_process.c.orig 2017-02-06 09:32:48 UTC ++++ swoole_process.c +@@ -963,7 +963,12 @@ static PHP_METHOD(swoole_process, setaff + CPU_SET(Z_LVAL_P(value), &cpu_set); + SW_HASHTABLE_FOREACH_END(); + ++#ifdef __FreeBSD__ ++ if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, ++ sizeof(cpu_set), &cpu_set) < 0) ++#else + if (sched_setaffinity(getpid(), sizeof(cpu_set), &cpu_set) < 0) ++#endif + { + swoole_php_sys_error(E_WARNING, "sched_setaffinity() failed."); + RETURN_FALSE;