From patchwork Wed Sep 13 10:43:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Hiler X-Patchwork-Id: 9950989 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CE446038F for ; Wed, 13 Sep 2017 10:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EFCE28FBC for ; Wed, 13 Sep 2017 10:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23EEA28FBE; Wed, 13 Sep 2017 10:43:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D43A28FBD for ; Wed, 13 Sep 2017 10:43:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA1926E7F1; Wed, 13 Sep 2017 10:43:35 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAB396E09D for ; Wed, 13 Sep 2017 10:43:32 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 13 Sep 2017 03:43:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,387,1500966000"; d="scan'208";a="128311044" Received: from ahiler-desk1.fi.intel.com ([10.237.68.139]) by orsmga004.jf.intel.com with ESMTP; 13 Sep 2017 03:43:31 -0700 From: Arkadiusz Hiler To: intel-gfx@lists.freedesktop.org Date: Wed, 13 Sep 2017 13:43:20 +0300 Message-Id: <20170913104320.6329-2-arkadiusz.hiler@intel.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170913104320.6329-1-arkadiusz.hiler@intel.com> References: <20170913104320.6329-1-arkadiusz.hiler@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional" X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit d7d3f4e87b827152f00bdf89a67871736672b492 and gets rid of the config option from the meson.build. It was needed only for the Android support. Signed-off-by: Arkadiusz Hiler --- configure.ac | 6 +----- lib/igt_aux.c | 35 +++-------------------------------- meson.build | 5 +---- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git a/configure.ac b/configure.ac index c78f5194..2dc03eb2 100644 --- a/configure.ac +++ b/configure.ac @@ -123,11 +123,7 @@ AC_SUBST(ASSEMBLER_WARN_CFLAGS) PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.82]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) PKG_CHECK_MODULES(KMOD, [libkmod]) -PKG_CHECK_MODULES(PROCPS, [libprocps], [procps=yes], [procps=no]) -AM_CONDITIONAL(HAVE_PROCPS, [test "x$procps" = xyes]) -if test x"$procps" = xyes; then - AC_DEFINE(HAVE_PROCPS,1,[Enable process managment without shelling out]) -fi +PKG_CHECK_MODULES(PROCPS, [libprocps]) PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no]) if test x$have_valgrind = xyes; then diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 295e435c..76b2e52a 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -48,7 +48,9 @@ #include #include #include -#include + +#include + #include "drmtest.h" #include "i915_drm.h" #include "intel_chipset.h" @@ -68,10 +70,6 @@ #include /* for dirname() */ #endif -#ifdef HAVE_PROCPS -#include -#endif - /** * SECTION:igt_aux * @short_description: Auxiliary libraries and support functions @@ -1242,7 +1240,6 @@ void igt_set_module_param_int(const char *name, int val) * This function sends the signal @sig for a process found in process table * with name @comm. */ -#ifdef HAVE_PROCPS int igt_terminate_process(int sig, const char *comm) { PROCTAB *proc; @@ -1267,19 +1264,7 @@ int igt_terminate_process(int sig, const char *comm) closeproc(proc); return err; } -#else -#warning "No procps, using naive implementation of igt_terminate_process" -int igt_terminate_process(int sig, const char *comm) -{ - char pkill_cmd[NAME_MAX]; - - snprintf(pkill_cmd, sizeof(pkill_cmd), "pkill -x -%d %s", sig, comm); - return system(pkill_cmd); -} -#endif - -#ifdef HAVE_PROCPS struct pinfo { pid_t pid; const char *comm; @@ -1461,7 +1446,6 @@ __igt_lsof(const char *dir) closeproc(proc); } -#endif /** * igt_lsof: Lists information about files opened by processes. @@ -1470,7 +1454,6 @@ __igt_lsof(const char *dir) * This function mimics (a restrictive form of) lsof(8), but also shows * information about opened fds. */ -#ifdef HAVE_PROCPS void igt_lsof(const char *dpath) { @@ -1495,18 +1478,6 @@ igt_lsof(const char *dpath) free(sanitized); } -#else -#warning "No procps, using naive implementation of igt_lsof" - -void -igt_lsof(const char *dpath) -{ - char lsof_cmd[NAME_MAX]; - - snprintf(lsof_cmd, sizeof(lsof_cmd), "lsof +d %s", dpath); - system(lsof_cmd); -} -#endif static struct igt_siglatency { timer_t timer; diff --git a/meson.build b/meson.build index 0858354f..8f077602 100644 --- a/meson.build +++ b/meson.build @@ -38,10 +38,7 @@ libdrm_amdgpu = dependency('libdrm_amdgpu', required : false) pciaccess = dependency('pciaccess', version : '>=0.10') libkmod = dependency('libkmod') -libprocps = dependency('libprocps', required : false) -if libprocps.found() - config_h.set('HAVE_PROCPS', 1) -endif +libprocps = dependency('libprocps', required : true) valgrind = dependency('valgrind', required : false) if valgrind.found()