Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp174695pxf; Wed, 24 Mar 2021 02:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxO2DYKeYtsixOXqGgVVWYZPF0CnmsdzXnZCvcSBIh1fPWpj3a9xjehzUYKjMnXfmFjG56 X-Received: by 2002:a17:906:ad85:: with SMTP id la5mr2545366ejb.37.1616577201243; Wed, 24 Mar 2021 02:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616577201; cv=none; d=google.com; s=arc-20160816; b=WfvjLYH4UL1gAdcKk731QsE0oXnkfwwpZ0Y5pUSVuhDYNejd113YRicqtRo81f4Xaa K3tVmgjtzdI//m4VDxy0XixnXSiTpVxmVL11xRrdSzGICiCZM3P9nT6mU/BGuhlQl9Rh L95DZCWEOih+lOwb11pTLCx4MppHvkJRPu8qHIbKVtpSTSh7LMSlR9YkwZCSx8/hiVzh wj0aE+bN+px8/2oOM0E2pdvFtFA47KDEkAcNA3w80Wnoy1EA8Kyhydf+GzK37sVaazut PGFAIjk/VNoHwtppl0mlYPJ73euJ6TGJDUrpCZODc1q1nByd4PIKwZD94iGbnGlDz5HB IySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tal5jVdrjgVWMUWypFZT5HSvKaB1RMRGOJXZbG1abew=; b=u0Y4GGX/06yI/Ini/Fa8/ybq+Y05/g8J9rUlvD11YyOBa5g1t9qh6coW8epcpVobbm flCsu6nSUgLd9cG/oL5jHWpCvvTI8itIvtoPjoPTCt1YiRwkyA3wW/0OYGNnrqwxyszR WaEFkx7iBLuE6ZfWJvbQcwHI1/t33xIHEPk3xSY+k6TdgYEzWM+oGvAmmP7LHj1lQewb dkCgcONPYMxLh6/fFsT06SKWvOthfHb3r3+s/wiabozX3ZyAi2h1GeZyCX7tXIMGyzc0 6Xjy2nY3rsM4Q+VvpV+i0sxEkHcQ3922lUw9v1YyH74G0oE2qNDk34rgQaoeMsk5ijX8 omHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si1284912ejx.201.2021.03.24.02.12.57; Wed, 24 Mar 2021 02:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231633AbhCXBpn (ORCPT + 99 others); Tue, 23 Mar 2021 21:45:43 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:34716 "EHLO mail-lf1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbhCXBpe (ORCPT ); Tue, 23 Mar 2021 21:45:34 -0400 Received: by mail-lf1-f54.google.com with SMTP id i26so13667078lfl.1 for ; Tue, 23 Mar 2021 18:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tal5jVdrjgVWMUWypFZT5HSvKaB1RMRGOJXZbG1abew=; b=TF2PchEcCOL2Rd7hvH8yCqatXACCZDwmZ4MqiK+22aXQC63kk9+X+KNhIIx71LZ0Cc xf//5vDBn9q/Jiq6vcQLGS81RPfiia7TFtQpswWt6/gLRKCOnBvL2K29xmKuQAGqJcRi abUidkYieZBPutd8mn7UsXEst2C5w51dG+cdzkoSvlspTjxB9sK/H27tI+XBGbLnkymj 3KMw3zrMmrf01EpKDs+wAe4heR+YkCMj4qykLecTXKyHOnigFnR91H1lniFpX70r7IqU z0C0My/93HUlYrWQMs0m37tQjnJ5vYdHKpXZ1yp+dDIJizvISkABZ/iaeeMDWltnJlYK dc4A== X-Gm-Message-State: AOAM532NmMFsG8wNULi3xl4JvDmOJCg+U67sXmsHveXD4kSA+30Zd8RF j1+qMzB1v8TuUkzakZsSEfcff0ADC92g/u9XgvI= X-Received: by 2002:a19:430e:: with SMTP id q14mr541786lfa.374.1616550333154; Tue, 23 Mar 2021 18:45:33 -0700 (PDT) MIME-Version: 1.0 References: <20210320104554.529213-1-leo.yan@linaro.org> In-Reply-To: <20210320104554.529213-1-leo.yan@linaro.org> From: Namhyung Kim Date: Wed, 24 Mar 2021 10:45:22 +0900 Message-ID: Subject: Re: [PATCH] perf test: Change to use bash for daemon test To: Leo Yan Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Ian Rogers , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leo, On Sat, Mar 20, 2021 at 7:46 PM Leo Yan wrote: > > When executed the daemon test on Arm64 and x86 with Debian (Buster) > distro, both skip the test case with the log: > > # ./perf test -v 76 > 76: daemon operations : > --- start --- > test child forked, pid 11687 > test daemon list > trap: SIGINT: bad trap > ./tests/shell/daemon.sh: 173: local: cpu-clock: bad variable name > test child finished with -2 > ---- end ---- > daemon operations: Skip > > So the error happens for the variable expansion when use local variable > in the shell script. Since Debian Buster uses dash but not bash as > non-interactive shell, when execute the daemon testing, it hits a > known issue for dash which was reported [1]. > > To resolve this issue, one option is to add double quotes for all local > variables assignment, so need to change the code from: > > local line=`perf daemon --config ${config} -x: | head -2 | tail -1` > > ... to: > > local line="`perf daemon --config ${config} -x: | head -2 | tail -1`" > > But the testing script has bunch of local variables, this leads to big > changes for whole script. > > On the other hand, the testing script asks to use the "local" feature > which is bash-specific, so this patch explicitly uses "#!/bin/bash" to > ensure running the script with bash. > > After: > > # ./perf test -v 76 > 76: daemon operations : > --- start --- > test child forked, pid 11329 > test daemon list > test daemon reconfig > test daemon stop > test daemon signal > signal 12 sent to session 'test [11596]' > signal 12 sent to session 'test [11596]' > test daemon ping > test daemon lock > test child finished with 0 > ---- end ---- > daemon operations: Ok > > [1] https://bugs.launchpad.net/ubuntu/+source/dash/+bug/139097 > > Fixes: 2291bb915b55 ("perf tests: Add daemon 'list' command test") > Signed-off-by: Leo Yan Acked-by: Namhyung Kim Thanks, Namhyung > --- > tools/perf/tests/shell/daemon.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh > index ee4a30ca3f57..45fc24af5b07 100755 > --- a/tools/perf/tests/shell/daemon.sh > +++ b/tools/perf/tests/shell/daemon.sh > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > # daemon operations > # SPDX-License-Identifier: GPL-2.0 > > -- > 2.25.1 >