From patchwork Thu Aug 30 14:23:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 10581801 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 8CF21174A for ; Thu, 30 Aug 2018 14:24:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 796102BF6D for ; Thu, 30 Aug 2018 14:24:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D2322BF85; Thu, 30 Aug 2018 14:24:10 +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 202102BF6D for ; Thu, 30 Aug 2018 14:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728990AbeH3S0c (ORCPT ); Thu, 30 Aug 2018 14:26:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:44616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728980AbeH3S0c (ORCPT ); Thu, 30 Aug 2018 14:26:32 -0400 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 1033C205C9; Thu, 30 Aug 2018 14:24:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535639049; bh=7K2D2hri2tO8U4DDEIv/LBVSkY8Z5d6Esa/mPkV84K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vC1AqkrWPRsVyikiUQ2qu9pQQgiB9gVttMm8b8+OnMXKxidlaswyLNJ393PqOf2Pc 0AmO4EZKK4r8vUTlK7P6VzOfcuyFIE8tjc6kvwgUMmLGjj74oxHnjPW9Rabmj1wRy5 mpiCjqqMUV6yMo8zORCH5fr5//jyTDvox5LStgd8= From: Masami Hiramatsu To: Shuah Khan , Steven Rostedt Cc: Ingo Molnar , Masami Hiramatsu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 24/28] selftests/ftrace: Add trace_pipe testcase Date: Thu, 30 Aug 2018 23:23:46 +0900 Message-Id: <153563902610.29700.13670948265261478540.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <153563834333.29700.11242968505215651399.stgit@devbox> References: <153563834333.29700.11242968505215651399.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 simple testcase for trace_pipe which can consume ringbuffer. Signed-off-by: Masami Hiramatsu --- Changes in v3: - Run this on an instance too. --- .../selftests/ftrace/test.d/00basic/trace_pipe.tc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc diff --git a/tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc b/tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc new file mode 100644 index 000000000000..5058fbcfd90f --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc @@ -0,0 +1,16 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: trace_pipe and trace_marker +# flags: instance + +[ ! -f trace_marker ] && exit_unsupported + +echo "test input 1" > trace_marker + +: "trace interface never consume the ring buffer" +grep -q "test input 1" trace +grep -q "test input 1" trace + +: "trace interface never consume the ring buffer" +head -n 1 trace_pipe | grep -q "test input 1" +! grep -q "test input 1" trace