From patchwork Thu Sep 10 08:55:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu \(Google\)" X-Patchwork-Id: 255225 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=-13.1 required=3.0 tests=BAYES_00,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 CFB62C433E2 for ; Thu, 10 Sep 2020 08:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 739ED20872 for ; Thu, 10 Sep 2020 08:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599728339; bh=SwrJXfeH/9hOrMi7XyK/W+RmfZgE720J1M//fWtouGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ujJpZAkUjn9L0xJwFmYUoj0n9x2fr3caLcJbp1Orchm4btmna1t+IAZo/wEn08Otq W88pK3VL2GhspDitWeeDbV+94m1Cy5JD1ZknGlRJk0/De582wQ908cKN+43UBQzNRe rUsAiikj4gb9hb4y5dFELmWHFfAoOt4tAKCOzUSE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730553AbgIJI67 (ORCPT ); Thu, 10 Sep 2020 04:58:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:36932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730386AbgIJIzU (ORCPT ); Thu, 10 Sep 2020 04:55:20 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 AED4D208CA; Thu, 10 Sep 2020 08:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599728119; bh=SwrJXfeH/9hOrMi7XyK/W+RmfZgE720J1M//fWtouGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ivcvhJmVM32K1an7TJ7aGnBwdi+4P5XrMo4dpwItVENXdXZEe0jr8ps4/ll8mafdo tuyvq0QKHHOqBgLuQMePdIOKpfPNtc9vfpqe0Xo1w5be1LWhikneUab7/zVBBDvFEE PaNoNhfIKZbXKF+bqpq2gfIzHmAFm6APwGxS9sQk= From: Masami Hiramatsu To: Steven Rostedt , Jonathan Corbet , Shuah Khan Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Randy Dunlap , Ingo Molnar , linux-kselftest@vger.kernel.org Subject: [PATCH v3 2/8] tracing/boot: Add per-instance tracing_on option support Date: Thu, 10 Sep 2020 17:55:15 +0900 Message-Id: <159972811538.428528.2561315102284268611.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <159972809455.428528.4737752126800169128.stgit@devnote2> References: <159972809455.428528.4737752126800169128.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add per-instance tracing_on option, which will be useful with traceon/traceoff event trigger actions. For example, if we disable tracing_on by default and set traceon and traceoff on a pair of events, we can trace functions between the pair of events. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_boot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c index fa0fc08c6ef8..d52d441a17e8 100644 --- a/kernel/trace/trace_boot.c +++ b/kernel/trace/trace_boot.c @@ -40,6 +40,16 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node) pr_err("Failed to set option: %s\n", buf); } + p = xbc_node_find_value(node, "tracing_on", NULL); + if (p && *p != '\0') { + if (kstrtoul(p, 10, &v)) + pr_err("Failed to set tracing on: %s\n", p); + if (v) + tracer_tracing_on(tr); + else + tracer_tracing_off(tr); + } + p = xbc_node_find_value(node, "trace_clock", NULL); if (p && *p != '\0') { if (tracing_set_clock(tr, p) < 0)