Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp107859yba; Wed, 15 May 2019 20:07:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwht6lVUwSlJpp65lvPISmC25Eqz44cpD59/1VhBSaO5IZKFKqG4+IQs1Jxf4RvX/JkJVu1 X-Received: by 2002:a63:da14:: with SMTP id c20mr47565592pgh.191.1557976055700; Wed, 15 May 2019 20:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557976055; cv=none; d=google.com; s=arc-20160816; b=BtAaSXctzuPLSmTvp5bde5ewc4g0xWmvTXhLpJuxfxLotcDEMBEse3qWJ2NMBr4shO aGh/7xyRupZPZ8kPVsFIhNouB6qKatEV9wsNuvNgL27e6/YjmPNSoNRXZ3/gBA9sK8XN smPRpFJ63l2PbeTAUfUHgs9RJERFqVCYjnzxkr4uci+VafriGdwX3uHlZhnhNnMhM0p3 1PIeYVEQ7NUI91pVoD13vp8lcP8ovGnxTc9fc4HZEvzinXO7cMk1TPPbWiTq7E6DmmgE qo9v7ZDbj6PE2CMkUkIM9A+9tueqnbzh2IPUS9jyXFvcNybkRTKIv+QpHzQYmcIWO/Oz t64A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=qteBzkqrMLrBH3R/xe4+uxRBPfUAJjlC2269KXCYLFU=; b=02FLn4J6BRskJhWB+ScMqoSsApRpp7OcE6nt4UZP0/idrXssbXpY1fNvZ8MU7PrArW 5KWrTu6QeL4dXXUmK3f9GFCDDXr/UBRTo9sPkuYeMvruSRosjYuNpi8YDB16xOEKah7A jabDEQqL9TW+dzfG0c2vb/vVz8SnB3eMTHUiBQ+JWANPUpdiaTDCxpFS9XgczxDoFLa9 2ZQjKwjAgFh26mhJGQFzO5gyNAY6LmaXcEIN3Tes3Td+MZCZ7tbU+hxlmgP0PH4sPRon e92Um5UBCAQZU+80uh+7jsQu+24eugdMUTOc+GSXy8HwCUc9bgA+OtoaySPDli6u8zXZ Lr5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j8ccdqGw; 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 33si3489674pgp.199.2019.05.15.20.07.19; Wed, 15 May 2019 20:07:35 -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=j8ccdqGw; 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 S1726290AbfEPDFe (ORCPT + 99 others); Wed, 15 May 2019 23:05:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:59432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfEPDFe (ORCPT ); Wed, 15 May 2019 23:05:34 -0400 Received: from devnote2 (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 4C88C20848; Thu, 16 May 2019 03:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557975933; bh=GpDR24QypWmqGb/mwMhctDOGBWWWTOj2eY3rfhQJ5Xg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=j8ccdqGwecRuHx2wxLgpk8pzJ4lK042LRYkmiVKCEwye0SBKkcGTEoJQ4nGS+upqf XkOYw3kFjMSAbXwI3vRge84db0uttcnkaLmztzNbiNkrO2YQzEnTylCEKNZbSoJkdx inBQHO70H3XtGs6FYGJd/8MxjoGk/aZ+rJ5ruYjY= Date: Thu, 16 May 2019 12:05:29 +0900 From: Masami Hiramatsu To: Divya Indi Cc: linux-kernel@vger.kernel.org, Steven Rostedt , Joe Jin Subject: Re: [PATCH] tracing: Kernel access to Ftrace instances Message-Id: <20190516120529.4c1f6e6ddd516185df149625@kernel.org> In-Reply-To: References: <1553106531-3281-1-git-send-email-divya.indi@oracle.com> <1553106531-3281-2-git-send-email-divya.indi@oracle.com> <20190516090942.75f3a957ceed20201edc91a6@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, 15 May 2019 18:51:23 -0700 Divya Indi wrote: > Hi Masami, > > Thanks for pointing it out. > > Yes, it should not be static. > > On 5/15/19 5:09 PM, Masami Hiramatsu wrote: > > HI Divya, > > > > On Wed, 20 Mar 2019 11:28:51 -0700 > > Divya Indi wrote: > > > >> Ftrace provides the feature “instances” that provides the capability to > >> create multiple Ftrace ring buffers. However, currently these buffers > >> are created/accessed via userspace only. The kernel APIs providing these > >> features are not exported, hence cannot be used by other kernel > >> components. > >> > >> This patch aims to extend this infrastructure to provide the > >> flexibility to create/log/remove/ enable-disable existing trace events > >> to these buffers from within the kernel. > >> > >> Signed-off-by: Divya Indi > >> Reviewed-by: Joe Jin > > Would you tested these APIs with your module? Since, > > [...] > >> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c > >> index 5b3b0c3..81c038e 100644 > >> --- a/kernel/trace/trace_events.c > >> +++ b/kernel/trace/trace_events.c > >> @@ -832,6 +832,7 @@ static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) > >> > >> return ret; > >> } > >> +EXPORT_SYMBOL_GPL(ftrace_set_clr_event); > > I found this exports a static function to module. Did it work? > > I had tested the changes with my module. This change to static was added > in the test patch, but somehow missed it in the final patch that was > sent out. If you can send some example module patch under samples/, that is more helpful for us to check it. And it is possible to use in kselftest too. > > Will send a new patch along with a few additional ones to add some NULL > checks to ensure safe usage by modules and add the APIs to a header file > that can be used by the modules. It seems your's already in Steve's ftrace/core branch, so I think you can make additional patch to fix it. Steve, is that OK? Thank you, > > Thanks, > > Divya > > > > > Thank you, > > -- Masami Hiramatsu