Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp62039ybg; Sat, 25 Jul 2020 20:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy4k1I2pzRhMnTtGFfuEXmIZ1bzH5+2+NglnWlAI0kv4UhVKnduHSm1ot77RlPiDJ+aKM8 X-Received: by 2002:a17:906:3bd5:: with SMTP id v21mr11277468ejf.329.1595732560110; Sat, 25 Jul 2020 20:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595732560; cv=none; d=google.com; s=arc-20160816; b=1FZ20Iqn+ba4JnmHNnj3Vt3zWEJygRfLBimAjG6kYUpxGNEigcDxM/KAM+A4y33yRj 4RNCKgHsYSA2nHHDu2GF0+RcJIq8+XeGMI4LBtyvWcxmLJEU0nfzrw8LtRkEPaudWYLj JG+O8/OjS1STIsoMKrHpyAabVwgr9wniyy1edp2YBwfEqJ96dqON2zCo0np4CCBFNIA6 dnG2R6WtvORboXd2Nj7w48Lp8HRx70LyUcOVLVFpnfX28WZckaYadYmzMpNDHr/KdUE6 KT1dZJx0QIhA1D0vLvfoAQaEn6USGPBbU1uSNEADgkOZYACBCE2JFKu5NKgWu1HZnACv IrCA== 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=ZyhrKlsFyA2SM0pglryeAO/6F6SjdgBtpIxNxo45TWU=; b=r7VFBxtD6UP7rPLe2Xo1DBQEU6e2aKIvitfmJQxmnr6VlF8z2ODfQGJmY8lDCjIj+x ymQHST69cV76eChlGZ1rxi/nf8G6jvq6o6tbhAwKefXuUZo96/UrhhAt4hGBbcjXkqLQ 42JabWf++zSUjsW44Wmj8mbMXewOjG2ihO87ORBcYkr54Peis50ipsSChZi6Kh4drMnD QAHMJDDx8P9Yi287DiuiWUgJkJgYEDcvOvyNtHm0QIRCmQBQAbXZ03josw50nCpprp9z FqixBD2w94oV/0ypPQCbfboKwvQa+mLmDz5GhLhli31uV2BhGof4DC2qZgEF/rMIGt8c 0M6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=su27b8Oi; 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 c43si3116032edf.293.2020.07.25.20.02.17; Sat, 25 Jul 2020 20:02:40 -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=su27b8Oi; 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 S1728397AbgGZDA3 (ORCPT + 99 others); Sat, 25 Jul 2020 23:00:29 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:36786 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728393AbgGZDA2 (ORCPT ); Sat, 25 Jul 2020 23:00:28 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595732428; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=ZyhrKlsFyA2SM0pglryeAO/6F6SjdgBtpIxNxo45TWU=; b=su27b8OiaURKf3nkU6E/sdKtDGh0eFq9dS346tAM0Sn8rNDWx7QDabpysVYETdQVSzg3vOqp r2pRJ0SS0yQ0zQX95GxT6OYUtEraBsTvRe6Z7qKra9cs5RNsqQ0T7CcUV/koo75OR59T6SuJ z2jBdOkG6eSquDsLs5XzG679e0k= 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-n05.prod.us-west-2.postgun.com with SMTP id 5f1cf1b4298a38b616aa64ea (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 26 Jul 2020 03:00:04 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 502C4C43391; Sun, 26 Jul 2020 03:00:04 +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, URIBL_BLOCKED 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 567EAC433C9; Sun, 26 Jul 2020 03:00:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 567EAC433C9 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 Cc: Tingwei Zhang , tsoni@codeaurora.org, Sai Prakash Ranjan , Mao Jinlong , linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] stm class: ftrace: use different channel accroding to CPU Date: Sun, 26 Jul 2020 10:59:31 +0800 Message-Id: <20200726025931.30510-7-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200726025931.30510-1-tingwei@codeaurora.org> References: <20200726025931.30510-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 --- drivers/hwtracing/stm/ftrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing/stm/ftrace.c index c694a6e692d1..9893a0e8eced 100644 --- a/drivers/hwtracing/stm/ftrace.c +++ b/drivers/hwtracing/stm/ftrace.c @@ -37,8 +37,9 @@ 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); + 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 +64,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