Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1523724pxk; Fri, 25 Sep 2020 18:03:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd4E2jLOY1+huRYQ8sPcuFSNYnNdgyMlOO4ZXCau0UdNeuRXfb0eBOMfw/0w8DK0MFodPT X-Received: by 2002:a50:ef0c:: with SMTP id m12mr4197076eds.264.1601082233657; Fri, 25 Sep 2020 18:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601082233; cv=none; d=google.com; s=arc-20160816; b=BD70yUBmg6ScRWZsLR3wnt+vr31t/PtPrSEVRRkc8iUQ7691VLlf9R1q4zJxZZls/t J3GylyZGqWSSCgScKnskyk8bVn+h8Wgg1Ig7pGSVMpUi2IY/KOLLJ8Zvl+fSfHEwMYY5 pRC12XwHJhX72Anu2VmAb6Y17FFGRHfBcND12iDs9uvqbHxI2+xaImfAtHIQw8ZtARqt 7Qb8A7zVYijy4kinGDb4gYv+YLmjn7iEtq1hbv1MPKLWcxCIa32FGLFVJLdG+CITNVI/ 1lVrS2JN6cqnZQDYJjywdY6gnnNgAgAnCQIguyj8wHgd6Va54ObrkzY232Mg0eiKr92w 7saw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:sender:dkim-signature; bh=fckq/ThlM6XG4mVhDa0+0YfnlhrinOmJvlG+wrDIx10=; b=fcqI4IFp4fUaHepMCM3jMXpI2gSDSYMOcZHSffYVsPfbyKwcLaWgyjMs37x8qi0Urk A4Oudhupf9ryO+XTFdxjd7D8lSNFi562PZ1C7kKYZmaSyAD/V9dERIyOr251xOysjMs2 Nkdck98SL+TebTmHU1if5aEuX47GQITsodlsPIY3aDL0JbDfgRalzK1mMdijwWIq9lBw Rvy0sc69GjydiYwgvCQoXWKhzdfRp82MtXs1RI4rDnnkhGGwFmfdaZnXGiV31b6urK3F TTJ21uZtbefk+eqtUb+UuxVzdTa2gExJIAmBbWh1fdUs/zTBbYcCzGSss4vidyY/jslg xSrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=QvyCPjXE; 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 n15si3246192eje.173.2020.09.25.18.03.30; Fri, 25 Sep 2020 18:03:53 -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=pass header.i=@mg.codeaurora.org header.s=smtp header.b=QvyCPjXE; 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 S1729876AbgIZBCZ (ORCPT + 99 others); Fri, 25 Sep 2020 21:02:25 -0400 Received: from z5.mailgun.us ([104.130.96.5]:56452 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729871AbgIZBCZ (ORCPT ); Fri, 25 Sep 2020 21:02:25 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1601082145; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=fckq/ThlM6XG4mVhDa0+0YfnlhrinOmJvlG+wrDIx10=; b=QvyCPjXEfx+ZXH1JiPFcXBBrwBWFitqJdpiVhEVpyK40lH2T67wo/OSmQBjHSlUq/MF8RrOO Q6FYkJFPAE2UpPYNFDwpRUyeBavSlPhrqVO2GIFD58ZOiC5g6vb6JdiO+sN0l9AAZKwKjQhf WzeaixrkksN8cGvCRl/7ZPYUOoQ= X-Mailgun-Sending-Ip: 104.130.96.5 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-n06.prod.us-east-1.postgun.com with SMTP id 5f6e92da99ecd993e193d0d7 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 26 Sep 2020 01:01:14 GMT Sender: tingwei=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D5980C43382; Sat, 26 Sep 2020 01:01:13 +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=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no 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 6E869C433FE; Sat, 26 Sep 2020 01:01:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6E869C433FE 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=fail 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 v4 6/6] stm class: ftrace: use different channel accroding to CPU Date: Sat, 26 Sep 2020 09:00:05 +0800 Message-Id: <20200926010005.14689-7-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200926010005.14689-1-tingwei@codeaurora.org> References: <20200926010005.14689-1-tingwei@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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..3bb606dfa634 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 = roundup_pow_of_two(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