From patchwork Fri Jul 25 22:20:43 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: 34324 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D1CA235AB for ; Fri, 25 Jul 2014 22:22:28 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf31063365pdb.1 for ; Fri, 25 Jul 2014 15:22:27 -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:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=77cBRLN5AvwSH4x+YM+Vn6VcKoCO4v4gyDfAuVkqYb8=; b=UxtQDZ0QbG3FVt7mO3t9j91dBiw1aqhnvDEJEipYOqlHNlaTONgiRrSVkVm5XkNW9I XlGtGBXEuBmejunJov3CDbk0nxW2gV7B5/AfldILKZ1RP5sJRjCPFuCNYjc8d9/E2IlY mXy8NXCvZPGOqyt2LMDRBS46w96AfrQLI0BrVsNZ/q2zHq/jRvaV6or9gUZ/Ydm2aaUW YYBjNGyNMQEryepVa7Z44/2ErCcy6DrhQgVJxme9qI184pfxbZ1nj4bW6fhfQXECM9R8 mP0RqZRgP+F0L4Kxm+ZzY2h67sZ1ZJ7ETZss7L0AZWtOsRu0y+Kiz+rMHrmlnZpPO2l4 YAiA== X-Gm-Message-State: ALoCoQnzVAA/HlxoCnTjYWo+yTJ2oy8uKrbzicFyOU6l7j5SnLgDQFtSkzE9nQHe6Gb2k/kLDj4f X-Received: by 10.66.150.225 with SMTP id ul1mr9840714pab.20.1406326947790; Fri, 25 Jul 2014 15:22:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.80 with SMTP id y74ls1361095qgd.0.gmail; Fri, 25 Jul 2014 15:22:27 -0700 (PDT) X-Received: by 10.220.252.198 with SMTP id mx6mr24343987vcb.15.1406326947556; Fri, 25 Jul 2014 15:22:27 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ci13si8489854vec.13.2014.07.25.15.22.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 15:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so8405808vcb.3 for ; Fri, 25 Jul 2014 15:22:27 -0700 (PDT) X-Received: by 10.52.163.229 with SMTP id yl5mr4572969vdb.79.1406326947351; Fri, 25 Jul 2014 15:22:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp70164vcb; Fri, 25 Jul 2014 15:22:26 -0700 (PDT) X-Received: by 10.70.45.46 with SMTP id j14mr21861842pdm.29.1406326946476; Fri, 25 Jul 2014 15:22:26 -0700 (PDT) Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id rf4si5263128pdb.213.2014.07.25.15.22.25 for ; Fri, 25 Jul 2014 15:22:26 -0700 (PDT) Received-SPF: none (google.com: openembedded-core-bounces@lists.openembedded.org does not designate permitted sender hosts) client-ip=140.211.169.62; Received: from mail.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id C45FB70732; Fri, 25 Jul 2014 22:22:23 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by mail.openembedded.org (Postfix) with ESMTP id 5E640706C6 for ; Fri, 25 Jul 2014 22:21:05 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id e131so3908210oig.40 for ; Fri, 25 Jul 2014 15:21:07 -0700 (PDT) X-Received: by 10.182.199.5 with SMTP id jg5mr26954240obc.75.1406326866932; Fri, 25 Jul 2014 15:21:06 -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 q3sm40881371oei.3.2014.07.25.15.21.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 15:21:06 -0700 (PDT) From: "Gary S. Robertson" To: openembedded-core@lists.openembedded.org Date: Fri, 25 Jul 2014 17:20:43 -0500 Message-Id: <1406326845-17506-2-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406326845-17506-1-git-send-email-gary.robertson@linaro.org> References: <1406326845-17506-1-git-send-email-gary.robertson@linaro.org> Cc: mike.holmes@linaro.org Subject: [OE-core] [PATCH 1/3] LTP: Realtime tests - Allow-mutex-initialization-without-PI-configured X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org 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.172 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" In the OE build environment the features on the build host may not match those of the runtime host -so- the conditional compilation clauses were deleted which required the presence of priority inheriting mutexes in order to compile initialization of a mutex with priority inheritance. This allows this code to execute and fail if the runtime host lacks priority inheritance, while eliminating any dependence on PI mutexes in the build host. Signed-off-by: Gary S. Robertson --- ...utex-initialization-without-PI-configured.patch | 66 ++++++++++++++++++++ meta/recipes-extended/ltp/ltp_20140422.bb | 1 + 2 files changed, 67 insertions(+) create mode 100644 meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch diff --git a/meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch b/meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch new file mode 100644 index 0000000..2de6e22 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-Allow-mutex-initialization-without-PI-configured.patch @@ -0,0 +1,66 @@ +From 62dfb25fa3b6e71650bc3fff9a4a0eaec0f5ac8e Mon Sep 17 00:00:00 2001 +From: "Gary S. Robertson" +Date: Fri, 25 Jul 2014 09:25:13 -0500 +Subject: [PATCH] Allow mutex initialization without PI configured + +LTP is primarily intended to be built and run on the same machine, +and uses autotools / autoconf to determine the features of the host +machine's environment prior to compilation. However in the OE +environment, LTP may get built into a generic filesystem image +which will be used with a variety of different kernels later... +so for the OE 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 should fail. + +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)); + } +-#endif + + /* 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); +-- +1.7.9.5 + diff --git a/meta/recipes-extended/ltp/ltp_20140422.bb b/meta/recipes-extended/ltp/ltp_20140422.bb index 30761fd..2ac2187 100644 --- a/meta/recipes-extended/ltp/ltp_20140422.bb +++ b/meta/recipes-extended/ltp/ltp_20140422.bb @@ -26,6 +26,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ file://0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch \ file://ltp-Do-not-link-against-libfl.patch \ file://automake-foreign.patch \ + file://0001-Allow-mutex-initialization-without-PI-configured.patch \ " S = "${WORKDIR}/git"