These don't hurt on !VMM architectures but I was still surprised to see
them on e.g. sparc64:
# arch -s ; btrace -l | grep vmm
sparc64
tracepoint:vmm:guest_enter
tracepoint:vmm:guest_exit
Like some network drivers, we could use __amd64__ to limit those to
amd64 and save a few bits in all other kernels.
Is this approach feasible or should we just ignore such one-offs?
One can specify and "use" those tracepoints without errors in btrace(8),
but they won't ever hit on !amd64, of course.
Tested on amd64 and sparc64.
Index: dev/dt//dt_prov_static.c
===================================================================
RCS file: /cvs/src/sys/dev/dt/dt_prov_static.c,v
retrieving revision 1.11
diff -u -p -r1.11 dt_prov_static.c
--- dev/dt//dt_prov_static.c 24 Nov 2021 09:47:49 -0000 1.11
+++ dev/dt//dt_prov_static.c 17 Jan 2022 12:47:38 -0000
@@ -69,11 +69,13 @@ DT_STATIC_PROBE3(vfs, bufcache_rel, "lon
DT_STATIC_PROBE3(vfs, bufcache_take, "long", "int", "int64_t");
DT_STATIC_PROBE4(vfs, cleaner, "long", "int", "long", "long");
+#ifdef __amd64__
/*
* VMM
*/
DT_STATIC_PROBE2(vmm, guest_enter, "void *", "void *");
DT_STATIC_PROBE3(vmm, guest_exit, "void *", "void *", "uint64_t");
+#endif /* __amd64__ */
/*
* SMR
@@ -113,9 +115,11 @@ struct dt_probe *dtps_static[] = {
&_DT_STATIC_P(vfs, bufcache_rel),
&_DT_STATIC_P(vfs, bufcache_take),
&_DT_STATIC_P(vfs, cleaner),
+#ifdef __amd64__
/* VMM */
&_DT_STATIC_P(vmm, guest_enter),
&_DT_STATIC_P(vmm, guest_exit),
+#endif /* __amd64__ */
/* SMR */
&_DT_STATIC_P(smr, call),
&_DT_STATIC_P(smr, called),