From nobody Sat Apr 26 03:24:59 2025 X-Original-To: dev-commits-src-branches@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 4Zkw7b6l9Pz5tXtW; Sat, 26 Apr 2025 03:24:59 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zkw7b498Sz3QDh; Sat, 26 Apr 2025 03:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745637899; 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=phE/lw9ZtKGhTS+rEWg+SE6XkCEg1KHUA2PxfwJm71g=; b=a+Obbn8bSYoid5OudRtWrXopkHRthePKd/U/7Uahlve7NI9HPFdV7qv+tA6I0++XWWfcA9 gNkugbcQVIk7BuKV8/WqHUr3Q/dB2wR9lCeIqZDbPzpIgKsQbmFx2wmyM60lmf15cpGTD6 ODV4glfnuMEVA5WLvdQVhhXfyw59RFbs5qYpqnqMCyShrE3y7XSVnjiUDgCyaxyIOcOYq0 xUtK/v/idsEmCnAzPeoRoZnkYBZyXaehd3mfzTp4WdEZp4QDnkFC3IPRFRsMM3Z0QGXFbU z00lWBZApNLNJ3prVT+dIv1Zml1g6mDwswGNfKRejI1FeOqeXDuNP1/EgX2cxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745637899; a=rsa-sha256; cv=none; b=fg8MmljpYZ9QDQCRoojIdcxXs6AT2wPJI15GaGGCyhvOn/O+p0K5vor1qoH6GdyHno06mt k6TT+jFaHM0vc04Ae0OGc8mm90tZV+ETpEj0dX9K5vLy2tYQJzXIuejyBdjjbBtpOgJ/Ut jchws7/Ry1ejm+410hi359ywqF348K9KMbcCriXwnA8WaHgAnPw7i/LcbawjLod6Es9bl7 IxxjuKY1/481JjJQyLClbc/HcjZ2LkAs0ELQoSeXELD1a8rhKAzlONuw1Z2+CCFSRMggVg MbJ5HI/Wix1Fm/O/6PusN9ZjXBTMu/fwEz+VulU+6QJhAlMd29od8U7a8evsZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745637899; 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=phE/lw9ZtKGhTS+rEWg+SE6XkCEg1KHUA2PxfwJm71g=; b=ICKfKDhmS4kRFqise1DlotN36B2T433oOQRr/llRK1cv0sMBxNM+tVivD/vvyxnhwz/DzQ Gi611TbsxGD9LR9LshTqNxxhq0Cw9KLI/5/CWuCTEIAiSUp6Bg7m695jGbLphussDXW484 6ZAEPEK3EDxBSwKkK1PYU6lg8ioMGXm1KcUTsyZZlnRgUAEKMb2UyXM7rep9j3tvbTWA7T BVzlaWIWSm6hO8Z6FJoMF4rE4haux77ERBgfE+kFH9q3Re6jKYtccN1Rt5J6p5G6OQUqnL gVq3hMyMpjNKKdvtfJosYGIOYdgyFmkTLSf2MfPW8y/od+mm9qX2HiL9mQ7Ghw== 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 4Zkw7b3cqkz1384; Sat, 26 Apr 2025 03:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53Q3Ox7n017693; Sat, 26 Apr 2025 03:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53Q3OxTs017690; Sat, 26 Apr 2025 03:24:59 GMT (envelope-from git) Date: Sat, 26 Apr 2025 03:24:59 GMT Message-Id: <202504260324.53Q3OxTs017690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: e5a4712e6557 - stable/14 - libpmcstat: fix pmcstat -G on older-ish -CURRENT w/ drm-kmod List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e5a4712e6557d1007bfa63b8c83c4e3d8f86564b Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e5a4712e6557d1007bfa63b8c83c4e3d8f86564b commit e5a4712e6557d1007bfa63b8c83c4e3d8f86564b Author: Kyle Evans AuthorDate: 2025-04-21 04:00:01 +0000 Commit: Kyle Evans CommitDate: 2025-04-26 03:24:17 +0000 libpmcstat: fix pmcstat -G on older-ish -CURRENT w/ drm-kmod The linuxkpi_gplv2.ko module on older-ish -CURRENT had absolutely no .text contents, but it was still loaded. Instead of hitting the later assertion because 0 is not less than 0, we can just skip images like this as we should not have any samples from them. Reviewed by: gallatin (cherry picked from commit 77721403c91d67dbfd5a2c5c667e7f5d87acb3f6) --- lib/libpmcstat/libpmcstat_image.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libpmcstat/libpmcstat_image.c b/lib/libpmcstat/libpmcstat_image.c index f8f76bfc148b..f61e22cc21e3 100644 --- a/lib/libpmcstat/libpmcstat_image.c +++ b/lib/libpmcstat/libpmcstat_image.c @@ -194,6 +194,14 @@ pmcstat_image_link(struct pmcstat_process *pp, struct pmcstat_image *image, assert(image->pi_type != PMCSTAT_IMAGE_UNKNOWN && image->pi_type != PMCSTAT_IMAGE_INDETERMINABLE); + /* + * It's possible to have images with nothing of value in .text + * legitimately. We shouldn't have any samples from this image, so + * don't bother with a map entry either. + */ + if (image->pi_start == 0 && image->pi_end == 0) + return; + if ((pcmnew = malloc(sizeof(*pcmnew))) == NULL) err(EX_OSERR, "ERROR: Cannot create a map entry");