From patchwork Wed Jul 22 03:46:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 51330 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id A1B6B22E78 for ; Wed, 22 Jul 2015 03:48:20 +0000 (UTC) Received: by wicmm11 with SMTP id mm11sf11927934wic.3 for ; Tue, 21 Jul 2015 20:48:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=NZqqqXqGUNEIvI235kx+JiHj2elrrDeie/npFbMyqW0=; b=L8/u6lPEQutjuSUObnQt4DSJjMAhz0wAZs+8PZuL9sXZhJggobkwPcrKcwlBfyk9LQ HO5m3R8zk1vur2MrI9OVxYXMV0nVYl4TxW8JUn7vO3HNWVhLStkewujuF3iTbXKb2EM5 eHny7L1IolCrGNS50mcXk46dgRJ79BqqRAnFLNO7kYJP0ahePi1o1bXi0W4gGuZAyOu7 eKtDhb/Q5ZwFjPRghvpNwenf4jmeYumOHoy6Fyo95Q5BXe5Bq+NgBeiZKqSbpzqyufOP adM7gwPfuOn+LI14pdT+mBrCZ70YDpkJQ8p9s/rYYImz3ch5vcSRKuSdTWJFVjq2toXW hiIg== X-Gm-Message-State: ALoCoQmKD4fJRWLh90HwBnYJ+Rn5Z6Gg9tQMwLcBKkyS3KccP0pfRJ7dojV2OguYnQcwF3JyLKxt X-Received: by 10.112.42.236 with SMTP id r12mr205701lbl.2.1437536899945; Tue, 21 Jul 2015 20:48:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.228 with SMTP id bb4ls23291lab.88.gmail; Tue, 21 Jul 2015 20:48:19 -0700 (PDT) X-Received: by 10.112.63.137 with SMTP id g9mr272448lbs.121.1437536899645; Tue, 21 Jul 2015 20:48:19 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id g1si114921lab.70.2015.07.21.20.48.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2015 20:48:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lahh5 with SMTP id h5so130117379lah.2 for ; Tue, 21 Jul 2015 20:48:19 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr311219laj.88.1437536899219; Tue, 21 Jul 2015 20:48:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1825569lba; Tue, 21 Jul 2015 20:48:18 -0700 (PDT) X-Received: by 10.66.102.103 with SMTP id fn7mr900056pab.85.1437536897336; Tue, 21 Jul 2015 20:48:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si302534pas.231.2015.07.21.20.48.16; Tue, 21 Jul 2015 20:48:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933052AbbGVDsG (ORCPT + 28 others); 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 Received: by pacan13 with SMTP id an13so132360804pac.1 for ; Tue, 21 Jul 2015 20:47:59 -0700 (PDT) X-Received: by 10.66.164.106 with SMTP id yp10mr862239pab.121.1437536879465; Tue, 21 Jul 2015 20:47:59 -0700 (PDT) Received: from zcy-ubuntu.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id bg7sm223459pdb.29.2015.07.21.20.47.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jul 2015 20:47:58 -0700 (PDT) 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 Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhang.chunyan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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