From nobody Sun Jul 24 11:02:19 2022 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 4LrKy416Llz4XXRj; Sun, 24 Jul 2022 11:02:20 +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 4LrKy36GDLz3chy; Sun, 24 Jul 2022 11:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658660539; 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=Ru1KJR0tbM3ugWnyN+JXM1Ks1q3vH0x0ZbrbDWyBYuQ=; b=nTLXJCtjZHV8qIfrTItGsc/+JHS6bi2XpIR4dY5N7AZRaY5dJNDBHivCkXM9hPsRjdSQ4E /cqB+9V0h+ya9Ki4sIR9v1NBm15v40P4nP7l5jB7qrFwkthIAQsBkTkr/3ELkzIUATN6Q4 rfsgfYnH1a9bWePo3jhMKhqCswpGTZyxAiFBgdrCYo/oOT7j7+FKPXboMoDdaVAEouc7rG nMpbE53377gM4Q4kUNFbqWrczQDXMUtrAQKtC3SkP3AgI6iYA9JfhWk1rWBQzHwOiPd8fW qjZLFs5ti0D8NhH+O5O9eCljh13XvSJavrgyLOrqUzgHhH6qNV4kKbUyHUfSpQ== 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 4LrKy350stzGm8; Sun, 24 Jul 2022 11:02:19 +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 26OB2JOR041386; Sun, 24 Jul 2022 11:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26OB2JOl041385; Sun, 24 Jul 2022 11:02:19 GMT (envelope-from git) Date: Sun, 24 Jul 2022 11:02:19 GMT Message-Id: <202207241102.26OB2JOl041385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: c7f584db172e - stable/12 - Fix unused variable warnings in hwpmc_mod.c 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c7f584db172e65d81ee59d9b36933799719f12bf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658660539; 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=Ru1KJR0tbM3ugWnyN+JXM1Ks1q3vH0x0ZbrbDWyBYuQ=; b=Qm3yhcpOsAxqEQaAWkUsq+xqNj9HJFYWEbk3LU9Uq9Fw5QovKWe3By32uumx1ig2kkJ12S TeiL+OBAD+YNHUdk4Cd8dJ0ZImlStD9HDCZJYro9fV1LjJF8DGqQVL6CgC8IjQs6jjAaco U6lN/jwsvUE4izdjIFpI/cB7Jc+mApVYJIL/ieiOLhWECuCui8RAwlh4uIqDMt80Ov2L5l OTF63keNBbEei6cSSHW/NMPIxxhxmx+h5WHkmndnmesC06S0//xpVw6BxPCLjs8GhZweHf adfEaF6O2aE18l3kHZ+NXulY3/2oE4uctR3xn1Tt0q69eO/jdPsCsvtG0L9kyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658660539; a=rsa-sha256; cv=none; b=tKllyL40hhwVdMNkcZZq3XfP4Crrg9fxAAgAswZPE33YdTiaaeRXbMc6t7j7O36pAWfXwU LCGwyNp2zsnzKIOsQ128/s/LDC1uRTwHnnv7TFujqslDG/F8AavG7XA9Sg8z/QspdYmaTi AoYuoOtOmmG7IKx8slrN18fx0T8Qe4i+HuWLWAqWhAMW8q7YFej2c/vGRaJt6qty0ZJMoE I8aR6Enir7oJ5cudEWHGWDAcIRg9RzWiOZNrRt6c3EG5RBGRoJoMcJ+tC6O/w2+VHNGv1S kwBt1lUFxPTES3krGU5mKf3dXFg2U5ZKeOONYm1nOa9n1qDDc/5s5zP9CuMopg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f584db172e65d81ee59d9b36933799719f12bf commit c7f584db172e65d81ee59d9b36933799719f12bf Author: Dimitry Andric AuthorDate: 2022-07-21 18:35:41 +0000 Commit: Dimitry Andric CommitDate: 2022-07-24 11:01:19 +0000 Fix unused variable warnings in hwpmc_mod.c With clang 15, the following -Werror warnings are produced: sys/dev/hwpmc/hwpmc_mod.c:4805:6: error: variable 'nfree' set but not used [-Werror,-Wunused-but-set-variable] int nfree; ^ sys/dev/hwpmc/hwpmc_mod.c:4804:6: error: variable 'ncallchains' set but not used [-Werror,-Wunused-but-set-variable] int ncallchains; ^ The 'nfree' and 'ncallchains' variables were used in KASSERTs, but these were removed due to refactoring in d9f1b8dbf29d. Remove the variables since they no longer serve any purpose. MFC after: 3 days (cherry picked from commit 38a9b8a00ce933e99b4a643cdcc3220be82e7d62) --- sys/dev/hwpmc/hwpmc_mod.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 2f75745c70b1..43c8e96d23b1 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -4787,8 +4787,6 @@ pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf) uint64_t considx, prodidx; int nsamples, nrecords, pass, iter; #ifdef INVARIANTS - int ncallchains; - int nfree; int start_ticks = ticks; #endif psb = pmc_pcpu[cpu]->pc_sb[ring]; @@ -4798,10 +4796,6 @@ pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf) ("[pmc,%d] Retrieving callchain for thread that doesn't want it", __LINE__)); -#ifdef INVARIANTS - ncallchains = 0; - nfree = 0; -#endif nrecords = INT_MAX; pass = 0; restart: @@ -4820,13 +4814,8 @@ pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf) #ifdef INVARIANTS if (ps->ps_nsamples == PMC_SAMPLE_FREE) { - nfree++; continue; } - - if ((ps->ps_pmc == NULL) || - (ps->ps_pmc->pm_state != PMC_STATE_RUNNING)) - nfree++; #endif if (ps->ps_td != td || ps->ps_nsamples != PMC_USER_CALLCHAIN_PENDING || @@ -4857,10 +4846,6 @@ pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf) * as 'processable' by the timer tick sweep code. */ -#ifdef INVARIANTS - ncallchains++; -#endif - if (__predict_true(nsamples < pmc_callchaindepth - 1)) nsamples += pmc_save_user_callchain(ps->ps_pc + nsamples, pmc_callchaindepth - nsamples - 1, tf);