Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/dev/fbt/fbt.c
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | fbt_provide_module(void *arg, modctl_t *lf) | ||||
/* | /* | ||||
* Employees of dtrace and their families are ineligible. Void | * Employees of dtrace and their families are ineligible. Void | ||||
* where prohibited. | * where prohibited. | ||||
*/ | */ | ||||
if (strcmp(modname, "dtrace") == 0) | if (strcmp(modname, "dtrace") == 0) | ||||
return; | return; | ||||
/* | /* | ||||
* To register with DTrace, a module must list 'dtrace' as a | * To register with DTrace, a module must list 'dtrace' as a dependency | ||||
* dependency in order for the kernel linker to resolve | * in order for the kernel linker to resolve symbols like | ||||
* symbols like dtrace_register(). All modules with such a | * dtrace_register(). All modules with such a dependency are ineligible | ||||
* dependency are ineligible for FBT tracing. | * for FBT tracing. An exception is dtrace_test.ko, whose functions we | ||||
* want to be able to trace. | |||||
*/ | */ | ||||
if (strcmp(modname, "dtrace_test") != 0) { | |||||
for (i = 0; i < lf->ndeps; i++) | for (i = 0; i < lf->ndeps; i++) | ||||
if (strncmp(lf->deps[i]->filename, "dtrace", 6) == 0) | if (strncmp(lf->deps[i]->filename, "dtrace", 6) == 0) | ||||
return; | return; | ||||
} | |||||
if (lf->fbt_nentries) { | if (lf->fbt_nentries) { | ||||
/* | /* | ||||
* This module has some FBT entries allocated; we're afraid | * This module has some FBT entries allocated; we're afraid | ||||
* to screw with it. | * to screw with it. | ||||
*/ | */ | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,112 Lines • Show Last 20 Lines |