From nobody Mon Dec 02 19:39:04 2024 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 4Y2DcS61tyz5gKKX; Mon, 02 Dec 2024 19:39:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y2DcS5Rpjz4p7h; Mon, 2 Dec 2024 19:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733168344; 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=08m2JzxIlAZyJMNgFGE6GRw8E3mTe+RFywcQ5ain2Ao=; b=d+LwjpwTI21IiRVIGE4HoPLmb4IsSYO7k+MwfU5OVy7eUUpZQb5TLSr7kim/LQagto+xwd +HDdSZ6KjbLx+Yf1zb/OS/Zf771kxkJp7Nz3wwZ3gVZvGzBLJdNPatlMuYWOlK5DLZQkEB jDnCdcPQ9jToCs7nwgZmB6lyCHFnUTF39A2nhRZMCKxtOZ5lQMEPh/r4cXi5p/uS6vCiUI 2KscAB47wQUslv/uHJVywbzb08/gWrywjotlw5U8rWRgJDudciRYcVlSlitp44QQ+j00AU oc7FrbWJbRyJaGVLqBNYGyejl4CmXiZycIr2VQuiSSWVRYddfXfE2uF2bhdBSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733168344; 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=08m2JzxIlAZyJMNgFGE6GRw8E3mTe+RFywcQ5ain2Ao=; b=DR0pNf5WvJ8W+6SYpDKT51ohp3MnnHZQdUi9lsBPBv2xnlILsvBIg4Gv7eQzJJMz5DFQh0 Wkwwjgd45Y0bJ4oulQeXcjIV6hAZqZgNiYcmxmS/29hkBtS+VtIPJqjO6TiV0yNg/ESn2q ot07uDHl3gz5dut2IaNRygbaDYcCsyg8Vo5nAkNGVtUGWzLTFiEruokbPRQm0UxHbEjjqN MW+QLXdG1UKv/ON8RiolAvYyDKnX3ALbmkhzUrrcO3IzmWy+LCIWFRMMLZEpNrXSFu9Zeq x4dG3yKnb8s06ssY0RO5N5SpipcIh81JPA/Bv3oNgQKF1LgSc4PqSt7S0BP15Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733168344; a=rsa-sha256; cv=none; b=yKN+3T+v5tPzQ4SVdHtcu2q3LfvSksQti9AHGRr/Ac1Vfv+cZjpEQ5IcgB5V5lYEzwECUw a5QL+gRPxNZP48bVwyAcuOMdv7SdKBXqvUX1msLCMeP6mH+Mv8dHFGmZUY6ILA2yo95RhT uLxDhhXhMDIjDvLXp/3KoMUjdrcwu3hsmQUWB20C257qVsh9yxKjKYgb54Poc8PvKo6Eam qPGAxtZ8uMcuivah/YeGlZJGWfT15KIuJplYQn/48IlFjr+LVZPZbiJaMw44eUlvamql1U 4vKTEJa4LdIEQUsa3ct/ll5AZEmeW5Yf29RdYI/tXdblDcAHNkEKTmrhwXxQew== 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 4Y2DcS4tfCzr4D; Mon, 2 Dec 2024 19:39:04 +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 4B2Jd4Uf025023; Mon, 2 Dec 2024 19:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B2Jd4r7025020; Mon, 2 Dec 2024 19:39:04 GMT (envelope-from git) Date: Mon, 2 Dec 2024 19:39:04 GMT Message-Id: <202412021939.4B2Jd4r7025020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 928864a93594 - main - fix build with LOCK_PROFILING but without KDTRACE_HOOKS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 928864a93594eddbf5bf67310bb0f5c684350dc6 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=928864a93594eddbf5bf67310bb0f5c684350dc6 commit 928864a93594eddbf5bf67310bb0f5c684350dc6 Author: Kristof Provost AuthorDate: 2024-11-27 17:06:41 +0000 Commit: Kristof Provost CommitDate: 2024-12-02 19:36:35 +0000 fix build with LOCK_PROFILING but without KDTRACE_HOOKS Reviewed by: kib, markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D47822 --- sys/kern/kern_rwlock.c | 10 ++++------ sys/kern/kern_sx.c | 10 +++------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 3286fce76d96..03d59d613e74 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -461,9 +461,9 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + uintptr_t state = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state = 0; int doing_lockprof = 0; #endif @@ -473,12 +473,11 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v goto out_lockstat; doing_lockprof = 1; all_time -= lockstat_nsecs(&rw->lock_object); - state = v; } + state = v; #endif #ifdef LOCK_PROFILING doing_lockprof = 1; - state = v; #endif if (SCHEDULER_STOPPED()) @@ -936,9 +935,9 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOCK_FILE_LINE_ARG_DEF) u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + uintptr_t state = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state = 0; int doing_lockprof = 0; #endif int extra_work = 0; @@ -955,13 +954,12 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOCK_FILE_LINE_ARG_DEF) extra_work = 1; doing_lockprof = 1; all_time -= lockstat_nsecs(&rw->lock_object); - state = v; } + state = v; #endif #ifdef LOCK_PROFILING extra_work = 1; doing_lockprof = 1; - state = v; #endif if (SCHEDULER_STOPPED()) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 4cc8ac8ce106..952cfae7c977 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -582,9 +582,9 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF) u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + uintptr_t state = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state = 0; int doing_lockprof = 0; #endif int extra_work = 0; @@ -600,13 +600,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF) extra_work = 1; doing_lockprof = 1; all_time -= lockstat_nsecs(&sx->lock_object); - state = x; } + state = x; #endif #ifdef LOCK_PROFILING extra_work = 1; doing_lockprof = 1; - state = x; #endif if (SCHEDULER_STOPPED()) @@ -1034,8 +1033,6 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LOCK_FILE_LINE_ARG_DEF) u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; -#endif -#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state = 0; #endif int extra_work __sdt_used = 0; @@ -1048,12 +1045,11 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LOCK_FILE_LINE_ARG_DEF) goto out_lockstat; extra_work = 1; all_time -= lockstat_nsecs(&sx->lock_object); - state = x; } + state = x; #endif #ifdef LOCK_PROFILING extra_work = 1; - state = x; #endif if (SCHEDULER_STOPPED())