From patchwork Tue Aug 30 08:07:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 9305021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 703FE601C0 for ; Tue, 30 Aug 2016 08:11:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FA3628B19 for ; Tue, 30 Aug 2016 08:11:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5460728B1F; Tue, 30 Aug 2016 08:11:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ACE8C28B19 for ; Tue, 30 Aug 2016 08:11:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bee7J-0004KZ-By; Tue, 30 Aug 2016 08:09:57 +0000 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bee6t-00046J-25 for linux-arm-kernel@lists.infradead.org; Tue, 30 Aug 2016 08:09:33 +0000 Received: by mail-pf0-x22e.google.com with SMTP id p64so5498895pfb.1 for ; Tue, 30 Aug 2016 01:09:10 -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=KsLyuzhr+i8LzLn4i6aCe8civOHH/3xY7csyQYD/gh8=; b=XUEUKSfDJl3NKVVrkfwacW6gndEfpp6DVQoXbR94CWTitQDNumsA6vZbMYy+niE4k0 mLspJGcybjCPW9ORAsQrt22G8PHnO6UioFn4jZTAuYyGYmjZyT3Vdy0JwJS4oeAve2iX 1XTZMaHukqgaTpKNXLt0AfAGLoUgAZSyJUvmU= 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=KsLyuzhr+i8LzLn4i6aCe8civOHH/3xY7csyQYD/gh8=; b=PRcBaLJ6L7IHcSvV7WeumT5ubIhh/wVHk/TZxL9zPt60pNwFWjfNu5XMZmWq94ec9O pyp0VeoFlEg7YY1m85rsxatuJPKDSLI1UX05CnE2GNnSQ6op+rAkTiIvma5FsIet7Gv/ asEiKYFQ+ifYxyssIIeg9kGgeGnbEeXUM4nhi+ZA4aMfNC1cQs7M8rjk5TfZZuNvG6Ay 9//yoPZETc4/JxNW2RMo1I90GZs77olpLJ184EJfVjbXjvLgL7+ywS1fRr6CBHwS0hJ8 GNXxO//vUjxBkAa4G0MxKlSnHLWuWMaKtC1Vf6NJzzOLFcaJ6vdprI13v9wJOim2HYC7 Oojg== X-Gm-Message-State: AE9vXwMhed4j1jftfmu5GahA4Jirav5baJGgAWQDK2uDqybD45bJU3JHtJ+/akMOStum/hVU X-Received: by 10.98.144.144 with SMTP id q16mr3995110pfk.98.1472544550137; Tue, 30 Aug 2016 01:09:10 -0700 (PDT) Received: from ubuntu16.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id c125sm54644732pfc.40.2016.08.30.01.09.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Aug 2016 01:09:09 -0700 (PDT) From: Chunyan Zhang To: rostedt@goodmis.org, mathieu.poirier@linaro.org, alexander.shishkin@linux.intel.com, mingo@redhat.com Subject: [PATCHV5 3/3] stm: Mark the functions of writing buffer with notrace Date: Tue, 30 Aug 2016 16:07:30 +0800 Message-Id: <1472544450-9915-4-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472544450-9915-1-git-send-email-zhang.chunyan@linaro.org> References: <1472544450-9915-1-git-send-email-zhang.chunyan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160830_010931_238919_F204BC40 X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, felipe.balbi@linux.intel.com, zhang.lyra@gmail.com, linux-kernel@vger.kernel.org, tor@ti.com, philippe.langlais@st.com, mike.leach@arm.com, nicolas.guion@st.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If CONFIG_STM_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(-) diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 73be58a..345c81e 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -386,7 +386,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_ */