From: Chunyan Zhang <zhang.chunyan@linaro.org>
To: rostedt@goodmis.org, mingo@kernel.org
Cc: mathieu.poirier@linaro.org, serge.broslavsky@linaro.org,
broonie@kernel.org, alexander.shishkin@linux.intel.com,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/3] trace: Introduce trace log output function for STM
Date: Wed, 22 Jul 2015 11:46:02 +0800 [thread overview]
Message-ID: <1437536763-10827-3-git-send-email-zhang.chunyan@linaro.org> (raw)
In-Reply-To: <1437536763-10827-1-git-send-email-zhang.chunyan@linaro.org>
This patch introduced a new function to print the trace events logs
to STM buffer when the trace event happens.
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
kernel/trace/Makefile | 1 +
kernel/trace/trace_output_stm.c | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+)
create mode 100644 kernel/trace/trace_output_stm.c
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 9b1044e..ac6c195 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -67,4 +67,5 @@ obj-$(CONFIG_UPROBE_EVENT) += trace_uprobe.o
obj-$(CONFIG_TRACEPOINT_BENCHMARK) += trace_benchmark.o
+obj-$(CONFIG_TRACE_EVENT_STM) += trace_output_stm.o
libftrace-y := ftrace.o
diff --git a/kernel/trace/trace_output_stm.c b/kernel/trace/trace_output_stm.c
new file mode 100644
index 0000000..42d5549
--- /dev/null
+++ b/kernel/trace/trace_output_stm.c
@@ -0,0 +1,22 @@
+#include <linux/trace_events.h>
+#include "trace_output.h"
+
+void trace_event_stm_log(struct trace_event_buffer *buffer)
+{
+ /* use static because iter can be a bit big for the stack */
+ static struct trace_iterator iter;
+ struct trace_entry *entry = (struct trace_entry *)buffer->entry;
+ struct trace_event *event = NULL;
+
+ iter.ent = entry;
+
+ if (entry)
+ event = ftrace_find_event(entry->type);
+
+ if (event && event->funcs) {
+ event->funcs->trace(&iter, 0, event);
+ stm_trace_event_write(iter.seq.buffer, iter.seq.seq.len);
+ iter.seq.seq.len = 0;
+ }
+}
+EXPORT_SYMBOL_GPL(trace_event_stm_log);
--
1.9.1
next prev parent reply other threads:[~2015-07-22 3:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 3:46 [PATCH v4 0/3] Integration of trace events with System Trace IP blocks Chunyan Zhang
2015-07-22 3:46 ` [PATCH v4 1/3] STM trace event: Adding generic buffer interface driver Chunyan Zhang
2015-07-22 3:46 ` Chunyan Zhang [this message]
2015-07-22 3:46 ` [PATCH v4 3/3] trace: Add an output of trace event logs to STM Chunyan Zhang
2015-08-05 12:52 ` Chunyan Zhang
2015-08-05 13:47 ` Steven Rostedt
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=1437536763-10827-3-git-send-email-zhang.chunyan@linaro.org \
--to=zhang.chunyan@linaro.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=serge.broslavsky@linaro.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;
as well as URLs for NNTP newsgroup(s).