-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracing: Add hook to function tracing for other subsystems to use
Currently Function traces can be only exported to the ring buffer. This adds a trace_export concept which can process traces and export them to a registered destination as an addition to the current one that outputs to Ftrace - i.e. ring buffer. In this way, if we want function traces to be sent to other destinations rather than only to the ring buffer, we just need to register a new trace_export and implement its own .write() function for writing traces to storage. With this patch, only function tracing (trace type is TRACE_FN) is supported. Link: http://lkml.kernel.org/r/1479715043-6534-2-git-send-email-zhang.chunyan@linaro.org Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
- Loading branch information
Chunyan Zhang
authored and
Steven Rostedt
committed
Nov 22, 2016
1 parent
153aae5
commit 478409d
Showing
2 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef _LINUX_TRACE_H | ||
#define _LINUX_TRACE_H | ||
|
||
#ifdef CONFIG_TRACING | ||
/* | ||
* The trace export - an export of Ftrace output. The trace_export | ||
* can process traces and export them to a registered destination as | ||
* an addition to the current only output of Ftrace - i.e. ring buffer. | ||
* | ||
* If you want traces to be sent to some other place rather than ring | ||
* buffer only, just need to register a new trace_export and implement | ||
* its own .write() function for writing traces to the storage. | ||
* | ||
* next - pointer to the next trace_export | ||
* write - copy traces which have been delt with ->commit() to | ||
* the destination | ||
*/ | ||
struct trace_export { | ||
struct trace_export __rcu *next; | ||
void (*write)(const void *, unsigned int); | ||
}; | ||
|
||
int register_ftrace_export(struct trace_export *export); | ||
int unregister_ftrace_export(struct trace_export *export); | ||
|
||
#endif /* CONFIG_TRACING */ | ||
|
||
#endif /* _LINUX_TRACE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters