coretemp(4)/amdtemp(4) and sysctl nodes

Dag-Erling Smørgrav des at des.no
Wed Dec 8 03:55:49 UTC 2010


mdf at FreeBSD.org writes:
> Each device provides a device_get_sysctl_ctx sysctl_ctx that is
> automatically cleaned up when the device goes away.  Yet the sysctl
> nodes for both amdtemp and coretemp use the context of other devices,
> rather than their own.  I can't quite figure out why, though the two
> are slightly different enough that they may have different reasons.

I can't speak for amdtemp, but if coretemp used its own context instead
of its parent's context, it would show up as dev.coretemp.X.temperature
instead of dev.cpu.Y.temperature, where X is not necessarily equal to Y.
Since, as you point out, the coretemp device is a child of the
corresponding cpu device, there is no risk of orphaning the temperature
OID.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-hackers mailing list