Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755501AbcKOPXt (ORCPT ); Tue, 15 Nov 2016 10:23:49 -0500 Received: from smtprelay0209.hostedemail.com ([216.40.44.209]:44919 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753352AbcKOPXr (ORCPT ); Tue, 15 Nov 2016 10:23:47 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1539:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2903:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3871:3872:3874:4605:5007:6119:6261:6742:7875:7903:10004:10400:10450:10455:10471:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12740:12760:13069:13255:13311:13357:13439:13972:14181:14659:14721:19904:19999:21080:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: title51_3da564ba00262 X-Filterd-Recvd-Size: 2308 Date: Tue, 15 Nov 2016 10:23:42 -0500 From: Steven Rostedt To: Chunyan Zhang Cc: Mathieu Poirier , Alexander Shishkin , mingo@redhat.com, Mike Leach , Tor Jeremiassen , philippe.langlais@st.com, Nicolas GUION , Felipe Balbi , Lyra Zhang , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH V7 1/3] tracing: add a possibility of exporting function trace to other places instead of ring buffer only Message-ID: <20161115102342.7ad27130@gandalf.local.home> In-Reply-To: References: <1476778140-10319-1-git-send-email-zhang.chunyan@linaro.org> <1476778140-10319-2-git-send-email-zhang.chunyan@linaro.org> <20161018114418.3445c390@gandalf.local.home> <20161114105926.7bc7844b@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 633 Lines: 28 On Tue, 15 Nov 2016 16:14:29 +0800 Chunyan Zhang wrote: > > > Then why have a > > > > if (export->write) > > > > > > Is there every going to be a case where export will not have a write > > function? > > There shouldn't be. > > I can move this if statement to the register_ftrace_export() to ensure > users won't wrongly use it, that's saying the write() of trace_export > has been set before being registered to 'ftrace_exports_list'. > Looks like it's already there: +int register_ftrace_export(struct trace_export *export) +{ + if (WARN_ON_ONCE(!export->write)) + return -1; -- Steve