From nobody Tue Dec 2 02:30:34 2025 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 D3DEC36CE1F for ; Wed, 19 Nov 2025 14:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763562857; cv=none; b=Vwq5eLrW1proybmcpcSmgsIFdJPtJHb5j6khP957KRNKVhdNPYqfhtO88KiGveXkomwzyR30BzgdnJtaXZoY4KwkDCRHJ7GL/nVG/+iY0dltyVwfCWC63rslmCMLfU6IdwDANpPiOWUNOKOv/+Xx3hRiMlqxJuMTecx4JegnkQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763562857; c=relaxed/simple; bh=bJrU0v15i68NWxbfSFEiqQ6IK3kd0rHoV26uN49ZtLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OQcjM7Y4KPip/uUxLLxR+Uz2gWJb5v4eaNFkEHevz5eHbBnEO90jok1jcKeOSpJY+mPPyXzFB5osMs4o7LC/fwCbmhHTJIYDttN3YQlNMdcmq3VCirkvK+UlVDtiKNLnUaEgIMgpC/+9wv7hFv8T9d3klrv2JiERrbcIwcfqWJc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=fm5thEjM; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fm5thEjM" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AJEQx4h014116; Wed, 19 Nov 2025 14:33:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=gDFAF NT+czOlxrsSeEW+rT6Hi2+OtuUa9itEXh07WtY=; b=fm5thEjMfFWsX62AFoTvn +QLuxdzx3zGcnSBUeY7BndPQvWVzkZcG1anf5kdwqaCo7fD7BOsmqwZW9Zy49Awz S62UZ6L7D29lo0fYU7VTzr6TU3mFUQezNB6XzGvHc9T2iOXkfQtOnEy/90m3kTiX OSFXQNMgVOKSYPE210ZAGFK75ThwdYbQBdCu59j+Kz5y/26KjxAKnaFWpvyJnNXn XrqGlFIsUiA2nqHXxpkL6lh883yxQcg2v4xc5Yr3WUwrGHJYl/5c7lJawRDvi7vg LwAq79WQRvAL2bN2xao/NkfoFQ+YTjp2eLni9NQ31aWG4ahroM8wZdR5D1Zyss6k Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4aej9077dn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Nov 2025 14:33:44 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 5AJDGnh2003837; Wed, 19 Nov 2025 14:33:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4aefyans6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Nov 2025 14:33:43 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 5AJEWno0022495; Wed, 19 Nov 2025 14:33:43 GMT Received: from laptop-dell-latitude7430.nl.oracle.com (dhcp-10-154-160-110.vpn.oracle.com [10.154.160.110]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 4aefyanr5p-29; Wed, 19 Nov 2025 14:33:42 +0000 From: Alexandre Chartre To: linux-kernel@vger.kernel.org, mingo@kernel.org, jpoimboe@kernel.org, peterz@infradead.org, david.laight.linux@gmail.com Cc: alexandre.chartre@oracle.com Subject: [PATCH v5 28/30] objtool: Compact output for alternatives with one instruction Date: Wed, 19 Nov 2025 15:32:45 +0100 Message-ID: <20251119143247.3944213-29-alexandre.chartre@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20251119143247.3944213-1-alexandre.chartre@oracle.com> References: <20251119143247.3944213-1-alexandre.chartre@oracle.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-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-19_04,2025-11-18_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2510240000 definitions=main-2511190116 X-Authority-Analysis: v=2.4 cv=OMAqHCaB c=1 sm=1 tr=0 ts=691dd548 b=1 cx=c_pps a=WeWmnZmh0fydH62SvGsd2A==:117 a=WeWmnZmh0fydH62SvGsd2A==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=eaZXao46RdKAZoVW1j8A:9 X-Proofpoint-ORIG-GUID: 51J3XbIqiIQNZftvL3yCaTHk8fSGswZd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMSBTYWx0ZWRfX0m5lYPVTkCGx VexwP0CS8h+xnk9fXWk+oTV+lbDXFQ4Ju/gVpPO6Rgg0LB8Fz5BO9E/f+z3sNkVuuTZjwCD4kwC 4m7qHrB2qNv1prpK4QWOmDj0paBaceoCYaiu31UqjCMQTey5XFRBViPs4YTnNzGabboc3GSB8Z4 tW9g8RBkzHd2mu6vqI9cRuERppgktQgvDHMT/TOGSJrVnBcv8p5OF7/0uoxlR0iiFs3LgyiQRs4 J4JPnTk/hsQwZ8KIl8R3WBNGszBEcxeW6MWpmJSyvLZAX6wU4T7Ewo0JJiTtR9fRx+nqre/24i3 rY2dL2ornwn4DgHtjhFE8cXw3wlioZo96WMF0rv5mg2gpBRQQvSuYqKvkBXFIaLDeMT2fj4rjhR P+Bog1j/FADpc6QmMHCrwDhD7eGqog== X-Proofpoint-GUID: 51J3XbIqiIQNZftvL3yCaTHk8fSGswZd Content-Type: text/plain; charset="utf-8" When disassembling, if an instruction has alternatives which are all made of a single instruction then print each alternative on a single line (instruction + description) so that the output is more compact. Signed-off-by: Alexandre Chartre --- tools/objtool/disas.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/objtool/disas.c b/tools/objtool/disas.c index 731c4495b53c7..a4f905eac4e63 100644 --- a/tools/objtool/disas.c +++ b/tools/objtool/disas.c @@ -863,6 +863,7 @@ static void disas_alt_print_compact(char *alt_name, str= uct disas_alt *dalts, int alt_count, int insn_count) { struct instruction *orig_insn; + int width; int i, j; int len; =20 @@ -871,6 +872,27 @@ static void disas_alt_print_compact(char *alt_name, st= ruct disas_alt *dalts, len =3D disas_print(stdout, orig_insn->sec, orig_insn->offset, 0, NULL); printf("%s\n", alt_name); =20 + /* + * If all alternatives have a single instruction then print each + * alternative on a single line. Otherwise, print alternatives + * one above the other with a clear separation. + */ + + if (insn_count =3D=3D 1) { + width =3D 0; + for (i =3D 0; i < alt_count; i++) { + if (dalts[i].width > width) + width =3D dalts[i].width; + } + + for (i =3D 0; i < alt_count; i++) { + printf("%*s=3D %-*s (if %s)\n", len, "", width, + dalts[i].insn[0].str, dalts[i].name); + } + + return; + } + for (i =3D 0; i < alt_count; i++) { printf("%*s=3D %s\n", len, "", dalts[i].name); for (j =3D 0; j < insn_count; j++) { --=20 2.43.5