Page MenuHomeFreeBSD

mbuf: add mbuf information to KASSERTs
ClosedPublic

Authored by bz on Apr 13 2025, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 15, 1:28 AM
Unknown Object (File)
Sat, Sep 12, 10:02 AM
Unknown Object (File)
Wed, Sep 9, 11:01 PM
Unknown Object (File)
Wed, Sep 9, 3:57 PM
Unknown Object (File)
Tue, Sep 8, 10:11 AM
Unknown Object (File)
Sun, Sep 6, 9:23 AM
Unknown Object (File)
Thu, Sep 3, 10:05 PM
Unknown Object (File)
Thu, Sep 3, 6:01 PM
Subscribers

Details

Summary

Be more consistent about printing the mbuf pointer in KASSERT messages.
This massively helps debugging and we were already doing a good job at
it.

Also replace some handrolled KASSERTs with M_ASSERTPKTHDR() for fewer
copies of the check logic.

In m_align() move the msg into the KASSERT given after it was moved
here in ed6a66ca6c206 the msg is only used in one place.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Apr 13 2025, 11:11 PM
glebius added a subscriber: glebius.

Thanks! Definitely will speed up analyzing crashes when debugger fails to figure out which register holds the pointer.

This revision is now accepted and ready to land.Apr 14 2025, 6:53 PM
zlei added a subscriber: zlei.

Looks good to me.

This revision was automatically updated to reflect the committed changes.