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,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 D2EA6C2D0C6 for ; Fri, 27 Dec 2019 17:57:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4C0720CC7 for ; Fri, 27 Dec 2019 17:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577469425; bh=EydVJe9a2aFceUo5JpBojCfmSL5Lb+6U5EVpz1YQors=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IulGstN3OlByZdOE6u4laAF8Qmpo9b4HJuXz42nSSB+MJsTAOt7ZEQ8y1rTcy92Ks DlnRFHydJ/v08jiB1b9dr5GBy86ZihssgYhGEvLI1/eEHbILtsyy1/OffRoWS02mP4 yjYU/oSUz5cGF0wHbmndw8i1QNYsYGG7mIYJ40zM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728086AbfL0R5E (ORCPT ); Fri, 27 Dec 2019 12:57:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:38340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727617AbfL0Rlv (ORCPT ); Fri, 27 Dec 2019 12:41:51 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 EECC7222C3; Fri, 27 Dec 2019 17:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577468510; bh=EydVJe9a2aFceUo5JpBojCfmSL5Lb+6U5EVpz1YQors=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UcQH1k2S8rmSmk496usrwWckQZ6jw9H1vlHpMRAtpCS03A88KuDsBjQKwsX8Qg8mm JyXdjYj1CZtYmXwKZKHvN/JFKJZYIvfvkS4g5cjQ7f5U93x9B+Y1aQsUufWNyu2oOu 8RQyTtC7QW5f+uUP2x/7zyTbUXh0VPlNiNngK46s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Masami Hiramatsu , Steven Rostedt , Shuah Khan , Sasha Levin , linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 043/187] selftests/ftrace: Fix multiple kprobe testcase Date: Fri, 27 Dec 2019 12:38:31 -0500 Message-Id: <20191227174055.4923-43-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191227174055.4923-1-sashal@kernel.org> References: <20191227174055.4923-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu [ Upstream commit 5cc6c8d4a99d0ee4d5466498e258e593df1d3eb6 ] 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) Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- .../selftests/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 -- 2.20.1