From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.159 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795869776; b=aiMjZ2lJllJ5VvZcdGF9NidPHBA4xn6XBRhzL+FVCxfBeESWWeBLyz6+7hCQvddXzhdG eu+gnvKYn7eQpKD/tLquR2DSQ5Uzh1K3Xekww84QJYBvOem77Hvo+ekTm58LPnND5DcxP IKG5zgmceAPBTQgcpy0F/Rhk3mPEgYE3HBSq/ERzA1xLTUoFrOb8mWIh/ubyDfETi5jyc A++x4y4MUC6h5nwu8ixHQuULZ42uylLnX6azKvknZakcRcyyGA96wxJN5T1jTcn7wCGJg uzs7bdbsGDJ4B2mZPxYssWOe8M9wax2cxS97PYE9nBcsbeU5UtjMrpjAosBCD7322Ng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795869776; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:CC:Subject:In-Reply-To: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=mcSnvFjvFQU6PiHrX1TmhgXI2s7ud5WUWAo4YI1LSXM=; b=uyjY63st+YnhPtFKBoQuOzLl7YMsDMej7IYERPyqtn8hXur3QnK/up8wOb5HlUvSj/lk XK7BmpKJx13NMTw165JEbzPtA2JA1w/E2j4f+FVL/ss6y92QedQvlXYFhKN1k3UxFokhp nK7XlWvLe4IIioOIPmu9spKMabrhyOxwVjTTUtpEbTQX4cwFkfNu4cbnHgKj5PflwPWwG 315HmOp3PzoCBZX3HNLHsHYW5MrQV7BXSw1mRfnd74mKO3fnPH2QLI1rdbNVdtA5sDiYw 3jbQjkt45mPNN+ULElc67m9SwfLSjA/V5RGgzORoAlK9sLgYVnSijeWAWbltPInkblA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=a43eJgmn; arc=none smtp.remote-ip=95.215.58.159 Received: from mta1.migadu.com (out-159.mta1.migadu.com [95.215.58.159]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34096606A31C for ; Sat, 28 Nov 2026 12:42:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 34096606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=a43eJgmn X-Envelope-To: linux-perf-users@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=dBjXip2DbBfZmo4Rbdun8IWodbOJKv0ncQqSEzyjc3M=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795869773; v=1; x=1796474573; b=a43eJgmnjy+zI/eZ2rboGVD9vtfffxcKGEYGHlzd5RWe3jLE+2NmfKJGDJnO1QTn8nXxyAbP TUpMMvGwXySaGi/pxmLivDuvcQTlcPFUw7PVUFmn7DSTLB4My9r1dx1WOCAu4FXAYss/+QtL9BW vh2eR43f8IK6gU5SaOh85T7Q= X-Envelope-To: linux-perf-users@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 9f8eb6a363332ba6; Sat, 28 Nov 2026 12:42:53 +0000 X-Mizu-Trace-ID: 9f8eb6a363332ba6 X-Migadu-Flow: FLOW_OUT Date: Sat, 28 Nov 2026 12:42:52 +0000 From: Bradley Morgan To: atrajeev@linux.ibm.com CC: acme@kernel.org, adrian.hunter@intel.com, hbathini@linux.vnet.ibm.com, irogers@google.com, jolsa@kernel.org, linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com, namhyung@kernel.org, narnalli@in.ibm.com, tejas05@linux.ibm.com, tshah@linux.ibm.com, venkat88@linux.ibm.com, vpuliyal@in.ibm.com Subject: =?US-ASCII?Q?Re=3A_=5BPATCH=5D_perf_disasm_powerpc=3A_handle_Pow?= =?US-ASCII?Q?er10_prefixed_instruction_continuation_lines?= In-Reply-To: <20260907051429.29080-1-atrajeev@linux.ibm.com> Message-ID: X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 7 September 2026 06:14:29 BST, Athira Rajeev wrote: >Power10 introduces prefixed instructions that are 8 bytes wide. objdump >emits these as two lines: the first carries both the raw bytes and the >mnemonic, while the second carries only the raw bytes of the second word >with no mnemonic: > > 1020900c: 0b 00 10 06 pla r31,757280 # 102c1e2c > 10209010: 20 8e e0 3b > >disasm_line__parse_powerpc() calls disasm_line__parse() on the mnemonic >portion of the line. disasm_line__parse() returns -1 when the name >string is empty, which causes disasm_line__new() to return NULL, which >causes symbol__parse_objdump_line() to return -1, which immediately >breaks the objdump output parsing loop in symbol__disassemble_objdump(). > >The result is that annotation of any function containing a prefixed >instruction stops at the continuation word and all subsequent >instructions in the function are lost. > >Fix this by treating an empty mnemonic as a valid case in >disasm_line__parse_powerpc(): skip the call to disasm_line__parse() and >set the instruction name to an empty heap-allocated string instead, >allowing parsing to continue to the next line. > >Reported-by: Narendra Nalli >Reported-by: Vijay Puliyala yes, thanks Reviewed-by: Bradley Morgan Tested-by: Bradley Morgan # Power10 >Signed-off-by: Athira Rajeev >--- > tools/perf/util/disasm.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > >diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c >index e263a2a8715d..8dca703a5c74 100644 >--- a/tools/perf/util/disasm.c >+++ b/tools/perf/util/disasm.c >@@ -884,10 +884,24 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar > if (name_raw_insn[0] == '\0') > return -1; > >- if (disasm) >- ret = disasm_line__parse(name, namep, rawp); >- else >+ if (disasm) { >+ /* >+ * Power10 prefixed instructions are 8 bytes and objdump emits >+ * the second word on its own line with raw bytes but no >+ * mnemonic, e.g.: >+ * 1020900c: 0b 00 10 06 pla r31,757280 >+ * 10209010: 20 8e e0 3b >+ * >+ * Treat a missing mnemonic as an empty instruction name rather >+ * than a parse failure, so that parsing continues past it. >+ */ >+ if (name[0] != '\0') >+ ret = disasm_line__parse(name, namep, rawp); >+ else >+ *namep = strdup(""); >+ } else { > *namep = ""; >+ } > > tmp_raw_insn = strndup(name_raw_insn, 11); > if (tmp_raw_insn == NULL) > --- Thanks!