From patchwork Tue Oct 18 08:09:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 77943 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp762319qge; Tue, 18 Oct 2016 01:10:28 -0700 (PDT) X-Received: by 10.98.71.215 with SMTP id p84mr2640612pfi.59.1476778228117; Tue, 18 Oct 2016 01:10:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bv2si28734676pad.13.2016.10.18.01.10.27; Tue, 18 Oct 2016 01:10:28 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759427AbcJRIKY (ORCPT + 27 others); Tue, 18 Oct 2016 04:10:24 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34289 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759339AbcJRIJ5 (ORCPT ); Tue, 18 Oct 2016 04:09:57 -0400 Received: by mail-pf0-f171.google.com with SMTP id r16so66892652pfg.1 for ; Tue, 18 Oct 2016 01:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=la1fijJKb5cqEqUDBC12qTpZACu5rE0mNcG0PK1XYN8=; b=hNCnyZyBdn9PVWCTcYQwE8Wdw235mKqMM9HQC39xvHfnOUsp1c3LpVddft3iXzoR5W Rm2FvlQ0szKTPaw1zNUp4Xds/vc56e9XMmlec0Z5yKMOf/C3C3AgXP8NsHO7xiV1O8la KEQkXo+IuSxV4EU2nfzjWjVUT6q29dY2H9vkk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=la1fijJKb5cqEqUDBC12qTpZACu5rE0mNcG0PK1XYN8=; b=d3rqCrlFR0FIuICj01XgeWjxYByyyxgVPdNdAErL6boSM4lBUMFTSSNHidyaBBXCkh DUXDvwb6AkpibSncNBkFQh4E0XkZHI3hdu1ZNsVLB+4sMAnTd2VEmufwSdb0PitIuyZ0 A+R4kBgSOn7Saf5f8SynvYiyL7i3SeXLjy9gZB+YdVpckUnAUEJc4PSu2LoHV3LgKGXN noGeRHXyHSyGRpcu670aWCnzXa7eweQZdsixTYuV/vB05C/e/2XRMLMWheg4dgrY9fy3 rlKMQh3uPb+KfrZ+dZQF7vo9303+B5K7p9lmTkhqBcd2s8LPc6p1l2NorauySQ/ZP9aW iytg== X-Gm-Message-State: AA6/9RmKYs97iOxKFw/d8Du3SMN/AsiWiPwYFT5MrkE1QK+HH215ytmc973YI3mIxg6yRB5a X-Received: by 10.99.141.76 with SMTP id z73mr2227499pgd.100.1476778190574; Tue, 18 Oct 2016 01:09:50 -0700 (PDT) Received: from ubuntu16.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id m25sm2409807pfg.14.2016.10.18.01.09.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Oct 2016 01:09:49 -0700 (PDT) From: Chunyan Zhang To: rostedt@goodmis.org, mathieu.poirier@linaro.org, alexander.shishkin@linux.intel.com, mingo@redhat.com Cc: mike.leach@arm.com, tor@ti.com, philippe.langlais@st.com, nicolas.guion@st.com, felipe.balbi@linux.intel.com, zhang.lyra@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V7 3/3] stm: Mark the functions of writing buffer with notrace Date: Tue, 18 Oct 2016 16:09:00 +0800 Message-Id: <1476778140-10319-4-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476778140-10319-1-git-send-email-zhang.chunyan@linaro.org> References: <1476778140-10319-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_STM_SOURCE_FTRACE is selected, Function trace data can be writen to sink via STM, all functions that related to writing data packets to STM should be marked 'notrace' to avoid being traced by Ftrace, otherwise the program would stall into an endless loop. Signed-off-by: Chunyan Zhang Acked-by: Steven Rostedt --- drivers/hwtracing/coresight/coresight-stm.c | 2 +- drivers/hwtracing/intel_th/sth.c | 11 +++++++---- drivers/hwtracing/stm/core.c | 7 ++++--- drivers/hwtracing/stm/dummy_stm.c | 2 +- include/linux/stm.h | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 49e0f1b..b7543bd 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -406,7 +406,7 @@ static long stm_generic_set_options(struct stm_data *stm_data, return 0; } -static ssize_t stm_generic_packet(struct stm_data *stm_data, +static ssize_t notrace stm_generic_packet(struct stm_data *stm_data, unsigned int master, unsigned int channel, unsigned int packet, diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c index e1aee61..b034446 100644 --- a/drivers/hwtracing/intel_th/sth.c +++ b/drivers/hwtracing/intel_th/sth.c @@ -67,10 +67,13 @@ static void sth_iowrite(void __iomem *dest, const unsigned char *payload, } } -static ssize_t sth_stm_packet(struct stm_data *stm_data, unsigned int master, - unsigned int channel, unsigned int packet, - unsigned int flags, unsigned int size, - const unsigned char *payload) +static ssize_t notrace sth_stm_packet(struct stm_data *stm_data, + unsigned int master, + unsigned int channel, + unsigned int packet, + unsigned int flags, + unsigned int size, + const unsigned char *payload) { struct sth_device *sth = container_of(stm_data, struct sth_device, stm); struct intel_th_channel __iomem *out = diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 51f81d6..37d3bcb 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -425,7 +425,7 @@ static int stm_file_assign(struct stm_file *stmf, char *id, unsigned int width) return ret; } -static ssize_t stm_write(struct stm_data *data, unsigned int master, +static ssize_t notrace stm_write(struct stm_data *data, unsigned int master, unsigned int channel, const char *buf, size_t count) { unsigned int flags = STP_PACKET_TIMESTAMPED; @@ -1121,8 +1121,9 @@ void stm_source_unregister_device(struct stm_source_data *data) } EXPORT_SYMBOL_GPL(stm_source_unregister_device); -int stm_source_write(struct stm_source_data *data, unsigned int chan, - const char *buf, size_t count) +int notrace stm_source_write(struct stm_source_data *data, + unsigned int chan, + const char *buf, size_t count) { struct stm_source_device *src = data->src; struct stm_device *stm; diff --git a/drivers/hwtracing/stm/dummy_stm.c b/drivers/hwtracing/stm/dummy_stm.c index a86612d..c5f94ca 100644 --- a/drivers/hwtracing/stm/dummy_stm.c +++ b/drivers/hwtracing/stm/dummy_stm.c @@ -21,7 +21,7 @@ #include #include -static ssize_t +static ssize_t notrace dummy_stm_packet(struct stm_data *stm_data, unsigned int master, unsigned int channel, unsigned int packet, unsigned int flags, unsigned int size, const unsigned char *payload) diff --git a/include/linux/stm.h b/include/linux/stm.h index 8369d8a..210ff22 100644 --- a/include/linux/stm.h +++ b/include/linux/stm.h @@ -133,7 +133,7 @@ int stm_source_register_device(struct device *parent, struct stm_source_data *data); void stm_source_unregister_device(struct stm_source_data *data); -int stm_source_write(struct stm_source_data *data, unsigned int chan, - const char *buf, size_t count); +int notrace stm_source_write(struct stm_source_data *data, unsigned int chan, + const char *buf, size_t count); #endif /* _STM_H_ */