Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp121906pxa; Mon, 10 Aug 2020 21:01:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaDGQbUvSMzHLvTw1zcKlZ3Z0PzBXcm9NTVu1r+7zhCzCunZL1iwwQ+tHOlVmfVoJSJ4Cv X-Received: by 2002:a05:6402:22d9:: with SMTP id dm25mr23695381edb.2.1597118500522; Mon, 10 Aug 2020 21:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597118500; cv=none; d=google.com; s=arc-20160816; b=qsiSZ0A6h4xZUgH9f3CLB7qJdLxtiCkR8DOLz1x+4PTqs3eiG+FQxWx12+YJzzzVLk TFA/BPAA2sk9uZJFaaEx16YlC376pvP+4HUU7YYQMZw9RGi8neaOYYYTZj7qrcdgjxw+ 5KK0IIlV3elmU6T+G2hdqZrfjVAkSHFzGQF5qFryTKN7/TNztR8vyJuMe4ACKB1bNAJe +jdEiP/SaViXTGeEB6AUemIwWQxcP50A5JnPuQGetPN05PopsHt8zpe+L3DSJfCVxByC ghl2Cc2Wmy8ihiC64W7C+YI4uue5z7sXDidaXRZ94DuFygoLSKHo/K4JbEddh6IJzmaz LGbg== 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 :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature; bh=DWvh/xe4da4kqEIchXLMEtV/mjQkWQ1/j/n7f+uAWvc=; b=UOc5sA297fnSO0hsUwYSEasSKCogPxloG7eh1rEo4v1RbPJyV59lBv0W+bCtNKYNh5 tMXZ2xjyCn11sCBFQi/FFwIttxIocsPpgCsw2gSB/1J+qwBkaagwS+NFo5pCRlv+rT/R NfWpM8OC6aNIX51gzBuqqxtaIqXCYchO7pEnOV4oAo0tvF2CoYHtbe0/osgZN1qikQAw O5RHn/YHIfFAAipY2S/vZ/0U7Zw8EdKYG9IZ13zYiZofG1MYKJ9Z95Bjkq1kgq2bZFQs yeFGao465Nvo+67bOsHuPNFjw5B/NtcjTC9r8YNQdGLKm8sVxpSVVGFjTuomD9x/WXtP zm3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=sklO6kPs; 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 v4si13113038edl.506.2020.08.10.21.01.18; Mon, 10 Aug 2020 21:01: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=sklO6kPs; 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 S1728344AbgHKD6M (ORCPT + 99 others); Mon, 10 Aug 2020 23:58:12 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:33164 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728196AbgHKD6L (ORCPT ); Mon, 10 Aug 2020 23:58:11 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597118290; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: Cc: To: From: Sender; bh=DWvh/xe4da4kqEIchXLMEtV/mjQkWQ1/j/n7f+uAWvc=; b=sklO6kPsfXTMW871DxRXcU5Ooe7+FaBPglpVzfoW5g6oaChTd3RiZwJFZI/DdJ8Q7fUREb3R LTlxUfuiwO9eCLYVx1z5G5KQYkS6yfgE9mQHlExxouvvJ8WGt3yPZBO/jj/OgmnA67Jkopkg +/oRabbkCxkl5RnVvC9o2e0XYVo= 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-n16.prod.us-east-1.postgun.com with SMTP id 5f32173391f8def8b200a48b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 11 Aug 2020 03:57:39 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B2C05C433AD; Tue, 11 Aug 2020 03:57:38 +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 024C6C433C9; Tue, 11 Aug 2020 03:57:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 024C6C433C9 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 , Mathieu Poirier , Suzuki K Poulose Cc: Tingwei Zhang , tsoni@codeaurora.org, Sai Prakash Ranjan , Mao Jinlong , linux-kernel@vger.kernel.org, coresight@lists.linaro.org Subject: [PATCH v3 0/6] tracing: export event trace and trace_marker Date: Tue, 11 Aug 2020 11:57:20 +0800 Message-Id: <20200811035726.10379-1-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 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 Ftrace has ability to export trace packets to other destination. Currently, only function trace can be exported. This series extends the support to event trace and trace_maker. STM is one possible destination to export ftrace. Use separate channel for each CPU to avoid mixing up packets from different CPUs together. Change from v2: Change flag definition to BIT(). (Steven) Add comment in stm_ftrace_write() to clarify it's safe to use smp_processor_id() here since preempt is disabled. (Steven) Change from v1: All changes are suggested by Steven Rostedt. User separate flag to control function trace, event trace and trace mark. Allocate channels according to num_possible_cpu() dynamically. Move ftrace_exports routines up so all ftrace can use them. Tingwei Zhang (6): stm class: ftrace: change dependency to TRACING tracing: add flag to control different traces tracing: add trace_export support for event trace tracing: add trace_export support for trace_marker stm class: ftrace: enable supported trace export flag stm class: ftrace: use different channel accroding to CPU drivers/hwtracing/stm/Kconfig | 2 +- drivers/hwtracing/stm/ftrace.c | 7 +- include/linux/trace.h | 7 + kernel/trace/trace.c | 270 ++++++++++++++++++--------------- 4 files changed, 159 insertions(+), 127 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project