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)
Jan 19 2024, 2:10 AM
Unknown Object (File)
Jan 8 2024, 8:33 PM
Unknown Object (File)
Dec 20 2023, 4:17 AM
Unknown Object (File)
Nov 28 2023, 7:20 AM
Unknown Object (File)
Jun 9 2023, 11:36 PM
Unknown Object (File)
Jun 7 2023, 3:22 PM
Unknown Object (File)
Apr 21 2023, 3:11 PM
Unknown Object (File)
Apr 19 2023, 5:55 AM
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.