Re: dt: make vmm tracepoints amd64 only

2022-01-24 Thread Klemens Nanni
On Mon, Jan 17, 2022 at 04:51:37PM -0800, Philip Guenther wrote:
> On Mon, Jan 17, 2022 at 5:02 AM Klemens Nanni  wrote:
> 
> > 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?
> >
> 
> If there's a non-trivial number of trace points in drivers, then it would
> suggest that such tracepoints should be added/registered/pick-a-term by the
> driver's attach routine.

This needs a little bit of refactor around probe registration.

I plan to commit the initial `#ifdef __amd64__' diff with "OK pv" soon
unless I hear objections.



Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Philip Guenther
On Mon, Jan 17, 2022 at 5:02 AM Klemens Nanni  wrote:

> 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?
>

If there's a non-trivial number of trace points in drivers, then it would
suggest that such tracepoints should be added/registered/pick-a-term by the
driver's attach routine.

Philip


Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Mike Larkin
On Mon, Jan 17, 2022 at 10:10:26AM -0300, Crystal Kolipe wrote:
> On Mon, Jan 17, 2022 at 01:00:44PM +, Klemens Nanni wrote:
> > 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.
>
> Don't we want this on i386 too?
>

pd@ removed i386 vmm(4) years ago. It was sorta pointless running VMs
on a host that can only support 4GB physmem.



Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Crystal Kolipe
On Mon, Jan 17, 2022 at 08:34:39AM -0500, Dave Voutila wrote:
> vmm(4) was removed from i386 hosts a couple years ago if my memory is
> correct.

Ah, my bad.  It was indeed removed on 20190118.



Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Dave Voutila


Crystal Kolipe  writes:

> On Mon, Jan 17, 2022 at 01:00:44PM +, Klemens Nanni wrote:
>> 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.

I'm ok with this. bt(5) scripts don't reference tracepoints by anything
other than name, so there's no point in having them on unsupported
platforms.

>
> Don't we want this on i386 too?

vmm(4) was removed from i386 hosts a couple years ago if my memory is
correct.

-dv



Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Stuart Henderson
On 2022/01/17 10:10, Crystal Kolipe wrote:
> On Mon, Jan 17, 2022 at 01:00:44PM +, Klemens Nanni wrote:
> > 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.
> 
> Don't we want this on i386 too?

vmm is amd64 only.



Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Crystal Kolipe
On Mon, Jan 17, 2022 at 01:00:44PM +, Klemens Nanni wrote:
> 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.

Don't we want this on i386 too?



dt: make vmm tracepoints amd64 only

2022-01-17 Thread Klemens Nanni
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.c24 Nov 2021 09:47:49 -  1.11
+++ dev/dt//dt_prov_static.c17 Jan 2022 12:47:38 -
@@ -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),