From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFA69FF8875 for ; Wed, 29 Apr 2026 12:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mUtPnkIODRVDptcDsYxb6jl+EEYjtOXFb0F8JqyFR34=; b=e+9F3QbViBjpGA 6U6/109+nfLt3ldrdSSZx+JlekFJP+mM5c+p5ykkJhLJdEdAuMXy83CQrkiedPsIoQzdQFudVFwIe TxtXB+R2hJnddDDVWL8gc1RPcdYipovF/Y1Rg0WdL6iLfU7QE4MyI5kM4GXXQ9DT5HuiEZ8Ajj4Py f5+YQ0x4yDnCAkbGlJFV/7LoW4bWeXz5FzH4JX2NdayQIVbZVzWlEPBD8chnl8aRqFTRknYu7MRil sjqTUCP0tFHHPZYLDtjePW5b01wIv5oI2Gf1YeAzd2eA3DVax8oX3Bi8hpSpyeNKjvdx/VoqYFuvO h1gDPGD/rwSXaLennbJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wI4Oh-00000003bF1-1G6J; Wed, 29 Apr 2026 12:52:11 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wI4Oe-00000003bE7-1kmg for linux-riscv@lists.infradead.org; Wed, 29 Apr 2026 12:52:09 +0000 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TCeRiX316843; Wed, 29 Apr 2026 12:51:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=CiL2aaqk/Kq BI1IjgghdPCw+FMzlCUSHV6o7boNi888=; b=HI8HWxNvjM41i2GiwSUTeM9behF mroGRis5I/CAk0lsM9kfZ+5EVlekiJ9inN9bp/7obfgp0ftURx+U1KJeviGxzSdF mStjVEa4QmQt4ZlByVH5rsYJIYEFNxltjClV0K7U/384TgEt9gt/K8Y0ly5pqSXS v4IfrpJbeTAn9FHKzs6z8juP4RnPEykUhl3OSVLurxajpvz6u6ZzIXlItMUmC1+j A6BmWWbAdilOvSMEJ9/KgvqU1081ra0EhDfzNUVXQbDrtRb+tISRnaAGgrxPNmII xnLfsAY3CidzpEmvsh/ZvFHdZTLNN8tpohnzMK5/Ki5Ny7Id547dFbbImLQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duj6t813y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2026 12:51:41 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 63TCpbKE010775; Wed, 29 Apr 2026 12:51:37 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 4ds65fvr0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2026 12:51:37 +0000 (GMT) Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 63TCpbun010749; Wed, 29 Apr 2026 12:51:37 GMT Received: from hu-devc-blr-u24-a.qualcomm.com (hu-anuppate-blr.qualcomm.com [10.131.36.165]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 63TCpbBr010746 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2026 12:51:37 +0000 (GMT) Received: by hu-devc-blr-u24-a.qualcomm.com (Postfix, from userid 486687) id BC33521D1B; Wed, 29 Apr 2026 18:21:36 +0530 (+0530) From: Anup Patel To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Palmer Dabbelt , Paul Walmsley , Greg KH , Alexander Shishkin , Ian Rogers Cc: Alexandre Ghiti , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Jiri Olsa , Adrian Hunter , Mayuresh Chitale , Anup Patel , Atish Patra , Andrew Jones , Sunil V L , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mayuresh Chitale , Anup Patel Subject: [PATCH v4 04/12] rvtrace: Add functions to start/stop tracing on a component path Date: Wed, 29 Apr 2026 18:21:27 +0530 Message-ID: <20260429125135.1983498-5-anup.patel@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429125135.1983498-1-anup.patel@oss.qualcomm.com> References: <20260429125135.1983498-1-anup.patel@oss.qualcomm.com> MIME-Version: 1.0 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-GUID: _VkAvuobiMqMgK3w947Xs9pTn9Ir3apj X-Authority-Analysis: v=2.4 cv=KcHidwYD c=1 sm=1 tr=0 ts=69f1fedd cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=a8cUU4qgmBzOD3ajWOcA:9 X-Proofpoint-ORIG-GUID: _VkAvuobiMqMgK3w947Xs9pTn9Ir3apj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDEzMCBTYWx0ZWRfX2ZHDR7eHayy4 TvUlQbpwm01TAJHPVGyubLqrkIx0qzmhZ10vXCtLw2SrArJaZHdsIfRgIO76WRTE1UR6ofG6cEQ zkqoyu/3xC3aPVMGoQ4cHRZAMxJ5Hk/SEbw64eNVEInqVfu1QGUcXp+SzIg9p6MUsKciyndUwbc EovXoijuCeElHIqftd9sj12G4sONAwfIYi+Y9+PMvgYT+3KIm1h+ZUZ2yKx2+EB6LGo2vy+9VI2 aCI9mtq9sp5ZU8F7ck/QwvzjmkopkBaO4AuJbwJI8eLZ836dwg+XTZLKxGhk5CwLJWKuHAf6l3e /Xh65u0IJpwOQyhSJj/urT7vu2q2dxKv9PvUpVrbHsr/BUNX/XdyUNFvwzTdNxp6TFtZpzcC1vB 9b/d1Z79o9udasIvWC+MbnMo0SMlB7kmbAdtRUlFgZUJh5bDCF17zaSA//r2sH2F0z575SCF2TI up5VFuCXbCSwlfkUt4w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-28_05,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290130 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260429_055208_464685_099C6711 X-CRM114-Status: GOOD ( 15.63 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Mayuresh Chitale The perf driver framework needs to be able to start / stop all components in a trace component path during its operation. Add rvtrace_path_start() and rvtrace_path_stop() functions for this purpose. Co-developed-by: Anup Patel Signed-off-by: Anup Patel Signed-off-by: Mayuresh Chitale --- drivers/hwtracing/rvtrace/rvtrace-core.c | 44 ++++++++++++++++++++++++ include/linux/rvtrace.h | 6 ++++ 2 files changed, 50 insertions(+) diff --git a/drivers/hwtracing/rvtrace/rvtrace-core.c b/drivers/hwtracing/rvtrace/rvtrace-core.c index f78e3ba9a0e5..733d07abffbc 100644 --- a/drivers/hwtracing/rvtrace/rvtrace-core.c +++ b/drivers/hwtracing/rvtrace/rvtrace-core.c @@ -620,6 +620,50 @@ static void rvtrace_release_path_nodes(struct rvtrace_path *path) } } +int rvtrace_path_start(struct rvtrace_path *path) +{ + const struct rvtrace_driver *rtdrv; + struct rvtrace_component *comp; + struct rvtrace_path_node *node; + int ret; + + list_for_each_entry_reverse(node, &path->comp_list, head) { + comp = node->comp; + rtdrv = to_rvtrace_driver(comp->dev.driver); + if (!rtdrv->start) + continue; + + ret = rtdrv->start(comp); + if (ret) + return ret; + } + + return 0; +} +EXPORT_SYMBOL_GPL(rvtrace_path_start); + +int rvtrace_path_stop(struct rvtrace_path *path) +{ + const struct rvtrace_driver *rtdrv; + struct rvtrace_component *comp; + struct rvtrace_path_node *node; + int ret; + + list_for_each_entry(node, &path->comp_list, head) { + comp = node->comp; + rtdrv = to_rvtrace_driver(comp->dev.driver); + if (!rtdrv->stop) + continue; + + ret = rtdrv->stop(comp); + if (ret) + return ret; + } + + return 0; +} +EXPORT_SYMBOL_GPL(rvtrace_path_stop); + struct rvtrace_path *rvtrace_create_path(struct rvtrace_component *source, struct rvtrace_component *sink, enum rvtrace_component_mode mode) diff --git a/include/linux/rvtrace.h b/include/linux/rvtrace.h index 00b63fa22da9..2a7d8afd27c8 100644 --- a/include/linux/rvtrace.h +++ b/include/linux/rvtrace.h @@ -277,10 +277,14 @@ struct rvtrace_path *rvtrace_create_path(struct rvtrace_component *source, struct rvtrace_component *sink, enum rvtrace_component_mode mode); void rvtrace_destroy_path(struct rvtrace_path *path); +int rvtrace_path_start(struct rvtrace_path *path); +int rvtrace_path_stop(struct rvtrace_path *path); /** * struct rvtrace_driver - Representation of a RISC-V trace driver * id_table: Table to match components handled by the driver + * start: Callback to start tracing + * stop: Callback to stop tracing * probe: Driver probe() function * remove: Driver remove() function * get_trace_id: Get/allocate a trace ID @@ -289,6 +293,8 @@ void rvtrace_destroy_path(struct rvtrace_path *path); */ struct rvtrace_driver { const struct rvtrace_component_id *id_table; + int (*start)(struct rvtrace_component *comp); + int (*stop)(struct rvtrace_component *comp); int (*probe)(struct rvtrace_component *comp); void (*remove)(struct rvtrace_component *comp); int (*get_trace_id)(struct rvtrace_component *comp, -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv