Page MenuHomeFreeBSD

vm_phys: Add a sysctl to dump registered fictitious memory ranges
ClosedPublic

Authored by markj on Thu, Jul 16, 2:03 PM.
Tags
None
Referenced Files
F163507248: D58283.diff
Thu, Jul 23, 10:34 PM
F163448949: D58283.id182078.diff
Thu, Jul 23, 7:20 AM
Unknown Object (File)
Thu, Jul 23, 5:45 AM
Unknown Object (File)
Thu, Jul 23, 4:44 AM
Unknown Object (File)
Thu, Jul 23, 3:59 AM
Unknown Object (File)
Wed, Jul 22, 10:00 PM
Unknown Object (File)
Wed, Jul 22, 8:26 PM
Unknown Object (File)
Wed, Jul 22, 7:26 PM

Details

Summary

I've wanted this a couple of times in the past. Save the memattr in
the fictitious memory segment structure so that we can report it from
the sysctl handler, and add conversion routines for each platform.

Diff Detail

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

Event Timeline

markj requested review of this revision.Thu, Jul 16, 2:03 PM
sys/vm/vm_phys.c
372

The why not return "???" from vm_memattr_name()? I would print the numeric value of the unknown memattr.

Print a number if memattr decoding fails

markj added inline comments.
sys/vm/vm_phys.c
372

The why not return "???" from vm_memattr_name()?

Returning NULL indicates that the memattr was not decoded, it seems better to give that extra information to the caller and let them decide how to handle it.

I would print the numeric value of the unknown memattr.

Ok

kib added inline comments.
sys/vm/vm_phys.c
374

I suspect that the width 2 is too narrow, since '0x' from '#' counts there.

This revision is now accepted and ready to land.Thu, Jul 16, 3:32 PM
markj marked an inline comment as done.

Fix formatting

This revision now requires review to proceed.Thu, Jul 16, 3:44 PM
This revision is now accepted and ready to land.Thu, Jul 16, 3:44 PM