From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 06D69261B6D for ; Fri, 29 Aug 2025 08:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756456551; cv=none; b=BMm6OTWmLZ2bqVaZVISQoa+rFeusMeZAe6xsrR1Z9axVTduoriwuI6IChvDAZSqdn5Evfkba4pUrfHRKewCAXgND2yNLGRsXebnidPEfRX32MCw3xaFcGgdhhlv/lYisxTB5sgfjXqBj6EY43FUFsYuj/Pg1NkUSvnMPBKeN4tU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756456551; c=relaxed/simple; bh=KpERUClSWyR3/qVazgPpn8VOjJ9080TUko1cw6MhfQ4=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=SdPaIyK0n2sdbghrWkRjrOzfKjUud9dGbhe5wsZiMmbNDhbKHKl/4fzrQLLUD0ZVPSWG1T/RYi62cCr8WycVv35Ko3W+NXjcmMfHvqIhyoHiDveEeecBVs8zXsdndufo2d991XCRXju9GJelhgGhaqLRRn4hwD0zX5hVHXkngjw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=hk37P4Fe; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="hk37P4Fe" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57T8HM2P007535; Fri, 29 Aug 2025 08:35:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=3UykXr Tl2EB+vKESxnHtvi5hIMPHRCCUy7MHaCs1xXA=; b=hk37P4Fe0mi9T32XkwxsA3 v2QfGOxklUu1IdEVMYeHJLEFBpauAOBImwp9iro2jVr0nY5eTglA6xOGmHEg5Cga ZN7zD8UkOOrCYyfvrJI9t5Rwj1svpkUm0tE4NYlLXtK8pwftJ/FqEJgpySKLZlTC vur30tAnD/GWulzprkpPA4y+FQRmU04mA8RXVBExHrjO0fyhq1M0Gv40TV+8h4Dl J5C55pxU0/vn74wcwGC4lQh3gR7OZo7b1wJlyfeya7N9zG3qOJQpl/+/QarLpM3r 8HZhj1dkPHa8MZ/7H3GzXdi56XV92Fl3+EXvzTiM+sB+MttYjjB5iz6+NA5AhWPQ == Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 48tsv9bu0k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Aug 2025 08:35:43 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 57T8Y3BF004975; Fri, 29 Aug 2025 08:35:42 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 48tsv9bu0h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Aug 2025 08:35:42 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 57T87VXH002482; Fri, 29 Aug 2025 08:35:42 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 48qt6mrs1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Aug 2025 08:35:41 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 57T8Zcai53871080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Aug 2025 08:35:38 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 355C620040; Fri, 29 Aug 2025 08:35:38 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88A7920043; Fri, 29 Aug 2025 08:35:31 +0000 (GMT) Received: from smtpclient.apple (unknown [9.61.241.17]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 29 Aug 2025 08:35:31 +0000 (GMT) Content-Type: text/plain; charset=utf-8 Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: [PATCH 12/14] tools/perf: Add support for printing synth event details via default callback From: Athira Rajeev In-Reply-To: Date: Fri, 29 Aug 2025 14:05:17 +0530 Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Madhavan Srinivasan , Ian Rogers , Namhyung Kim , "open list:PERFORMANCE EVENTS SUBSYSTEM" , PowerPC , Aboorva Devarajan , Shrikanth Hegde , Kajol Jain , hbathini@linux.vnet.ibm.com, Aditya Bodkhe , Venkat Rao Bagalkote Content-Transfer-Encoding: quoted-printable Message-Id: References: <20250815083407.27953-1-atrajeev@linux.ibm.com> <20250815083407.27953-13-atrajeev@linux.ibm.com> To: Adrian Hunter X-Mailer: Apple Mail (2.3776.700.51) X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=GqtC+l1C c=1 sm=1 tr=0 ts=68b1665f cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=QyXUC8HyAAAA:8 a=VnNF1IyMAAAA:8 a=PQ0u6mOqf5tVaTv6lJEA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: PEjV-EK6ldknHxRXMJaC9germ_M2xWSs X-Proofpoint-ORIG-GUID: 4WcRs649npg_lg7WTpAjXos2XaWm4bOd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODI4MDEyNyBTYWx0ZWRfX4BSh6mTd0cUK 4GLlV3TvgIY7WLllROA/AUyBC0vjiu8AueEArJaeetLBw5SYE8eiaU19AE3G0z1LhxpjNMm0dwS cyEDskIYBzmkJxPwM+oMnJUWSpd7/oIzKQFXzSDgd9l4JBdchRUH31KRcBLF/B9++XD6OrAb0Wl uyMjdzzzizeB5OVlA/jiGgr7/1KMa8KOn6qHKYtYdfApzucdaCe608/fmo6Q58q6x4yIW021s2g Js7f/fNeX91QV+V+sFHmQkl3WsKDM+7AFPB9DPczxPIuDvOSxBBEUUl/GfU/MxaM5gA+GR4JvKM yTa+yP31/0TTjU0jeebRziXXjrRCgDrU7T8L/9MJVTCHiIumnrUueXky6nAS3/zFmqih4Wm40AB SRUZFR5A X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-29_02,2025-08-28_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 phishscore=0 bulkscore=0 suspectscore=0 adultscore=0 malwarescore=0 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508280127 > On 27 Aug 2025, at 10:59=E2=80=AFPM, Adrian Hunter = wrote: >=20 > On 15/08/2025 11:34, Athira Rajeev wrote: >> Introduce arch_perf_sample__fprintf_synth_evt to add support for >> printing arch specific synth event details. The process_event() >> function in "builtin-script.c" invokes perf_sample__fprintf_synth() = for >> displaying PERF_TYPE_SYNTH type events. >>=20 >> if (attr->type =3D=3D PERF_TYPE_SYNTH && PRINT_FIELD(SYNTH)) >> perf_sample__fprintf_synth(sample, evsel, fp); >>=20 >> perf_sample__fprintf_synth() process the sample depending on the = value >> in evsel->core.attr.config . Currently all the arch specific = callbacks >> perf_sample__fprintf_synth* are part of "builtin-script.c" itself. >> Example: perf_sample__fprintf_synth_ptwrite, >> perf_sample__fprintf_synth_mwait etc. This will need adding arch >> specific details in builtin-script.c for any new perf_synth_id = events. >>=20 >> Introduce arch_perf_sample__fprintf_synth_evt() and invoke this as >> default callback for perf_sample__fprintf_synth(). This way, arch >> specific code can handle processing the details. >=20 > A default callback is not needed. >=20 >>=20 >> Signed-off-by: Athira Rajeev >> --- >> tools/perf/builtin-script.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >>=20 >> diff --git a/tools/perf/builtin-script.c = b/tools/perf/builtin-script.c >> index d9fbdcf72f25..eff584735980 100644 >> --- a/tools/perf/builtin-script.c >> +++ b/tools/perf/builtin-script.c >> @@ -2003,6 +2003,12 @@ static int = perf_sample__fprintf_synth_iflag_chg(struct perf_sample *sample, FILE >> return len + perf_sample__fprintf_pt_spacing(len, fp); >> } >>=20 >> +static void arch_perf_sample__fprintf_synth_evt(struct perf_sample = *data __maybe_unused, >> + FILE *fp __maybe_unused, u64 config __maybe_unused) >> +{ >> + return; >> +} >> + >> static int perf_sample__fprintf_synth(struct perf_sample *sample, >> struct evsel *evsel, FILE *fp) >> { >> @@ -2026,6 +2032,7 @@ static int perf_sample__fprintf_synth(struct = perf_sample *sample, >> case PERF_SYNTH_INTEL_IFLAG_CHG: >> return perf_sample__fprintf_synth_iflag_chg(sample, fp); >> default: >=20 > Should just add something like: >=20 > case PERF_SYNTH_POWERPC_VPA_DTL: > return perf_sample__fprintf_synth_vpadtl(sample, fp); Ok Adrian Will directly call perf_sample__fprintf_synth_vpadtl instead of having = default call back Thanks for all comments, I will post a V2 addressing the changes Thanks Athira >=20 >> + arch_perf_sample__fprintf_synth_evt(sample, fp, = evsel->core.attr.config); >> break; >> }