]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sdt: Create providers and probes in separate passes when loading sdt.ko
authorMark Johnston <markj@FreeBSD.org>
Thu, 3 Dec 2020 17:10:00 +0000 (17:10 +0000)
committerMark Johnston <markj@FreeBSD.org>
Thu, 3 Dec 2020 17:10:00 +0000 (17:10 +0000)
commit7be2770a426dc7399b63115b1c2c7d8bebdea06a
tree3532169fb31430851ee5ce83d9d49214afb3d2ee
parent94e3e7d2e8014a981226567e67c82087cc59cca7
sdt: Create providers and probes in separate passes when loading sdt.ko

The sdt module's load handler iterates over SDT linker sets for the
kernel and all loaded modules to create probes and providers defined by
SDT(9).  Probes in one module may belong to a provider in a different
module, but when a probe is created we assume that the provider is
already defined.  To maintain this invariant, modify the load handler to
perform two separate passes over loaded modules: one to define providers
and the other to define probes.

The problem manifests when loading linux.ko, which depends on
linux_common.ko, which defines providers used by probes defined in
linux.ko.

Reported by: gallatin
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
sys/cddl/dev/sdt/sdt.c