From nobody Sun Aug 9 22:57:29 2026 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 4hJCvY3Zk3z6pDNT for ; Sun, 09 Aug 2026 22:57:29 +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 4hJCvY2hppz3WT0 for ; Sun, 09 Aug 2026 22:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786316249; 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=mmv8DuyrG6nMbxBuNr+Ssf94uAKGdxn6Q950oq+btN+H659fNIT+BhS0gyFBxch9Tm1VK9 jwX2BzS6Bf3LvezwFvxEKp5nbRN4QC+i1qtokUa6mInDUIOpOOB/eVmm/w8Wy/N4mjsx6H VlAceycR56/VjZA2Z7w4FNXQv+EH02r58cPhNJDB4vrdj8IJ0KD7WFNSZwYJY1hUMFJ/Ns 03g590u98AouVRR/HgETJlWw3GycsM1M3joepTpkP2dlerzqJZ8rAnPH8fLfjYnkZW2Z2C mUgK9bSjDQdTkTzflyN1WQ0WVpEh+dwdpufq7XttVvN99OKkNuG5buJfEKyPJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786316249; a=rsa-sha256; cv=none; b=iQhH2w5Mwr+JxZK4vFpBRKoZXloYmSAO683wuEuyJ1f8vTjvSrdQIIv4CTFVOkr/SIZPql QgLF4aA5AmDDSD25Usl33ORnw4181Exsi2mfEiyB8Bzx3caz7D7D7b0ugVxaIncKibdhQD S3G8Fi+mkUqOk3cJyhN3FdZqXslsWThtTJssYNulQOQbsD8ttCI9aBO+wYz5Do35jXsDdm 1BmR4a+6pM1yVABFhcKnbBGkaUJ5b6bpHk49Py1mevGKdWEpiOW6e06mUfmFhCdwDyNpJW i8VSplH9i/6ZuL2ZYNvLAyWGMyyrveQ+/SkZvseVKpYpVGLI/i7H7TI1bqVPBw== 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=1786316249; 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=W6vZNZHbug9Vt2u92BGmNeiNIJgWZ9lV9HIE3OWY6O3N8mgibb7bD9bMeG0PQW2TRNvzV3 lxxvDvzo+5Xgkv2zbyqQv9ErgJQJ1WzuPkYydDvIibN6Ojr0qta9NY9UwvcEVLmrAQz02g iccDwanv4FVVhJrblLTgDjC2yKzSLHQ7uSUK7E63faiFus0syJlsJT8cINgcC4K4yiFQIa Ey6WdnQrw68x79l6E+PuQrlUWqdDeU8SOGQGZrLfVUFUgpCMowgng7P33cvBaAeoP4mFAL babUwUBEWmEL80iSIwidMhUlOMkSUoyG3x0WuXJLcFk4YwXhmZ6hq6BxvxL6aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hJCvY1Tq5zk69 for ; Sun, 09 Aug 2026 22:57:29 +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 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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);