From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 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 804E9C433E7 for ; Mon, 12 Oct 2020 15:11:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BB802087E for ; Mon, 12 Oct 2020 15:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389601AbgJLPLn (ORCPT ); Mon, 12 Oct 2020 11:11:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:33502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389142AbgJLPLm (ORCPT ); Mon, 12 Oct 2020 11:11:42 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 1E6C220878; Mon, 12 Oct 2020 15:11:42 +0000 (UTC) Date: Mon, 12 Oct 2020 11:11:40 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: Tom Zanussi , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] tracing/boot: Add ftrace.instance.*.alloc_snapshot option Message-ID: <20201012111140.5e8e2e0c@gandalf.local.home> In-Reply-To: <160234368948.400560.15313384470765915015.stgit@devnote2> References: <160234368056.400560.6282640165007466754.stgit@devnote2> <160234368948.400560.15313384470765915015.stgit@devnote2> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 11 Oct 2020 00:28:09 +0900 Masami Hiramatsu wrote: > Add ftrace.instance.*.alloc_snapshot option. > > This option has been described in Documentation/trace/boottime-trace.rst > but not implemented yet. > > ftrace.[instance.INSTANCE.]alloc_snapshot > Allocate snapshot buffer. > > The difference from kernel.alloc_snapshot is that the kernel.alloc_snapshot > will allocate the buffer only for the main instance, but this can allocate > buffer for any new instances. I queued this up. Thanks Masami! -- Steve > > Signed-off-by: Masami Hiramatsu > --- > kernel/trace/trace_boot.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c > index 754e3cf2df3a..c22a152ef0b4 100644 > --- a/kernel/trace/trace_boot.c > +++ b/kernel/trace/trace_boot.c > @@ -284,6 +284,12 @@ trace_boot_enable_tracer(struct trace_array *tr, struct xbc_node *node) > if (tracing_set_tracer(tr, p) < 0) > pr_err("Failed to set given tracer: %s\n", p); > } > + > + /* Since tracer can free snapshot buffer, allocate snapshot here.*/ > + if (xbc_node_find_value(node, "alloc_snapshot", NULL)) { > + if (tracing_alloc_snapshot_instance(tr) < 0) > + pr_err("Failed to allocate snapshot buffer\n"); > + } > } > > static void __init