Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1767652ybl; Sat, 11 Jan 2020 02:24:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxtKYDx/5i4hblHJfPXK18MGaHxIVBCyqdDT+odfhQKIhYKqzv+s8VFuoOL87Ay9AO2DejA X-Received: by 2002:aca:568f:: with SMTP id k137mr5986800oib.63.1578738290199; Sat, 11 Jan 2020 02:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578738290; cv=none; d=google.com; s=arc-20160816; b=t4HuuJXfj66h16QRF8m9DZwk420hB6CoSe4FORTC+/gAoH3kOBYn/S2LIliTxreDMI Ic6bOdISZ08W476W9UCtcmKf7zgMpdd7mZeW/NAVPaxnVUEorV/kvdKCpCJvUqkgWXIF CkPG0JjcRlJOfD6u236nV9Wa7WnUnx0yp/f8fgG1gmzlNTl83dfLrTyAToT5N3brF4x8 J16gWx1vWruOVTTBw9x/VMUU7wXjCzA+y15DKhKxesOi+Z/a8dVChC4bc1tC1R63fIjX LESxYfbVYm1qOW1G8e5qe2RNf8c4gD+hTFosMs77cUKqZBp14Hy0ZIGgy20rTD1fT7gb 6Lxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=beoiIcSW9+6LFNEo4MZrBoPS2blAGA6cl++QdFNyWz0=; b=WSctghSAiJce04sue5gHnvETqsEzO4DL0C3rfCgW60JQVRoBiVo6LJLbtDALuqxRVh O5zeCxpc0BGMGIusaARXyt19m8qJ5/TetKii+jbSVGgcBM6GLL/4jyCaa+wwd5/L3MX/ k95vY4vTxki3vIISDoVGVrTx7iUdKSbPSfogmACGeYTmJ1LWpfjvFNiAKbIWx/7dWi3R YGSxVW++6xPIkCCvHA75xAXKPdzsbgcllN12Cv22UPJDowKKiLy1gicz9ztD043O21ld 1Det9h18U/e48iPF+LfuNjvCzhj5VOwS/Pv6CcsJ3ECf9HUMxKu8ZNVeHmt4KmsVZgGl M8aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UGqT9sOV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e190si3042733oib.113.2020.01.11.02.24.39; Sat, 11 Jan 2020 02:24:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UGqT9sOV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730949AbgAKKXs (ORCPT + 99 others); Sat, 11 Jan 2020 05:23:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:51490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbgAKKXq (ORCPT ); Sat, 11 Jan 2020 05:23:46 -0500 Received: from localhost (unknown [62.119.166.9]) (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 41945214DB; Sat, 11 Jan 2020 10:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578738226; bh=EydVJe9a2aFceUo5JpBojCfmSL5Lb+6U5EVpz1YQors=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UGqT9sOVL+At/KEtm0b+QgEcThQ9/4p+9Pzu1kUHe7BDBmxCw1weUCE11HgCPiBT3 OGbOFwuRAKoNUgrgnnIE07kYZ9fO8Karb7XceG6ikXAoMVBTPDCgiSMvix55/SSId8 3eDSWih26jBQz4z7TwQNDfIx3N4KJx1ANYKNqFeQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" , Shuah Khan , Sasha Levin Subject: [PATCH 5.4 037/165] selftests/ftrace: Fix multiple kprobe testcase Date: Sat, 11 Jan 2020 10:49:16 +0100 Message-Id: <20200111094924.191333723@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200111094921.347491861@linuxfoundation.org> References: <20200111094921.347491861@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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