Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1823332imm; Mon, 3 Sep 2018 10:21:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYarO/AWeDcm9PzRf61uglDsuijJU0djL4GE09MMAaTw8cXz9kIgsoMNv63ffbailNMDCOz X-Received: by 2002:a62:5ec3:: with SMTP id s186-v6mr30679782pfb.146.1535995283424; Mon, 03 Sep 2018 10:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995283; cv=none; d=google.com; s=arc-20160816; b=BijB91gvvca03gbpDys2yzQfU+USNI2hryfA174rbZMHXekli0HwLXI8Kiv5n8Dwtq nrRmaaion01xHEGRmE0DP6Z0C332Ec6c6gQXBF0p5L7S99n4o3wu7A8hka/Dkh8KjU2a kWWZ3uHGlCr1izaVu+H3x7vNUcV8huxjuLdPv9fxS0v31UOZfv+pDI35Ei07jZN8RE+C 31cRfJMLyO4a9IAQ5a9BJyF91ARM2rqVCWGt6vEsyWewmicjIbAn2hbDUF9iC5PHrxGY 0XvCsqE7NWWvZC7k8hD9uPC2QXAbfrNjilVw/sA1r9weFz4KpSsH7UUADYjxkZuGhX6x 3rZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=qdfdtUyLQIWMkxOF7giqmvYLkcJ/mBoAZDZdXJIO/UE=; b=TZ+8YPFsh4wIV7R3pclgQ5v1ZkkN+dBel7gNS9WoS2zSs6SIGPPU4jureAOZWu6/lb I2Uh6dMignRofRw1+HAZH9Vlav+0o/SISybFvPvjAcBSzsK09DEy0DPWq3MbjKiGKbfW I8fVZ6jcJYFOwZEjLVZ4Dnj5kFCG8DKwBvBMP4iKoulh4B/X7exV/lWA1Y0x62cDZWvr NqPPbxJwlm3SI4eGExER/xRLD/WLmcXtb9ZuWAYWvyPdVAMkj7kkHpysPnn/wZN/neMc 83GRUqlahA3x/DaSkvSdD0ZlGyOLgFwY2gQyW7E5UuIfImBiFD3sLscX4lhfzvKFrZN1 9YVg== ARC-Authentication-Results: i=1; mx.google.com; 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 y8-v6si17800829pfm.141.2018.09.03.10.21.08; Mon, 03 Sep 2018 10:21:23 -0700 (PDT) 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; 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 S1730272AbeICVjH (ORCPT + 99 others); Mon, 3 Sep 2018 17:39:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42966 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728154AbeICVjH (ORCPT ); Mon, 3 Sep 2018 17:39:07 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BCF3FD09; Mon, 3 Sep 2018 17:18:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Zanussi , Hiraku Toyooka , Masami Hiramatsu , Ingo Molnar , Shuah Khan , linux-kselftest@vger.kernel.org, "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 4.14 054/165] selftests/ftrace: Add snapshot and tracing_on test case Date: Mon, 3 Sep 2018 18:55:40 +0200 Message-Id: <20180903165657.845228106@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu [ Upstream commit 82f4f3e69c5c29bce940dd87a2c0f16c51d48d17 ] Add a testcase for checking snapshot and tracing_on relationship. This ensures that the snapshotting doesn't affect current tracing on/off settings. Link: http://lkml.kernel.org/r/153149932412.11274.15289227592627901488.stgit@devbox Cc: Tom Zanussi Cc: Hiraku Toyooka Signed-off-by: Masami Hiramatsu Cc: Ingo Molnar Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc | 28 ++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc @@ -0,0 +1,28 @@ +#!/bin/sh +# description: Snapshot and tracing setting +# flags: instance + +[ ! -f snapshot ] && exit_unsupported + +echo "Set tracing off" +echo 0 > tracing_on + +echo "Allocate and take a snapshot" +echo 1 > snapshot + +# Since trace buffer is empty, snapshot is also empty, but allocated +grep -q "Snapshot is allocated" snapshot + +echo "Ensure keep tracing off" +test `cat tracing_on` -eq 0 + +echo "Set tracing on" +echo 1 > tracing_on + +echo "Take a snapshot again" +echo 1 > snapshot + +echo "Ensure keep tracing on" +test `cat tracing_on` -eq 1 + +exit 0