diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2017-10-22 20:22:23 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2017-10-22 20:22:23 +0000 |
commit | 5a17c5524fe977d5b8fddac04d24184d80824196 (patch) | |
tree | c4d1d24d064438d22d99e37e4ac88ec8a9847a9d /sys/sys | |
parent | cc1307b67f847bda93317f700731598c88d54049 (diff) | |
download | src-5a17c5524fe977d5b8fddac04d24184d80824196.tar.gz src-5a17c5524fe977d5b8fddac04d24184d80824196.zip |
sdt: make all sdt probe sites test one variable
This saves on cache misses at the expense of a slight grow of .text.
Note this is a bandaid for lack of hotpatching.
Discussed with: markj
Notes
Notes:
svn path=/head/; revision=324869
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/sdt.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index 25423d764e3c..6771bf9f1177 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -80,6 +80,8 @@ #include <sys/cdefs.h> #include <sys/linker_set.h> +extern volatile bool sdt_probes_enabled; + #ifndef KDTRACE_HOOKS #define SDT_PROVIDER_DEFINE(prov) @@ -161,10 +163,12 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do { \ - if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \ + if (__predict_false(sdt_probes_enabled)) { \ + if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \ (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, \ (uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2, \ (uintptr_t) arg3, (uintptr_t) arg4); \ + } \ } while (0) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) \ |