From nobody Tue Jun 14 17:53:11 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8F75484505C; Tue, 14 Jun 2022 17:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LMwyc1G9jz3kyh; Tue, 14 Jun 2022 17:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655229192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uBbM19WMo6SFLHddW+CjOMvIQQibcK5J4dUl/XIJdcc=; b=VeB1EYB3ffErNCcGXD9Rwy2PfvBzF/tCyZdgvd9gJlWfMOm/b0GOcnfUXvPcENk8gVd1/O +dKgTgUxOSOB9JuoSzTB/KZwA4Mqz4stVXOgttjmezE/rUCLWRFKgmGUb9YfGlEE11hCKU Ci9cOGy48TyBdeHTVzl588v/7cMnOJqx5WM3ZiQRVSFenxLiB0OUq+PCYJPkyejJQkBbk4 5DhU6hi39F/txHKclZHMeuiGbk5vA9HV04hxJApxcrjPlU1r3sOjEg+UhKvc54Rqjzv1Wl nOIPWczFEnuy5DH41j5j97zZDL2PVbQaabrRTtENcWjWIT8kIBQjtlR8zc57jQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 057F36E9F; Tue, 14 Jun 2022 17:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25EHrB0v033062; Tue, 14 Jun 2022 17:53:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25EHrBJS033061; Tue, 14 Jun 2022 17:53:11 GMT (envelope-from git) Date: Tue, 14 Jun 2022 17:53:11 GMT Message-Id: <202206141753.25EHrBJS033061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 73702c398046 - main - pmcannotate: Don't increment end address passed to objdump -d. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73702c398046d8e01e6a0f5860b7e75cd37a9518 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655229192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uBbM19WMo6SFLHddW+CjOMvIQQibcK5J4dUl/XIJdcc=; b=HIf6YSOUt2i/H8Aa1Uds/Kit/tX6q7vGI7COiNytl3lJdDkU0I9ug27+ZwNhhUbgnvMCZw RRIonj7y86/434z3lSs7pWxsVj9lleJNq+EJzUkdBOZvcG19IVedEXxACCBEznzOelFVzA 5wuNKQIkITq5cNzWNHDVeegBJG2bjpouvDLOd71d+MG+ceupS9mb7el6vioKT+YYOnHZP7 kdJbPDK2CC71IGA23r80xlryDdrT3cMAPB9s3GVUoU1H6svyLkCgUc/P2RKexeeu2yfCPb Wog2oGiClP0L24oJPoOc46dnyJ7t46foM49y0eEZeF0EH1RJp6/6LIhL8uC3KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655229192; a=rsa-sha256; cv=none; b=kDNG75HW+R5c1ccgzpai7R7aKh+SzAykUSmNAW/gnA4rz2XWOgEphDJLGvIlUp5Y+MMiU4 Al0AMYY6bJyY9pXRTC8YY7wwVOFJmfdgFAcNQIvH945km9fLORZGiS5lTaRx8mHNpysWEe izhOkEIVmB0sVGKyNdOwUDhWT3i+PkI/R34RHv0IHlgoJIqkC2id7GJJzZwdEYN8U2H6c+ QrzAr49yAVii4rs5DUKp8W5SOr9BHkcVyzP2QRcvyRvJTHNYC5Zzqcryz/+susePz2bJZg SwW774s/6MJ8BuWGV5IbuNX4fbiXWtmljUNOajdcnDbd51l8kF/BQVJWgEx4UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=73702c398046d8e01e6a0f5860b7e75cd37a9518 commit 73702c398046d8e01e6a0f5860b7e75cd37a9518 Author: John Baldwin AuthorDate: 2022-06-14 17:52:54 +0000 Commit: John Baldwin CommitDate: 2022-06-14 17:52:54 +0000 pmcannotate: Don't increment end address passed to objdump -d. libpmc already returns an end address that is after the end of the last instruction of a function (on both amd64 and arm64) as the end address written to the annotate map file is computed as the start address of the symbol plus the size. Adding one could result in a curious failure where an entire function's contents in assembly was reduced instead to only the first instruction. The reason is that when the end instruction is bumped by one, objdump -d can append the first instruction of the next function in its output. However, since pmcannotate concatenates all of the objdump -d output from various functions into a single file which it then searches to find the assembly for a given file, if this additional trailer was earlier in the file than the full function, the trailer was chosen to represent the entire function resulting in the truncated listing of the function. Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35399 --- usr.sbin/pmcannotate/pmcannotate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/usr.sbin/pmcannotate/pmcannotate.c b/usr.sbin/pmcannotate/pmcannotate.c index 03f384d3f531..f3ffeed92738 100644 --- a/usr.sbin/pmcannotate/pmcannotate.c +++ b/usr.sbin/pmcannotate/pmcannotate.c @@ -434,11 +434,6 @@ fqueue_getall(const char *bin, char *temp, int asmf) start = agg->ag_ostart; end = agg->ag_oend; - /* - * Fix-up the end address in order to show it in the objdump's - * trace. - */ - end++; if (asmf) snprintf(tmpf, sizeof(tmpf), "objdump --start-address=%p "