From patchwork Mon Dec 5 12:30:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 5458 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2AE1523E18 for ; Mon, 5 Dec 2011 12:30:25 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0FE9DA1823D for ; Mon, 5 Dec 2011 12:30:25 +0000 (UTC) Received: by lagm6 with SMTP id m6so131352lag.11 for ; Mon, 05 Dec 2011 04:30:24 -0800 (PST) Received: by 10.152.134.179 with SMTP id pl19mr5873736lab.13.1323088224769; Mon, 05 Dec 2011 04:30:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs253542lal; Mon, 5 Dec 2011 04:30:24 -0800 (PST) Received: by 10.213.21.131 with SMTP id j3mr823827ebb.95.1323088221895; Mon, 05 Dec 2011 04:30:21 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id u44si6583678eeb.44.2011.12.05.04.30.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Dec 2011 04:30:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RXXgb-0001Id-DQ for ; Mon, 05 Dec 2011 12:30:21 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 5BCCBE03B0 for ; Mon, 5 Dec 2011 12:30:21 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glcompbench X-Launchpad-Branch: ~glcompbench-dev/glcompbench/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 65 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glcompbench-dev/glcompbench/trunk] Rev 65: GlCompositeBenchmark: Use the first 'sh' child to get the WID. Message-Id: <20111205123021.18804.60204.launchpad@ackee.canonical.com> Date: Mon, 05 Dec 2011 12:30:21 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14418"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 9a9d792649a7d942c101c11c9a5968d6379b8e81 ------------------------------------------------------------ revno: 65 committer: Alexandros Frantzis branch nick: trunk timestamp: Mon 2011-12-05 14:20:15 +0200 message: GlCompositeBenchmark: Use the first 'sh' child to get the WID. This avoids a race condition, where sometimes we capture another, wrong xterm child process (eg utempter). modified: src/gl-composite-benchmark --- lp:glcompbench https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk You are subscribed to branch lp:glcompbench. To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription === modified file 'src/gl-composite-benchmark' --- src/gl-composite-benchmark 2011-06-23 08:54:28 +0000 +++ src/gl-composite-benchmark 2011-12-05 12:20:15 +0000 @@ -24,9 +24,9 @@ pids="" wids="" -get_first_child_of_pid() +get_first_sh_child_of_pid() { - ps ax -o pid,ppid | awk -v PID=$1 '$2 == PID { print $1; exit }' + ps ax -o pid,ppid,comm | awk -v PID=$1 '$2 == PID && $3 == "sh" { print $1; exit }' } get_wid_from_pid() @@ -40,7 +40,7 @@ _child_pid= while [ -z "$_wid" ]; do if [ -z "$_child_pid" ]; then - _child_pid=$(get_first_child_of_pid $1) + _child_pid=$(get_first_sh_child_of_pid $1) fi if [ -n "$_child_pid" ]; then _wid=$(get_wid_from_pid $_child_pid)