Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp986546imm; Fri, 13 Jul 2018 09:31:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcVIl31BAKK7VcdtuhN139QrIRLQu6+vPK0FhUqt+SkUqmRiIMcZk99K7GWmhytlDABKKyU X-Received: by 2002:a63:115e:: with SMTP id 30-v6mr6801198pgr.53.1531499462829; Fri, 13 Jul 2018 09:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531499462; cv=none; d=google.com; s=arc-20160816; b=qPiwc47zP9QE3R9jRfuvwbKjMuwup/79Bh63NSYu5mO8p2wO0r4UdLmXuGHUmBkiNT eDi2bBY34jsXxff9sbPTTBRSVs+m1CACjKhKoE5YqjdZQG8MVi9q0h//8osT+ZHmck8l Fz7vh3RBxFFBA+D7BBcUOmu/ZWhzLvP1e3pQ/4O4ffNvCPc05Lzqqvr8mMNWxlnpqfJr uTjkop3Mz//lUVvI00RkImVVxCu1GIFYi3yvJnIc+/hWlIJmilegdGk1RB9FgwTVBGqO kLwHV5AMAH/i5GhD+7pP2mOLqmSPO7RdIvyER9eL/OJQvMFsY3j9SzA2mrjmWn2zJOax ClPg== 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:arc-authentication-results; bh=epw3Qs1SOTVpCJXFnqgJl2kPjfY+zGSXfZE4PSZVtIo=; b=n+C+XS+/IcdcPockCKQLmpvfdQoSSkDV7Vt9q7KyFLJbeM0CfuHnVhj+RdlGOIaQQv HavZIsOhuEl1GBeKs/+bAcMtHehsg09TnjaMEqYitz/5xvFSpAgK2E1MG2hm3XbWdREn umd7BgDrAueGO9nghA6R6yQ9aLfzwKADgGIfB56y1L2SR1EcUGfFcwS6qgPBIilDIbiI KIbOJ3VRnidayP3fQONu5rHRWCpE4cWMdh7duhUsSKhY+ztDCSnSlqOOZWxgWySPvDoU sDNQLFJv9a2mvWpT9dTWgFT0jU7wfBIdAU0F+yexpwTtIL+k0zi/GRC/sfIaxIdgGegG WdZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="WB1pxx/j"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 29-v6si15548539pgv.292.2018.07.13.09.30.47; Fri, 13 Jul 2018 09:31:02 -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; dkim=pass header.i=@kernel.org header.s=default header.b="WB1pxx/j"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731929AbeGMQo2 (ORCPT + 99 others); Fri, 13 Jul 2018 12:44:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:47532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729786AbeGMQo2 (ORCPT ); Fri, 13 Jul 2018 12:44:28 -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 23CE620854; Fri, 13 Jul 2018 16:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531499347; bh=epyEAuJWYz/jXg07Seh8VWPa2Y9OW1WOXz7waOVAYoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WB1pxx/jYyNnEwi1oowpgH6Moc+QJ8u9o6gkFugnqiLRguqYh598p69dsk9nH4UKG wtBep/ccOV6VvTAD1qbz2R69Pw7ef3AWKGIwISh3fQ/UO66JpbXoxnytb3pJUIhCNT CkMOdams5BruXFaW3r1d2vyWZgmJfg06UT5AS4sE= From: Masami Hiramatsu To: Steven Rostedt Cc: Ingo Molnar , Shuah Khan , Masami Hiramatsu , Tom Zanussi , Hiraku Toyooka , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 3/3] selftests/ftrace: Add snapshot and tracing_on test case Date: Sat, 14 Jul 2018 01:28:44 +0900 Message-Id: <153149932412.11274.15289227592627901488.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <153149923649.11274.14970833360963898112.stgit@devbox> References: <153149923649.11274.14970833360963898112.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a testcase for checking snapshot and tracing_on relationship. This ensures that the snapshotting doesn't affect current tracing on/off settings. Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org --- .../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 diff --git a/tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc b/tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc new file mode 100644 index 000000000000..3b1f45e13a2e --- /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