Page MenuHomeFreeBSD

libdtrace: allow D libraries to depend on kernel modules
ClosedPublic

Authored by markj on May 26 2015, 1:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 12:00 AM
Unknown Object (File)
Mon, Nov 18, 11:45 PM
Unknown Object (File)
Thu, Nov 14, 7:59 AM
Unknown Object (File)
Fri, Nov 1, 5:17 PM
Unknown Object (File)
Oct 14 2024, 3:33 PM
Unknown Object (File)
Sep 27 2024, 9:09 AM
Unknown Object (File)
Sep 16 2024, 10:14 PM
Unknown Object (File)
Sep 13 2024, 10:28 PM
Subscribers

Details

Summary

It's possible to declare a dependency on a DTrace module using pragmas;
for instance, siftr.d currently contains

#pragma D depends_on module siftr

libdtrace currently resolves this by looking through its module list,
which includes the list of loaded KLDs (e.g. siftr.ko). However, many
kernel modules can be compiled into the kernel, in which case they won't
appear in libdtrace's module list, so libdtrace will incorrectly skip
processing of the library. Note that a DTrace module isn't necessarily a
kernel object; DTrace may define modules that correspond to userland
libraries.

This change fixes the problem by keeping track of loaded kernel modules
as well as KLDs, and allowing a module dependency to be satisfied by
either a KLD or a kernel module. Ideally we would only look at either
KLDs or kernel modules, but libdtrace's notion of a module doesn't
really map perfectly to either of them, so the only real solution I can
see to the above-described problem is to check both.

Test Plan
  • Manual testing using siftr compiled into the kernel and as a KLD.
  • DTrace test suite

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to libdtrace: allow D libraries to depend on kernel modules.
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj added a reviewer: DTrace.
rpaulo added a reviewer: rpaulo.
This revision is now accepted and ready to land.May 26 2015, 3:42 PM
gnn edited edge metadata.
This revision was automatically updated to reflect the committed changes.