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 3/3] trace: Add an output of trace event logs to STM
Date: Wed, 22 Jul 2015 11:46:03 +0800 [thread overview]
Message-ID: <1437536763-10827-4-git-send-email-zhang.chunyan@linaro.org> (raw)
In-Reply-To: <1437536763-10827-1-git-send-email-zhang.chunyan@linaro.org>
When the trace event happens, the traces would be committed to ring buffer.
This patch will add an output of the traces to an STM at this moment,
of course the precondition is TRACE_EVENT_STM be configured.
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
kernel/trace/trace_events.c | 2 ++
kernel/trace/trace_output.h | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 404a372..35fd171 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -249,6 +249,8 @@ void trace_event_buffer_commit(struct trace_event_buffer *fbuffer)
event_trigger_unlock_commit(fbuffer->trace_file, fbuffer->buffer,
fbuffer->event, fbuffer->entry,
fbuffer->flags, fbuffer->pc);
+
+ trace_event_stm_log(fbuffer);
}
EXPORT_SYMBOL_GPL(trace_event_buffer_commit);
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h
index 4cbfe85..28e25e9 100644
--- a/kernel/trace/trace_output.h
+++ b/kernel/trace/trace_output.h
@@ -41,5 +41,12 @@ extern struct rw_semaphore trace_event_sem;
#define SEQ_PUT_HEX_FIELD(s, x) \
trace_seq_putmem_hex(s, &(x), sizeof(x))
+#ifdef CONFIG_TRACE_EVENT_STM
+extern void stm_trace_event_write(const char *buf, unsigned len);
+extern void trace_event_stm_log(struct trace_event_buffer *buffer);
+#else
+static inline void trace_event_stm_log(struct trace_event_buffer *buffer) {}
+#endif
+
#endif
--
1.9.1
next prev parent reply other threads:[~2015-07-22 3:48 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 ` [PATCH v4 2/3] trace: Introduce trace log output function for STM Chunyan Zhang
2015-07-22 3:46 ` Chunyan Zhang [this message]
2015-08-05 12:52 ` [PATCH v4 3/3] trace: Add an output of trace event logs to STM 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-4-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).