From patchwork Mon Jul 28 22:33:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary.robertson@linaro.org X-Patchwork-Id: 34443 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA262202A1 for ; Mon, 28 Jul 2014 22:34:10 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g18sf55365841oah.2 for ; Mon, 28 Jul 2014 15:34:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=vKVEdfgk2n6bKdaZfXD26KpupRPMPquGIio4ukuhBTc=; b=SVwWSUP9+aXNFIgWwMbybdDEmyxHEO1/2Lbtz0379fbqy25MtAYIH4ijWFw+j+5KIm pMMcjSGLRMXUCr+KAEIat79ici0azqpZ5M7beNgla82fe+TWNa/34mQc+wcXs4uxSCjB OP5Li6uCuZQU0wn3Soz6aPQ9d97I8gwk+fTHNd52m1F7g2LM/6L4oZOC3rvLmgw/YkSy /MusfoZnU/a3A5oiKrDKGL42F9PSxiLYw12dG9PlvaPBWDVwGnKOTH8zpKTj23VhN0Eb ks75FMu9uscLbR/vuOSVknBw9BdqKNdfV+iuE2Vs2UMHEmIyBXG9Ysx8syQ+99hp0BEo Tw2A== X-Gm-Message-State: ALoCoQnfTy8bKoT6fyTi3EsGS8j8+cd5n0G3hiaNdtsFeQ7vC6QgpRevt3o3xV9AxmfVWDCp6/QT X-Received: by 10.182.66.234 with SMTP id i10mr18140746obt.12.1406586850225; Mon, 28 Jul 2014 15:34:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.203 with SMTP id v69ls2164151qgd.6.gmail; Mon, 28 Jul 2014 15:34:10 -0700 (PDT) X-Received: by 10.220.144.147 with SMTP id z19mr3864558vcu.26.1406586850114; Mon, 28 Jul 2014 15:34:10 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id tu4si13459386vcb.61.2014.07.28.15.34.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 15:34:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so12391933vcb.30 for ; Mon, 28 Jul 2014 15:34:10 -0700 (PDT) X-Received: by 10.221.34.13 with SMTP id sq13mr11735739vcb.16.1406586849994; Mon, 28 Jul 2014 15:34:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp200779vcb; Mon, 28 Jul 2014 15:34:09 -0700 (PDT) X-Received: by 10.50.108.100 with SMTP id hj4mr161528igb.43.1406586849067; Mon, 28 Jul 2014 15:34:09 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id x5si44396252icl.8.2014.07.28.15.34.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Jul 2014 15:34:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-list-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XBtUa-0005PF-11; Mon, 28 Jul 2014 22:34:04 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XBtUY-0005P9-Ms for ltp-list@lists.sourceforge.net; Mon, 28 Jul 2014 22:34:02 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.218.45 as permitted sender) client-ip=209.85.218.45; envelope-from=gary.robertson@linaro.org; helo=mail-oi0-f45.google.com; Received: from mail-oi0-f45.google.com ([209.85.218.45]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1XBtUX-0002wm-TP for ltp-list@lists.sourceforge.net; Mon, 28 Jul 2014 22:34:02 +0000 Received: by mail-oi0-f45.google.com with SMTP id e131so6652982oig.4 for ; Mon, 28 Jul 2014 15:33:56 -0700 (PDT) X-Received: by 10.182.233.230 with SMTP id tz6mr54485191obc.53.1406586836297; Mon, 28 Jul 2014 15:33:56 -0700 (PDT) Received: from honkintosh.cybertech.lan (65-120-133-114.dia.static.qwest.net. [65.120.133.114]) by mx.google.com with ESMTPSA id tr1sm42021148obb.10.2014.07.28.15.33.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 15:33:55 -0700 (PDT) From: "Gary S. Robertson" To: ltp-list@lists.sourceforge.net Date: Mon, 28 Jul 2014 17:33:44 -0500 Message-Id: <1406586824-1692-1-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1XBtUX-0002wm-TP Cc: mike.holmes@linaro.org Subject: [LTP] [PATCH] Allow mutex initialization without PI configured X-BeenThere: ltp-list@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-list-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: gary.robertson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: "Gary S. Robertson" LTP seems primarily intended to be built and run on the same machine, and thus uses autotools / autoconf to determine the features of the host machine's environment prior to compilation. However, when distributing precompiled binaries, or when building in a cross-compilation environment, it is better not to disable features based on the compile-time environment. This patch removes compile-time dependencies on priority-inheriting mutexes and allows the code to attempt initialization of PI mutexes even if the runtime environment lacks that feature... in which case the associated test(s) should fail. Without this patch, init_pi_mutex() may be compiled as an empty function, allowing subsequent operations to be attempted on an un-inititalized mutex. Likewise, testpi-3 may fail to initialize a mutex before starting pthreads which attempt to use the mutex. Signed-off-by: Gary S. Robertson --- testcases/realtime/lib/librttest.c | 2 -- testcases/realtime/stress/pi-tests/testpi-3.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/testcases/realtime/lib/librttest.c b/testcases/realtime/lib/librttest.c index 0dd6019..9f37d08 100644 --- a/testcases/realtime/lib/librttest.c +++ b/testcases/realtime/lib/librttest.c @@ -586,7 +586,6 @@ void *busy_work_us(int us) void init_pi_mutex(pthread_mutex_t * m) { -#if HAVE_DECL_PTHREAD_PRIO_INHERIT pthread_mutexattr_t attr; int ret; int protocol; @@ -609,7 +608,6 @@ void init_pi_mutex(pthread_mutex_t * m) if ((ret = pthread_mutex_init(m, &attr)) != 0) { printf("Failed to init mutex: %d (%s)\n", ret, strerror(ret)); } -#endif1G /* FIXME: does any of this need to be destroyed ? */ } diff --git a/testcases/realtime/stress/pi-tests/testpi-3.c b/testcases/realtime/stress/pi-tests/testpi-3.c index 30f38f6..807c9cc 100644 --- a/testcases/realtime/stress/pi-tests/testpi-3.c +++ b/testcases/realtime/stress/pi-tests/testpi-3.c @@ -365,7 +365,6 @@ int main(int argc, char *argv[]) printf("Start %s\n", argv[0]); -#if HAVE_DECL_PTHREAD_PRIO_INHERIT if (!nopi) { pthread_mutexattr_t mutexattr; int protocol; @@ -386,7 +385,6 @@ int main(int argc, char *argv[]) printf("Failed to init mutex: %d\n", retc); } } -#endif startThread(&arg1); startThread(&arg2);