Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp142618pxk; Wed, 2 Sep 2020 17:20:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8+VBMAg6QwwOeldYVkZgMOWJPYOc+VoXXRX788Zaq8AyeF+7e7VV0qO7I6CB2pZlu2/3e X-Received: by 2002:a17:907:72d2:: with SMTP id du18mr663397ejc.359.1599092423838; Wed, 02 Sep 2020 17:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599092423; cv=none; d=google.com; s=arc-20160816; b=SE1Q0BL3bzNj/LBKvevo2JbeAOMPb2hb7hVqrWU5n6jfWALqoEjYjyB8MKnPWpbCTa TLz7ag4u44urqSCVn5db0GRLWIHn5NywX8z26dPlcTxNsVyWvVhkunkxirDTf0LCDtPu 7EiQjZ68oOvR/RrqT8LwXXAjIhvdEG610f74X+GqFE9CDPFK/a0e/oE9/XVLLqhdUDaR DS5WnTXTZ6RsJaXxUVeXn6LweCfC631PUSAH5xf8aJj9tBMhwV8NthgEplX7CemoQpth nn/KNsKFjnAO69WpYXVHMojVmZk3pb1k8W105Fv/U/+MzBYbX6l4hu+Fw5rgknjHpLJb Z7tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=9EpaubBxqFUSacMHuSIGmCuRKTELLz5Ei4tZOzpBcNk=; b=rY4nsnZftZoeybE7CARk/oNUOoQI4U67mr8YaqVYW/t+n4nDO9jxTDBXWwnSn/A/rd iKtyP81H9sX/5I6tXjtgwcV20bDWQ12038u5sRJ8siODNKLt/gKzLSE25hE+K9cAJYHV qrsOWdqdL8soNG3QBS1oY4CYENRiCawQukVZlMv1Eh3+jCTTsgUMKJxEKGPUkZDwBx0G BTWfyagfujKlWdKOqxAbI/g38LASP2hyVcAzPd5Iqas4OoKKoK4kfu6b0ydfRcFWzIJT Mp6dDgnrRfsI60XTkCqWWS3oxsJrnJSmUD4ARopLZRHNm1M390iYoMTFIT9+JWVqBwpU vVjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BDoUeK+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx12si655040edb.26.2020.09.02.17.20.01; Wed, 02 Sep 2020 17:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BDoUeK+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbgICAST (ORCPT + 99 others); Wed, 2 Sep 2020 20:18:19 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:58089 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbgICASN (ORCPT ); Wed, 2 Sep 2020 20:18:13 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1599092293; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=9EpaubBxqFUSacMHuSIGmCuRKTELLz5Ei4tZOzpBcNk=; b=BDoUeK+Yj8plGE4lN7QWWGtXJZgKy1LR/pvRIHO5+epb2Iye1TpUoyNVqnP2ep3bPRzzVDj1 +e2C6hZITUsAbzlmAV/HTisqAbWwuV1WdPz8L8FuM78+6w4kLCdAhya3VqIchq0dlZVTvNvd WG9aNcIR6XxmydHasuLAZnTPZWA= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 5f503638238e1efa378a745e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 03 Sep 2020 00:18:00 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 342E2C433B6; Thu, 3 Sep 2020 00:17:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from tingweiz-gv.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tingwei) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9FF7FC4339C; Thu, 3 Sep 2020 00:17:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9FF7FC4339C Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=tingwei@codeaurora.org From: Tingwei Zhang To: Steven Rostedt , Ingo Molnar , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue Cc: Tingwei Zhang , Mathieu Poirier , Suzuki K Poulose , tsoni@codeaurora.org, Sai Prakash Ranjan , Mao Jinlong , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 6/6] stm class: ftrace: use different channel accroding to CPU Date: Thu, 3 Sep 2020 08:17:06 +0800 Message-Id: <20200903001706.28147-7-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200903001706.28147-1-tingwei@codeaurora.org> References: <20200903001706.28147-1-tingwei@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To avoid mixup of packets from differnt ftrace packets simultaneously, use different channel for packets from different CPU. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing/stm/ftrace.c index c694a6e692d1..ebf29489919c 100644 --- a/drivers/hwtracing/stm/ftrace.c +++ b/drivers/hwtracing/stm/ftrace.c @@ -37,8 +37,10 @@ static void notrace stm_ftrace_write(struct trace_export *export, const void *buf, unsigned int len) { struct stm_ftrace *stm = container_of(export, struct stm_ftrace, ftrace); + /* This is called from trace system with preemption disabled */ + unsigned int cpu = smp_processor_id(); - stm_source_write(&stm->data, STM_FTRACE_CHAN, buf, len); + stm_source_write(&stm->data, STM_FTRACE_CHAN + cpu, buf, len); } static int stm_ftrace_link(struct stm_source_data *data) @@ -63,6 +65,7 @@ static int __init stm_ftrace_init(void) { int ret; + stm_ftrace.data.nr_chans = num_possible_cpus(); ret = stm_source_register_device(NULL, &stm_ftrace.data); if (ret) pr_err("Failed to register stm_source - ftrace.\n"); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project