History log of /netbsd-src/sys/kern/subr_lockdebug.c (Results 1 – 25 of 82)
Revision Date Author Comments
# e8f73aae 02-Sep-2022 nakayama <nakayama@NetBSD.org>

Fix "error: cast from pointer to integer of different size" on
sparc build.


# 1bfc2d5f 31-Aug-2022 msaitoh <msaitoh@NetBSD.org>

Fix previous to make it compile again.


# 4707b092 30-Aug-2022 riastradh <riastradh@NetBSD.org>

lockdebug(9): Try to show symbol names if possible.

Also print the possible owner in ddb/crash `show lock' even if the
kernel is built without LOCKDEBUG.

Output may not be as pretty before with two

lockdebug(9): Try to show symbol names if possible.

Also print the possible owner in ddb/crash `show lock' even if the
kernel is built without LOCKDEBUG.

Output may not be as pretty before with two neatly aligned columns,
but that can be changed; for now the value of having the symbols
printed instead of just obscure hex addresses (which one's an lwp
address and which one's a code pointer? can never remember!) should
outweigh the prettiness temporarily lost.

show more ...


# d6068b83 02-Mar-2021 rin <rin@NetBSD.org>

KNF. No binary changes.


# f7a71118 01-Jan-2021 riastradh <riastradh@NetBSD.org>

Use printf, not printf_nolog, in lockdebug dumps.

Otherwise we get no diagnostic information in crash dumps or dmesg,
which really puts a damper on the utility of lockdebug.

(If there's a reason fo

Use printf, not printf_nolog, in lockdebug dumps.

Otherwise we get no diagnostic information in crash dumps or dmesg,
which really puts a damper on the utility of lockdebug.

(If there's a reason for printf_nolog instead of printf, it should be
documented in comments here, and it had better be a pretty good
reason for destroying the diagnostic information that is half the
point of lockdebug.)

show more ...


# ecec2927 01-Jan-2021 riastradh <riastradh@NetBSD.org>

Nix trailing whitespace.


# 69ffbd32 15-May-2020 maxv <maxv@NetBSD.org>

Introduce kcov_silence_enter() and kcov_silence_leave(), to allow to
temporarily disable KCOV on the current lwp. Should be used in the rare
but problematic cases where extreme noise is introduced by

Introduce kcov_silence_enter() and kcov_silence_leave(), to allow to
temporarily disable KCOV on the current lwp. Should be used in the rare
but problematic cases where extreme noise is introduced by an
uninteresting subsystem.

Use this capability to silence KCOV during the LOCKDEBUG lookups. This
divides the size of the KCOV output by more than two in my KCOV+vHCI
tests.

show more ...


# e0bb7e8e 10-Apr-2020 ad <ad@NetBSD.org>

- Make this needed sequence always work for condvars, by not touching the CV
again after wakeup. Previously it could panic because cv_signal() could
be called by cv_wait_sig() + others:

cv_bro

- Make this needed sequence always work for condvars, by not touching the CV
again after wakeup. Previously it could panic because cv_signal() could
be called by cv_wait_sig() + others:

cv_broadcast(cv);
cv_destroy(cv);

- In support of the above, if an LWP doing a timed wait is awoken by
cv_broadcast() or cv_signal(), don't return an error if the timer
fires after the fact, i.e. either succeed or fail, not both.

- Remove LOCKDEBUG code for CVs which never worked properly and is of
questionable use.

show more ...


# ffdb4a83 09-Mar-2020 christos <christos@NetBSD.org>

comment out enough stuff to allow crash to print locks.


# a4da18db 21-Jan-2020 ad <ad@NetBSD.org>

ddb's "show all locks":

- Make the output easier to scan quickly.

- Show every LWP that is blocked on a lock, and the details of the lock.


# 41a8f863 08-Jan-2020 ad <ad@NetBSD.org>

lockdebug_barrier(): allow the one permitted lock to be a sleep lock too.


# 099a5e1d 28-May-2019 ryo <ryo@NetBSD.org>

changes of r1.68 was reverted by r1.69. apply it again.


# c717d9c1 22-May-2019 scole <scole@NetBSD.org>

Increase LD_BATCH_SHIFT for ia64 LOCKDEBUG kernels. Otherwise, ia64 pmap will run out of space with this kernel debug option enabled.

Discussed with <chs> over email.


# 00cd510a 09-May-2019 ozaki-r <ozaki-r@NetBSD.org>

Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb

Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb:

db{0}> show all locks/t
[Locks tracked through LWPs]
Locks held by an LWP (iperf):
Lock 0 (initialized at soinit)
lock address : 0xffffedeb84b06080 type : sleep/adaptive
initialized : 0xffffffff806d8c3f
shared holds : 0 exclusive: 1
shares wanted: 0 exclusive: 11
current cpu : 0 last held: 1
current lwp : 0xffffedeb849ff040 last held: 0xffffedeb7dfdb240
last locked* : 0xffffffff806d8335 unlocked : 0xffffffff806d8385
[ 79103.0868574] owner field : 0xffffedeb7dfdb240 wait/spin: 1/0

Fix it by passing a printer function to lo_dump functions, i.e., make the
functions use db_printf on ddb.

show more ...


# fab43db2 03-Nov-2018 christos <christos@NetBSD.org>

Deduplicate debug printing code.


# 4f6cb4fe 25-Oct-2018 mrg <mrg@NetBSD.org>

in the !MP world, ci->ci_curlwp may not exist. just use curlwp.

XXX: can we just do this for MP builds, too? i think so.


# 60b1eff4 13-Sep-2018 mrg <mrg@NetBSD.org>

always call lockdebug_dismiss() from DDB -- there are always some
minimal lockdebug checks in place, even without LOCKDEBUG.

adjust lockdebug_abort() to ignore problems after ld_panic is set
so that

always call lockdebug_dismiss() from DDB -- there are always some
minimal lockdebug checks in place, even without LOCKDEBUG.

adjust lockdebug_abort() to ignore problems after ld_panic is set
so that there's a chance of this working.

this fixes ddb 'reboot' on softiron od1000.

show more ...


# d1579b2d 03-Sep-2018 riastradh <riastradh@NetBSD.org>

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a n

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)

show more ...


# 0b3a7eb1 12-Aug-2018 mrg <mrg@NetBSD.org>

add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts. use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mu

add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts. use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.

show more ...


# d52b83d7 19-Mar-2018 ozaki-r <ozaki-r@NetBSD.org>

ddb: rename "show lockstat" to "show lockstats" to avoid conflicting with lockstat(8)

Requested by mrg@


# efe8344c 16-Mar-2018 ozaki-r <ozaki-r@NetBSD.org>

Get rid of a redundant output


# e611636f 16-Mar-2018 ozaki-r <ozaki-r@NetBSD.org>

Add a new command, show all locks, which shows information of active locks

The command shows information of all active (i.e., being held) locks that are
tracked through either of LWPs or CPUs by the

Add a new command, show all locks, which shows information of active locks

The command shows information of all active (i.e., being held) locks that are
tracked through either of LWPs or CPUs by the LOCKDEBUG facility. The /t
modifier additionally shows a backtrace for each LWP additionally. This
feature is useful for debugging especially to analyze deadlocks.

The command is useful only if LOCKDEBUG is enabled.

show more ...


# 1d919413 16-Mar-2018 ozaki-r <ozaki-r@NetBSD.org>

Add a new command, show lockstat, which shows statistics of locks

Currently the command shows the number of allocated locks.

The command is useful only if LOCKDEBUG is enabled.


# d54aad2d 20-Feb-2018 ozaki-r <ozaki-r@NetBSD.org>

Spinkle __predict_false to LOCKDEBUG functions

Panics and lockdebug failures are unlikely to occur normally.


# 4e425594 14-Feb-2018 ozaki-r <ozaki-r@NetBSD.org>

Use cpu_softintr_p


1234