This patch introduces two new interfaces called debugfs_printk and debugfs_dump which can be used to print to the debugfs mount directly.
It uses the 'trace' infrastructure underneath and is a patch over it.
A sample file is also created to demonstrate its ease of use.
Signed-off-by: K.Prasad <prasad@xxxxxxxxxxxxxxxxxx>
---
Documentation/trace.txt | 21 ++++
include/linux/trace.h | 55 +++++++++++
lib/trace.c | 193 +++++++++++++++++++++++++++++++++++++++--
samples/trace/Makefile | 2 samples/trace/fork_new_trace.c | 97 ++++++++++++++++++++
5 files changed, 362 insertions(+), 6 deletions(-)
+
+/**
+ * debugfs_printk - Output binary into debugfs mount 'directly' using 'trace'
+ * @dpk: Structure containing info such as parent_dir and directory
+ * @output: Data that needs to be output
+ * @output_len: Length of the output data
+ */
+int debugfs_dump(struct debugfs_printk_data *dpk, const void *output,
+ const int output_len)
+{