public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: rostedt@goodmis.org, mingo@elte.hu, akpm@linux-foundation.org,
	fweisbec@gmail.com
Cc: linux-kernel@vger.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [PATCH] ftrace: Add new entry type TRACE_BIN_DUMP
Date: Sun, 16 Nov 2008 16:07:59 +0530	[thread overview]
Message-ID: <1226831883-26362-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)
In-Reply-To: <1226831883-26362-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

The ftrace dump_entry can be used to dump binary data from
kernel to userspace.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

---
 kernel/trace/trace.c |    8 ++++++++
 kernel/trace/trace.h |   11 +++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c0d1170..004aafd 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2106,6 +2106,14 @@ static enum print_line_t print_dump_fmt(struct trace_iterator *iter)
 			trace_seq_print_cont(s, iter);
 		break;
 	}
+	case TRACE_BIN_DUMP: {
+		struct dump_entry *field;
+
+		trace_assign_type(field, entry);
+
+		trace_seq_putmem(s, field->buf, field->len);
+		break;
+	}
 	}
 	return TRACE_TYPE_HANDLED;
 }
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 358d2a6..b24d350 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -26,6 +26,7 @@ enum trace_type {
 	TRACE_BOOT_CALL,
 	TRACE_BOOT_RET,
 	TRACE_FN_RET,
+	TRACE_BIN_DUMP,
 
 	__TRACE_LAST_TYPE
 };
@@ -107,6 +108,15 @@ struct print_entry {
 	char			buf[];
 };
 
+/*
+ * bin dump entry:
+ */
+struct dump_entry {
+	struct trace_entry ent;
+	int     len;
+	char    buf[];
+};
+
 #define TRACE_OLD_SIZE		88
 
 struct trace_field_cont {
@@ -249,6 +259,7 @@ extern void __ftrace_bad_type(void);
 		IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
 		IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \
 		IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET);\
+		IF_ASSIGN(var, ent, struct dump_entry, TRACE_BIN_DUMP);	\
 		__ftrace_bad_type();					\
 	} while (0)
 
-- 
tg: (b382bc2..) an/ftrace-bin-dump.patch (depends on: an/ftrace-dp-printk.patch)

  reply	other threads:[~2008-11-16 10:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 10:37 [PATCH] Fix writing to trace/trace_options Aneesh Kumar K.V
2008-11-16 10:37 ` Aneesh Kumar K.V [this message]
2008-11-16 10:38   ` [PATCH] ftrace: add proper bin iterator support Aneesh Kumar K.V
2008-11-16 10:38     ` [PATCH] ftrace: Add debug_dump trace to dump binary data from kernel to userspace Aneesh Kumar K.V
2008-11-16 10:38       ` [PATCH] ftrace: Add debug_print trace to print " Aneesh Kumar K.V
2008-11-16 10:38         ` [PATCH] ftrace: Add dump iteator Aneesh Kumar K.V
2008-11-16 10:46 ` [PATCH] Fix writing to trace/trace_options Aneesh Kumar K.V
2008-11-16 15:07   ` Steven Rostedt
2008-11-17 11:17   ` Ingo Molnar
2008-11-17 13:11     ` Aneesh Kumar K.V
2008-11-18 14:06       ` Ingo Molnar
2008-11-16 15:05 ` Steven Rostedt
2008-11-17 11:08 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226831883-26362-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox