From nobody Sun Aug 9 22:57:29 2026 X-Original-To: dev-commits-src-all@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 4hJCvf6G54z6pDkG for ; Sun, 09 Aug 2026 22:57:34 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hJCvf5HKJz3WTl for ; Sun, 09 Aug 2026 22:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786316254; 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=IO2JIALkEtEMGTrgmHZNbuImRoD0S8yciqBdGof0MpU=; b=I4xZCG/SlNkzBp9ydildZLkbgx4tUjyDqu8DdT/3t2coMKY1rh/51sryfulBCZoCTrA68L qT/o6Uep16JRZ6rXwqiI82btLk2ITfeP5AZsoXlkjuNoUPAyPRBD8odw8D9DQCeaU1VF0C YVu4iVVRx2nW5kfpiryQYcHStza2e75mCdOyibgHWPjQ4c4L1FODZojiQj/woWV+6gkazV XM7HbKF4l7vhoIWqAKo++RgcKjCX5Z5x893wkOqo398LPGIre9A18pC5tx+/zdK8mCjg3/ iPcdIYyQo54CED22W7+iUI2DzRQPjwYxJajYy+9QAC/ezyjhvDdFAknujTwDqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786316254; a=rsa-sha256; cv=none; b=vKMSKKwNwZw66OPN5tqm8KulF6b/zasysqoFPm/ZvkfAnWl4ZCBpAakF+pypXKZ6uQdLAS 3kZ7lBYZ0UA7wS7q/pIznMLQ/c63mMyQ2oRRw/CSxekHL0ZoLxFl1gNesdAW5oTyMGXh/W 6XmlSoCoBANZ58+2QfRP1KoMPjQtk03Wv4py09gFatCMB1MukHQa1Fut7GMg6ThHzbG4gH P6mHp55sq9D0Hr70Pa2ePEo2MSsUblkyZ3SGtZENE9v4+ynMaqXFs4DQhtcCZI431qhkOF CGqqJkDIOfcWQSqTrIiRqTxlHAUgSYwRZsmcqsZAapDquBK5pbaauPTYhoS0wQ== 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=1786316254; 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=IO2JIALkEtEMGTrgmHZNbuImRoD0S8yciqBdGof0MpU=; b=BHxoP6QF5aO5iD0WhB/RprfCrQl6rtmgz73YqsLnmJyJ8/nv3zaplGcSShYq373ISm5jQ/ Zh+vbsjyWrxtIc8Mpmi1mbiAELLpqD1EpS0/ucYZD8S2zQ3LMWiUbevoLQVdOlPe2Vjwk/ I/yp15gKIfaTwCuh5S8JWnaMI3JCkhq/Ri+ynRI39LwsnIHCSPvlgEAuvhgbOB0dPPlZ3u DvEMYGe1Go5btI06CSIDF4mN6bHHs3l2LLSd8ALdRlSkN5lBXKN75L3Ef6ZqLS/mAa8RLU HePLARykWoRDERDoi6uRTH5NCyEqtUtAd/aIVa8sL4L0FIiGIjtdjusctDKT1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hJCvf3brDzk6B for ; Sun, 09 Aug 2026 22:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 388a2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 09 Aug 2026 22:57:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: fd809148cafd - main - pmc(8): resolve -Wshadow issues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.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 X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd809148cafd880aedb4e9db101742f7b1de4317 Auto-Submitted: auto-generated Date: Sun, 09 Aug 2026 22:57:29 +0000 Message-Id: <6a7905d9.388a2.46347549@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=fd809148cafd880aedb4e9db101742f7b1de4317 commit fd809148cafd880aedb4e9db101742f7b1de4317 Author: Enji Cooper AuthorDate: 2026-08-09 22:45:11 +0000 Commit: Enji Cooper CommitDate: 2026-08-09 22:56:50 +0000 pmc(8): resolve -Wshadow issues - Prefix all structs with the struct keyword to avoid collisions between the types and variables with the same "name". - Use `_` suffixed variables in initializers to distinguish input parameters from public members [1]. Resolve some trailing whitespace issues while here. NOTE: this doesn't resolve the -pedantic issue reported by g++ with `pmchdr_cpuidinfo::cpuid` about the field being a flexible array in an otherwise empty struct. 1. I generally do this the other way around, i.e., suffix private/protected members with `_`, but these are public members in structs and I don't want to introduce a lot of churn in calling code. Reported by: g++14 with FreeBSD CI (powerpc64 tinderbox) Fixes: ce6ab51f ("pmc: enable the new pmc commands") --- usr.sbin/pmc/view.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/pmc/view.hh b/usr.sbin/pmc/view.hh index 062325b096dc..46b7c49222f0 100644 --- a/usr.sbin/pmc/view.hh +++ b/usr.sbin/pmc/view.hh @@ -65,13 +65,13 @@ struct pmcinfo }; /* - * Extended pmcinfo structure stores the complete event description passed to + * Extended pmcinfo structure stores the complete event description passed to * libpmc. */ struct pmcinfox { pmcinfox() : rate(0), event() { } - pmcinfox(uint32_t rate, std::string event) : rate(rate), event(event) { } + pmcinfox(uint32_t rate_, std::string &event_) : rate(rate_), event(event_) { } ~pmcinfox() { } uint32_t rate; std::string event; @@ -103,7 +103,7 @@ struct vmmap struct threadinfo { threadinfo() : name("") { } - threadinfo(const std::string &name) : name(name) { } + threadinfo(const std::string &name_) : name(name_) { } ~threadinfo() { } std::string name; }; @@ -197,7 +197,7 @@ struct pmcfilter std::unordered_set events; cpuset_t cpus; /* - * Advanced filters for AMD IBS but should be generalized to support + * Advanced filters for AMD IBS but should be generalized to support * other processors. */ uint64_t ibs_ldlat; @@ -388,8 +388,8 @@ protected: // Fields available to views uint64_t tscfreq; std::unordered_map pmcid; - std::unordered_map pmcinfo; - std::unordered_map procs; + std::unordered_map pmcinfo; + std::unordered_map procs; std::unordered_map tidtopid; std::unordered_map images; std::string sysroot; @@ -399,8 +399,8 @@ protected: std::string cpumodel; std::string osrelease; std::string buildid; - std::vector extpmcinfo; - std::map cpuid; // x86 Only + std::vector extpmcinfo; + std::map cpuid; // x86 Only private: image loadimage(const std::string &path); void mapimage(pid_t pid, const image &im, uint64_t linkaddr);