From nobody Wed Apr 8 19:13:59 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 450CB2F3614; Wed, 25 Feb 2026 06:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772000738; cv=none; b=PVmx/Uk7tY1b4WI8XVU9pR6KrAaIu37SCIDAnu8P9TluZ+bYZ86gfzA889dga24k2EtnkFXgXyW9lkrhCT0WBvj3zCgxOPVTS3TYSGzGIWlmsiwcyzoBHmZ29O3qdIngXO2ACxuuP+s+cutXUzCVKJgcrrrjV10Se2XOwpdbNAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772000738; c=relaxed/simple; bh=qMbJlO9V+EqdfsZstLmamkZwUaN4TCa/6mtzDI+qsG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mq7r4c1CQiMzWADFmrzVChVx6l2NbYv5JCW2SgL1qaF295K8MlaDh+NO28xKiq+2VigLdWnXobv+Vjl5ZztwNOAbkWYtEQ8k7mce5a7Qrrir06g9oqiv2RQcQLKnQzJlKbu518WpL6b6imiMYOw4XaTGC0tejTeHT6PprrU94Fc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=a2gaLLjN; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="a2gaLLjN" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61P17vs44148421; Wed, 25 Feb 2026 06:25:00 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=Z8UeAqz8mv/ 0uZywowuExjjkK4BGRfFcOVNS/N+S34A=; b=a2gaLLjNL9t/Q9JSqaPnlGMge4H nmHMi/91EMX9b5jgBnOZuQss9t+bdakgj/D4dKGkEyiTJtrafujUQWQZoORrRavp x0fHzyO7stB2SKEyzn4FEARAgUPKX6Nk5mKHOid4Fj7a9DvhwWt8Q/1syUW7OmHD SUhwfq7CmfBU26ig7rxXoakA0PoA9I2/jWTRqV3GBGzMRfRPnTFkGaHsolD3W2E1 tijc0wkNsxnv728k2IOfqdyiAitmNcSLH0169vhFr9wzHBr/547NPI2bm3JY5zBh nlx3zmZ3xqJfBtx4Dn2J/pRhcOW2bRhfP/XBhuMCVZ9oVrj3NuWifdAm8Eg== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4chq57rqe7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Feb 2026 06:24:59 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 61P6Oto9001344; Wed, 25 Feb 2026 06:24:56 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 4cf5sm83es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Feb 2026 06:24:56 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 61P6OsFc001263; Wed, 25 Feb 2026 06:24:55 GMT Received: from hu-devc-blr-u24-a.qualcomm.com (hu-anuppate-blr.qualcomm.com [10.131.36.165]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 61P6Ot08001309 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Feb 2026 06:24:55 +0000 Received: by hu-devc-blr-u24-a.qualcomm.com (Postfix, from userid 486687) id C7E3F24A1E; Wed, 25 Feb 2026 11:54:53 +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 , Liang Kan , 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, Anup Patel , Mayuresh Chitale Subject: [PATCH v3 06/12] rvtrace: Add function to copy into perf AUX buffer Date: Wed, 25 Feb 2026 11:54:42 +0530 Message-ID: <20260225062448.4027948-7-anup.patel@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260225062448.4027948-1-anup.patel@oss.qualcomm.com> References: <20260225062448.4027948-1-anup.patel@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=faOgCkQF c=1 sm=1 tr=0 ts=699e95bb cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=J47OFj0AjNl56Ar9NcoA:9 X-Proofpoint-ORIG-GUID: RLbr5tueSDzNRbQGpuNNCgtd_tKGkNoI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI1MDA2MSBTYWx0ZWRfXw+g5cmOMFDoa 3VlbmAe/BXn42ntf/wo8Kq36RNAlJhCF+eAesbG3NZ4ZS/V/ipyCETbOBViEWRCunQ2dHR3N04B VFk9UwX/dGykY3KvDyTHxj136I3+EeojhEGRtWBPsYVQ2JfjhoGY6ytwBfKG5JCoangNYSRFLkV zdqkWrXjysIjsESEgUobu4N3vLUEnXLFbvtKeAwXG+RMn28g4sFJmMS/DSEH6MEVQl+ndL7t+TE VMG2t/83rsADmUo+Lr8HUOpSkXSmELS2l3fmcBQvgjMLoeBfOqeMHPJdAvARKgsukVgSNAxUb9O HcDg7RJ3FCfrLhq0MAK7G0mm8QlLqg51gxZOpo+e/8bdJVPQBKxU+MWshqtcSKVOwEhuoJ3hC3F OborUHrs2Z+QeWa5HFKZcQpwd73/Q1KT3l9FwuM+PSuhW281cDF1XhoXY/rbRuKff6tn6Se4lcp rpWnKTj3NRrRksgZf9g== X-Proofpoint-GUID: RLbr5tueSDzNRbQGpuNNCgtd_tKGkNoI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-24_03,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 bulkscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602250061 Content-Type: text/plain; charset="utf-8" The RISC-V trace ramsink will need a mechanism to copy trace data into the perf AUX buffer. Add rvtrace_path_copyto_auxbuf() function and corresponding trace driver callback copyto_auxbuf() for this purpose. Co-developed-by: Mayuresh Chitale Signed-off-by: Mayuresh Chitale Signed-off-by: Anup Patel --- drivers/hwtracing/rvtrace/rvtrace-core.c | 22 ++++++++++++++++++++++ include/linux/rvtrace.h | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/drivers/hwtracing/rvtrace/rvtrace-core.c b/drivers/hwtracing/r= vtrace/rvtrace-core.c index fa848935003a..1a1484c1eca4 100644 --- a/drivers/hwtracing/rvtrace/rvtrace-core.c +++ b/drivers/hwtracing/rvtrace/rvtrace-core.c @@ -664,6 +664,28 @@ int rvtrace_path_stop(struct rvtrace_path *path) } EXPORT_SYMBOL_GPL(rvtrace_path_stop); =20 +int rvtrace_path_copyto_auxbuf(struct rvtrace_path *path, + struct rvtrace_perf_auxbuf *buf, + size_t *bytes_copied) +{ + const struct rvtrace_driver *rtdrv; + struct rvtrace_component *comp; + struct rvtrace_path_node *node; + + list_for_each_entry(node, &path->comp_list, head) { + comp =3D node->comp; + rtdrv =3D to_rvtrace_driver(comp->dev.driver); + if (!rtdrv->copyto_auxbuf) + continue; + + *bytes_copied =3D rtdrv->copyto_auxbuf(comp, buf); + return 0; + } + + return -EOPNOTSUPP; +} +EXPORT_SYMBOL_GPL(rvtrace_path_copyto_auxbuf); + 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 2a7d8afd27c8..36663c7b3e30 100644 --- a/include/linux/rvtrace.h +++ b/include/linux/rvtrace.h @@ -280,9 +280,28 @@ void rvtrace_destroy_path(struct rvtrace_path *path); int rvtrace_path_start(struct rvtrace_path *path); int rvtrace_path_stop(struct rvtrace_path *path); =20 +/** + * struct rvtrace_perf_auxbuf - Representation of the perf AUX buffer + * @length: size of the AUX buffer + * @nr_pages: number of pages of the AUX buffer + * @base: start address of AUX buffer + * @pos: position in the AUX buffer to commit traced data + */ +struct rvtrace_perf_auxbuf { + size_t length; + int nr_pages; + void *base; + long pos; +}; + +int rvtrace_path_copyto_auxbuf(struct rvtrace_path *path, + struct rvtrace_perf_auxbuf *buf, + size_t *bytes_copied); + /** * struct rvtrace_driver - Representation of a RISC-V trace driver * id_table: Table to match components handled by the driver + * copyto_auxbuf:Callback to copy data into perf AUX buffer * start: Callback to start tracing * stop: Callback to stop tracing * probe: Driver probe() function @@ -293,6 +312,8 @@ int rvtrace_path_stop(struct rvtrace_path *path); */ struct rvtrace_driver { const struct rvtrace_component_id *id_table; + size_t (*copyto_auxbuf)(struct rvtrace_component *comp, + struct rvtrace_perf_auxbuf *buf); int (*start)(struct rvtrace_component *comp); int (*stop)(struct rvtrace_component *comp); int (*probe)(struct rvtrace_component *comp); --=20 2.43.0