From patchwork Fri Feb 22 01:26:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 10825047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A48036C2 for ; Fri, 22 Feb 2019 01:27:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 904D5304FA for ; Fri, 22 Feb 2019 01:27:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83ED630545; Fri, 22 Feb 2019 01:27:21 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 141B3304FA for ; Fri, 22 Feb 2019 01:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726165AbfBVB1U (ORCPT ); Thu, 21 Feb 2019 20:27:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:33696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbfBVB1U (ORCPT ); Thu, 21 Feb 2019 20:27:20 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3BFF207E0; Fri, 22 Feb 2019 01:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550798840; bh=z2IAi+1Bu0T+zEWndJMftHNI5RUtoIFALL7GqnhmCrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=znTd3W44YfTVeYI5I6Qu4qx85RqvXCuvDDOcFoEIfscG7Lx3O1JO2tPLnzfTaTZuB 8K+Z86QutL2fb8YKRD3L1h28xQhn0PCPZ5cxrMwNko4I8guA3eyYaylT+BPMaAulIy 4nzfiomo3lsmtbI/l5Bs9taFTBLnnhC9mqEZc0ss= From: Masami Hiramatsu To: Shuah Khan Cc: Juerg Haefliger , Steven Rostedt , Ingo Molnar , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean Date: Fri, 22 Feb 2019 10:26:57 +0900 Message-Id: <155079881689.5157.10494170079333363559.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <155079878723.5157.12433171255092403676.stgit@devbox> References: <155079878723.5157.12433171255092403676.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make kprobe_ftrace.tc checkbashisms clean. Since "grep function available_tracers" causes an error on checkbashisms, fix it by explicitly escaping with double-quotations. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/kprobe/kprobe_ftrace.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc index 492426e95e09..7650a82db3f5 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc @@ -3,7 +3,7 @@ # description: Kprobe dynamic event with function tracer [ -f kprobe_events ] || exit_unsupported # this is configurable -grep function available_tracers || exit_unsupported # this is configurable +grep "function" available_tracers || exit_unsupported # this is configurable # prepare echo nop > current_tracer From patchwork Fri Feb 22 01:27:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 10825049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFB946C2 for ; Fri, 22 Feb 2019 01:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBF9F304FA for ; Fri, 22 Feb 2019 01:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D005D30545; Fri, 22 Feb 2019 01:27:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ECF2304FA for ; Fri, 22 Feb 2019 01:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726165AbfBVB1t (ORCPT ); Thu, 21 Feb 2019 20:27:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:33830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725869AbfBVB1t (ORCPT ); Thu, 21 Feb 2019 20:27:49 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37EDA207E0; Fri, 22 Feb 2019 01:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550798868; bh=RB7jNEYHIyfWPaSAh3WqkGGYKLM1w67mawtfHLwHWDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PeJDuIlK77dkowopOAUdkMhsHYjo15yIAaC/fWwvZoD/oH4W0tnsQ+0GrWftmrpLk PnE0mwsF7vlYoeyVcElHtuDZgFzc2+/C61C/ot+uUBRKQnRlADtXiZuLsKx1/P4SuA NSmuwhzJcgfvjVS6pzL/9F3R6ybX8jyZrC400E7w= From: Masami Hiramatsu To: Shuah Khan Cc: Juerg Haefliger , Steven Rostedt , Ingo Molnar , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase Date: Fri, 22 Feb 2019 10:27:25 +0900 Message-Id: <155079884527.5157.14848621451304431136.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <155079878723.5157.12433171255092403676.stgit@devbox> References: <155079878723.5157.12433171255092403676.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a meta-testcase which tests ftracetest itself with checkbasisms. This helps us to keep our test script bashisms clean. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/ftracetest | 1 + .../selftests/ftrace/test.d/selftest/bashisms.tc | 21 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index 75244db70331..72b6df37cdb9 100755 --- a/tools/testing/selftests/ftrace/ftracetest +++ b/tools/testing/selftests/ftrace/ftracetest @@ -313,6 +313,7 @@ run_test() { # testfile local testlog=/proc/self/fd/1 fi export TMPDIR=`mktemp -d /tmp/ftracetest-dir.XXXXXX` + export FTRACETEST_ROOT=$TOP_DIR echo "execute$INSTANCE: "$1 > $testlog SIG_RESULT=0 if [ $VERBOSE -eq -1 ]; then diff --git a/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc b/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc new file mode 100644 index 000000000000..1b081e910e14 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc @@ -0,0 +1,21 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Meta-selftest: Checkbashisms + +if [ ! -f $FTRACETEST_ROOT/ftracetest ]; then + echo "Hmm, we can not find ftracetest" + exit_unresolved +fi + +if ! which checkbashisms > /dev/null 2>&1 ; then + echo "No checkbashisms found. skipped." + exit_unresolved +fi + +checkbashisms $FTRACETEST_ROOT/ftracetest +checkbashisms $FTRACETEST_ROOT/test.d/functions +for t in $(find $FTRACETEST_ROOT/test.d -name \*.tc); do + checkbashisms $t +done + +exit 0