From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD853C432C0 for ; Tue, 26 Nov 2019 08:34:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 936F020678 for ; Tue, 26 Nov 2019 08:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574757286; bh=sT2P3jcqZzwiE0tNd5Vyi3LpzVl1tf4SHap4G4TGsII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=arQCX1v3kYEdrQyV8s133XTc1P++TmIG4AJKuoujaVAKoqAEm1Uoa9N6EvUs7qXOw Y4Gc/udgd4Xg2Dw8lrmh/aYyjeZBI4V726vmTz7wtR7GiASKd34lG9QkG0AkFj0rwB 9XAnCKDalfzrtSZfdlOnbBgTwuFJG0Q4BVRHWiUs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbfKZIeq (ORCPT ); Tue, 26 Nov 2019 03:34:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:33014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbfKZIeq (ORCPT ); Tue, 26 Nov 2019 03:34:46 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29C4A2084B; Tue, 26 Nov 2019 08:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574757285; bh=sT2P3jcqZzwiE0tNd5Vyi3LpzVl1tf4SHap4G4TGsII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tfZpVpvX8X+lMwMJgdU9bHtkdDLkwzeKwc/Bp7aDaSoVyvLvj8J8VDWweWFxZZrGv 70DszgLZzGiyF0/BaIp6X/yLCBSt/mjt/ADdh0P603MBclyOPHE4/k8LJJRDIw2g0h aNXtvNgVX0wfZPVDcGbiIc74AUf1+Sehl8Mod3BM= From: Masami Hiramatsu To: Shuah Khan , Steven Rostedt Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BUGFIX PATCH v4 4/4] selftests/ftrace: Fix multiple kprobe testcase Date: Tue, 26 Nov 2019 17:34:42 +0900 Message-Id: <157475728194.3389.8125594709546416519.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157475724667.3389.15752644047898709246.stgit@devnote2> References: <157475724667.3389.15752644047898709246.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Fix multiple kprobe event testcase to work it correctly. There are 2 bugfixes. - Since `wc -l FILE` returns not only line number but also FILE filename, following "if" statement always failed. Fix this bug by replacing it with 'cat FILE | wc -l' - Since "while do-done loop" block with pipeline becomes a subshell, $N local variable is not update outside of the loop. Fix this bug by using actual target number (256) instead of $N. Signed-off-by: Masami Hiramatsu Reviewed-by: Steven Rostedt (VMware) --- .../ftrace/test.d/kprobe/multiple_kprobes.tc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc index 5862eee91e1d..6e3dbe5f96b7 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc @@ -20,9 +20,9 @@ while read i; do test $N -eq 256 && break done -L=`wc -l kprobe_events` -if [ $L -ne $N ]; then - echo "The number of kprobes events ($L) is not $N" +L=`cat kprobe_events | wc -l` +if [ $L -ne 256 ]; then + echo "The number of kprobes events ($L) is not 256" exit_fail fi