Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933043AbbGVDsG (ORCPT ); Tue, 21 Jul 2015 23:48:06 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34524 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932848AbbGVDsA (ORCPT ); Tue, 21 Jul 2015 23:48:00 -0400 From: Chunyan Zhang 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 Message-Id: <1437536763-10827-4-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437536763-10827-1-git-send-email-zhang.chunyan@linaro.org> References: <1437536763-10827-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1713 Lines: 48 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 --- 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/