From nobody Thu Jul 21 19:06:07 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 4Lphqh1CN5z4XJhb; Thu, 21 Jul 2022 19:06:08 +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 4Lphqh0b82z3Vq5; Thu, 21 Jul 2022 19:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658430368; 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=AE+E6D9CX+sW4eihiCGMWrCl+TTwTQ+iCrkePYRRfXs=; b=FSQF84kqmeLzFwT/Jc69XXbtMro+HPROOXE4Rd/VIvdmEpiYAPWJMZfgs70J6HAuEIUmpu qcMGyYQkYMrK7YiKAumsGa9mAPmWqGY59Hq8bSiI9wNxzCrCfZu12VUYhj7z/vwZVCQ6J1 DNs87Tuzc5yXyNwjsr2YZHfzt7jo2atQc4fHMz6tTdU6FMOp5hPli7j+woZHPKnqFcVism rCevb6/YORz7nlST7q++X02fiTv9jDF5TTTRqrNPYFLzvfGlcxpPJa6YWHFFJN3r5Ka/ZY 8YmnAbWoWM6GLkUT3Ad8GhBGvHKBxknlJiFAN3Hrp9JdU4l0/x+EDYblNq6DbQ== 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 4Lphqg6cpBzY8Q; Thu, 21 Jul 2022 19:06:07 +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 26LJ67Iu038116; Thu, 21 Jul 2022 19:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26LJ675q038114; Thu, 21 Jul 2022 19:06:07 GMT (envelope-from git) Date: Thu, 21 Jul 2022 19:06:07 GMT Message-Id: <202207211906.26LJ675q038114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 38a9b8a00ce9 - main - Fix unused variable warnings in hwpmc_mod.c 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38a9b8a00ce933e99b4a643cdcc3220be82e7d62 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658430368; 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=AE+E6D9CX+sW4eihiCGMWrCl+TTwTQ+iCrkePYRRfXs=; b=tE4yhTMN7pkPC7VLCq6U12Nwq0V3nfe5fdZRohW3uYq8LJVSNGWicvVUxXfyNYEROBW6hK FoP0KDswdgh2YyZvt5GhZ0Ajn4tW83K3TEWlwb63SKP/9bn2anxh0nYzizupjxMg+rhtaF wHxBn5RSljgenOAhganUaedixp+J9OzAfEZf/m04547iYO4I8GMPv1XqewBmHIkW2+Rng8 9jrsCfH4OV87xsje11uPY6mzq31b7a+NT4PfO2CARZcBHtv+/1ba0KiDcD2JBo6wGN+5g8 kY5LWoWXmAvDCpFrud0V58I+iDEd8Gihb1IAaxoGX0PcYFRpojXQbpKtZVZFUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658430368; a=rsa-sha256; cv=none; b=EbGZu+7jsqJF2pFp+9/qahgcffOfraZuQKG5GYwJh44kRNn6j1RvW0nZMTQeJEmojdMgDt 8fznr+ouxjrd/hWBOjSPq5QcGnyYS6GCUP3LW+pN2FGDCXknffWgDr0pxoOQlZGmm6mZNH C7MHrGm7nGE7fQEY1WHZTPpTdj9EjqDziWv06AWamF6I5zs+pyeVkyInLVM7jURo3cQxbn kWS1ZqF3dEiEcF0FbB+fOltfP87rBnp4KDoEvwIGdeTRcuzWq29bcLAi2n5d5DVtIOiafd rLknxZGyx/5lXAEAv92Wkauqy22Si7bf9dt6JlJ7nlxWoyRJXJg61Jd+54HuLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=38a9b8a00ce933e99b4a643cdcc3220be82e7d62 commit 38a9b8a00ce933e99b4a643cdcc3220be82e7d62 Author: Dimitry Andric AuthorDate: 2022-07-21 18:35:41 +0000 Commit: Dimitry Andric CommitDate: 2022-07-21 19:05:51 +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 --- 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 308b0bdff1bb..e5a12b666e1b 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -4801,8 +4801,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]; @@ -4812,10 +4810,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: @@ -4834,13 +4828,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 || @@ -4871,10 +4860,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);