Index: sys/cddl/dev/fbt/fbt.h =================================================================== --- sys/cddl/dev/fbt/fbt.h +++ sys/cddl/dev/fbt/fbt.h @@ -58,6 +58,7 @@ void fbt_patch_tracepoint(fbt_probe_t *, fbt_patchval_t); int fbt_provide_module_function(struct linker_file *, int, struct linker_symval *, void *); +int fbt_excluded(const char *name); extern dtrace_provider_id_t fbt_id; extern fbt_probe_t **fbt_probetab; Index: sys/cddl/dev/fbt/fbt.c =================================================================== --- sys/cddl/dev/fbt/fbt.c +++ sys/cddl/dev/fbt/fbt.c @@ -111,6 +111,34 @@ static int fbt_probetab_size; static int fbt_verbose = 0; +int +fbt_excluded(const char *name) +{ + + if (strncmp(name, "dtrace_", 7) == 0 && + strncmp(name, "dtrace_safe_", 12) != 0) { + /* + * Anything beginning with "dtrace_" may be called + * from probe context unless it explicitly indicates + * that it won't be called from probe context by + * using the prefix "dtrace_safe_". + */ + return (1); + } + + if (name[0] == '_' && name[1] == '_') + return (1); + + /* + * In absence of DTrace kernel-module support on ARM, we need to + * manually exclude FBT functions from instrumentation. + */ + if (strncmp(name, "fbt_", 4) == 0) + return (1); + + return (0); +} + static void fbt_doubletrap(void) {