Is your feature request related to a problem? Please describe.
it would be nice to have some debug feature which can detect issues like #15314
Describe the solution you'd like
precedents:
https://man.freebsd.org/cgi/man.cgi?witness(4)
https://docs.kernel.org/locking/lockdep-design.html
Describe alternatives you've considered
although adhoc local assertions like yamt@ac3dda4
can work, it would be nicer to have a generic mechanism in the upstream.
Verification