Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys kern: New struct syncobj::sobj_name member for diagnostics.



details:   https://anonhg.NetBSD.org/src/rev/3aecf837b5e5
branches:  trunk
changeset: 377554:3aecf837b5e5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Jul 17 12:54:29 2023 +0000

description:
kern: New struct syncobj::sobj_name member for diagnostics.

XXX potential kernel ABI change -- not sure any modules actually use
struct syncobj but it's hard to rule that out because sys/syncobj.h
leaks into sys/lwp.h

diffstat:

 sys/kern/kern_condvar.c |  5 +++--
 sys/kern/kern_mutex.c   |  5 +++--
 sys/kern/kern_rwlock.c  |  5 +++--
 sys/kern/kern_synch.c   |  7 +++++--
 sys/kern/sys_lwp.c      |  5 +++--
 sys/kern/sys_select.c   |  5 +++--
 sys/sys/syncobj.h       |  3 ++-
 7 files changed, 22 insertions(+), 13 deletions(-)

diffs (189 lines):

diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/kern/kern_condvar.c
--- a/sys/kern/kern_condvar.c   Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/kern/kern_condvar.c   Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_condvar.c,v 1.54 2022/06/29 22:27:01 riastradh Exp $      */
+/*     $NetBSD: kern_condvar.c,v 1.55 2023/07/17 12:54:29 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.54 2022/06/29 22:27:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.55 2023/07/17 12:54:29 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -70,6 +70,7 @@ static inline void    cv_wakeup_one(kcondva
 static inline void     cv_wakeup_all(kcondvar_t *);
 
 syncobj_t cv_syncobj = {
+       .sobj_name      = "cv",
        .sobj_flag      = SOBJ_SLEEPQ_SORTED,
        .sobj_unsleep   = cv_unsleep,
        .sobj_changepri = sleepq_changepri,
diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/kern/kern_mutex.c
--- a/sys/kern/kern_mutex.c     Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/kern/kern_mutex.c     Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_mutex.c,v 1.107 2023/05/01 12:18:08 riastradh Exp $       */
+/*     $NetBSD: kern_mutex.c,v 1.108 2023/07/17 12:54:29 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define        __MUTEX_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.107 2023/05/01 12:18:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.108 2023/07/17 12:54:29 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -296,6 +296,7 @@ lockops_t mutex_adaptive_lockops = {
 };
 
 syncobj_t mutex_syncobj = {
+       .sobj_name      = "mutex",
        .sobj_flag      = SOBJ_SLEEPQ_SORTED,
        .sobj_unsleep   = turnstile_unsleep,
        .sobj_changepri = turnstile_changepri,
diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/kern/kern_rwlock.c
--- a/sys/kern/kern_rwlock.c    Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/kern/kern_rwlock.c    Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_rwlock.c,v 1.70 2023/02/24 11:11:10 riastradh Exp $       */
+/*     $NetBSD: kern_rwlock.c,v 1.71 2023/07/17 12:54:29 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019, 2020
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.70 2023/02/24 11:11:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.71 2023/07/17 12:54:29 riastradh Exp $");
 
 #include "opt_lockdebug.h"
 
@@ -121,6 +121,7 @@ lockops_t rwlock_lockops = {
 };
 
 syncobj_t rw_syncobj = {
+       .sobj_name      = "rw",
        .sobj_flag      = SOBJ_SLEEPQ_SORTED,
        .sobj_unsleep   = turnstile_unsleep,
        .sobj_changepri = turnstile_changepri,
diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/kern/kern_synch.c     Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.357 2023/07/13 13:33:55 riastradh Exp $       */
+/*     $NetBSD: kern_synch.c,v 1.358 2023/07/17 12:54:29 riastradh Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.357 2023/07/13 13:33:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.358 2023/07/17 12:54:29 riastradh Exp $");
 
 #include "opt_kstack.h"
 #include "opt_ddb.h"
@@ -113,6 +113,7 @@ static void sched_changepri(struct lwp *
 static void    sched_lendpri(struct lwp *, pri_t);
 
 syncobj_t sleep_syncobj = {
+       .sobj_name      = "sleep",
        .sobj_flag      = SOBJ_SLEEPQ_SORTED,
        .sobj_unsleep   = sleepq_unsleep,
        .sobj_changepri = sleepq_changepri,
@@ -121,6 +122,7 @@ syncobj_t sleep_syncobj = {
 };
 
 syncobj_t sched_syncobj = {
+       .sobj_name      = "sched",
        .sobj_flag      = SOBJ_SLEEPQ_SORTED,
        .sobj_unsleep   = sched_unsleep,
        .sobj_changepri = sched_changepri,
@@ -129,6 +131,7 @@ syncobj_t sched_syncobj = {
 };
 
 syncobj_t kpause_syncobj = {
+       .sobj_name      = "kpause",
        .sobj_flag      = SOBJ_SLEEPQ_NULL,
        .sobj_unsleep   = sleepq_unsleep,
        .sobj_changepri = sleepq_changepri,
diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/kern/sys_lwp.c
--- a/sys/kern/sys_lwp.c        Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/kern/sys_lwp.c        Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_lwp.c,v 1.83 2022/06/29 22:27:01 riastradh Exp $   */
+/*     $NetBSD: sys_lwp.c,v 1.84 2023/07/17 12:54:29 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.83 2022/06/29 22:27:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.84 2023/07/17 12:54:29 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -58,6 +58,7 @@
 static const stack_t lwp_ss_init = SS_INIT;
 
 syncobj_t lwp_park_syncobj = {
+       .sobj_name      = "lwp_park",
        .sobj_flag      = SOBJ_SLEEPQ_NULL,
        .sobj_unsleep   = sleepq_unsleep,
        .sobj_changepri = sleepq_changepri,
diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/kern/sys_select.c
--- a/sys/kern/sys_select.c     Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/kern/sys_select.c     Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_select.c,v 1.60 2022/06/29 22:27:01 riastradh Exp $        */
+/*     $NetBSD: sys_select.c,v 1.61 2023/07/17 12:54:29 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2019, 2020 The NetBSD Foundation, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.60 2022/06/29 22:27:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.61 2023/07/17 12:54:29 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -143,6 +143,7 @@ static const int sel_flag[] = {
  * enqueue LWPs at all, unless subject to a collision.
  */
 syncobj_t select_sobj = {
+       .sobj_name      = "select",
        .sobj_flag      = SOBJ_SLEEPQ_LIFO,
        .sobj_unsleep   = sleepq_unsleep,
        .sobj_changepri = sleepq_changepri,
diff -r cb2de9b218f8 -r 3aecf837b5e5 sys/sys/syncobj.h
--- a/sys/sys/syncobj.h Mon Jul 17 10:55:27 2023 +0000
+++ b/sys/sys/syncobj.h Mon Jul 17 12:54:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syncobj.h,v 1.13 2020/03/26 21:15:14 ad Exp $  */
+/*     $NetBSD: syncobj.h,v 1.14 2023/07/17 12:54:29 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@ typedef volatile const void *wchan_t;
  * Synchronisation object operations set.
  */
 typedef struct syncobj {
+       char    sobj_name[16];
        u_int   sobj_flag;
        void    (*sobj_unsleep)(struct lwp *, bool);
        void    (*sobj_changepri)(struct lwp *, pri_t);



Home | Main Index | Thread Index | Old Index