Page MenuHomeFreeBSD

Track mbuf owner
Needs ReviewPublic

Authored by darius-dons.net.au on Jan 13 2016, 4:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 25, 11:49 PM
Unknown Object (File)
Mon, Mar 25, 11:11 PM
Unknown Object (File)
Jan 24 2024, 4:40 PM
Unknown Object (File)
Dec 20 2023, 10:33 PM
Unknown Object (File)
Dec 20 2023, 1:12 AM
Unknown Object (File)
Nov 13 2023, 11:26 AM
Unknown Object (File)
Oct 25 2023, 5:48 AM
Unknown Object (File)
Sep 5 2023, 8:19 AM
Subscribers

Details

Reviewers
None
Group Reviewers
Contributor Reviews (src)
Summary

This patch is a re-implementation of Isilon's mbuf tracking code which shows records who owns a given mbuf. It has a sysctl which produces a summary of how many buffers are owned by each.
It also adds a 'show mbuf' command to DDB.

The magic/ugliness is that it has x86 only code to look at the stack and find the caller of the mbuf function to record it as the owner.

Test Plan

Booted up a VM and run..
ls -laR / > /dev/null & sysctl kern.ipc.mbufs

a few times

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

darius-dons.net.au retitled this revision from to Track mbuf owner.
darius-dons.net.au updated this object.
darius-dons.net.au edited the test plan for this revision. (Show Details)
darius-dons.net.au set the repository for this revision to rS FreeBSD src repository - subversion.
cem added inline comments.
sys/x86/include/stack.h
54–74

Why not use the GCC function __builtin_return_address() instead? That should be somewhat portable to non-x86?

https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html

Clang/LLVM support the macros as well (for X86 since LLVM2.5):

https://github.com/llvm-mirror/clang/blob/master/test/Sema/builtin-stackaddress.c

sys/x86/include/stack.h
54–74

Wow, that looks like exactly what I want :)
I'll update the patch.