diff mbox

[v4,3/3] trace: Add an output of trace event logs to STM

Message ID 1437536763-10827-4-git-send-email-zhang.chunyan@linaro.org
State New
Headers show

Commit Message

Chunyan Zhang July 22, 2015, 3:46 a.m. UTC
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(+)

Comments

Chunyan Zhang Aug. 5, 2015, 12:52 p.m. UTC | #1
Hello Steve,

May I have your further comments/suggestions on this version of patchset?
I know you were just back from a vacation, and must be very busy
recently, but after you finished the most urgent matters, could you
please leave us a little bandwidth to think about how you want these
patches to be improved.

Like I said in the former emails, if you don't have enough time to do
all the modifications, I hope I can more or less help with something.
But I really need your guidance.

Thank you so much,
Chunyan

On Wed, Jul 22, 2015 at 11:46 AM, Chunyan Zhang
<zhang.chunyan@linaro.org> wrote:
> 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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

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