DTrace probes for geom_kern, geom_io and geom_event

Marius Nünnerich marius at nuenneri.ch
Thu Dec 4 12:41:19 PST 2008


Hi,

I wrote a bunch of DTrace probes for the core geom files mentioned in
the subject. The patch for current is available at
http://nuenneri.ch/freebsd/geom_probes.patch

Anyone interested in testing them? Just apply the patch, add options
KDTRACE_HOOKS to your kernel and build it like this:
# make WITH_CTF=1 KERNCONF=YOURKERNEL buildkernel installkernel

After reboot you can
# kldload dtraceall
and see the new probes with
# dtrace -lP geom

A sample script:
#!/usr/sbin/dtrace -s
#pragma D option quiet

geom:::
{
  @geom[execname, probemod, probefunc, probename] = count();
  @geom_all[execname, probemod, probefunc, probename] = count();
}

tick-10sec
{
  normalize(@geom, 10)
  printa("%@8u %@8u %12s %s:%s:%s\n", @geom_all, @geom);
  printf("\n");
  clear(@geom);
}

This is hand copied. You can chmod 755 and run it.

I'm not sure how to handle the opt_kdtrace.h case in geom.h, see patch line 842.
Any comments on the patch?

@phk: Are you interested in committing this when there are no
complaints? Are you interested in more probes?

Kind regards
Marius


More information about the freebsd-geom mailing list