From mboxrd@z Thu Jan 1 00:00:00 1970 From: rostedt@goodmis.org (Steven Rostedt) Date: Tue, 15 Nov 2016 10:23:42 -0500 Subject: [PATCH V7 1/3] tracing: add a possibility of exporting function trace to other places instead of ring buffer only 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> Message-ID: <20161115102342.7ad27130@gandalf.local.home> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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