[DTrace-devel] [PATCH v2-alternative] Implement the io provider

Kris Van Hees kris.van.hees at oracle.com
Fri Nov 17 05:17:47 UTC 2023


On Thu, Nov 16, 2023 at 11:26:54PM -0500, Eugene Loh via DTrace-devel wrote:
> I cannot vouch for the details of how the io stack works, but the use of
> tracepoints instead of fbt sure makes this stuff look nicer!  So,
>     Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> though I'm not sure if I'm an eligible reviewer.
> 
> There continue to be some intermittent test failures.
> 
> Also (haven't thought about this yet), I see XFAIL "io:::start not fully
> supported before 5.15" for
>     tst.fbt_probes.sh
>     tst.nfs2.sh
>     tst.wait.sh
> Should there also be such a .x for
>     tst.nfs.sh
> ???

Still looking into those failures.  I would think it ought to be able to work,
so I am not giving up yet :)

> Also, with UEK6 (also need to think about this more), I get problems with
> wait-* probes:
>         # dtrace -n 'io:::start { exit(0) }'
>         dtrace: description 'io:::start ' matched 1 probe
>         CPU     ID                    FUNCTION:NAME
>           7  98772                           :start
> 
>         # dtrace -n 'io:::done { exit(0) }'
>         dtrace: description 'io:::done ' matched 1 probe
>         CPU     ID                    FUNCTION:NAME
>           7  98773                            :done
> 
>         # dtrace -n 'io:::wait-start { exit(0) }'
>         dtrace: description 'io:::wait-start ' matched 1 probe
>         dtrace: could not enable tracing: Module does not contain any CTF
> data
>         # dtrace -n 'io:::wait-done { exit(0) }'
>         dtrace: description 'io:::wait-done ' matched 1 probe
>         dtrace: could not enable tracing: Module does not contain any CTF
> data

Same thing - since the probes exist and apparently should fire correctly, I am
not sure yet why it is not working.  Especially the "Module does not contain
any CTF data" error is *very* odd.

> Also, the last arg to io_xfs_args() seems not to be used and therefore could
> be dropped.

Ah yes, that is no longer used.  Good point.

> And...
> 
> On 11/16/23 11:28, Eugene Loh via DTrace-devel wrote:
> > diff --git a/libdtrace/dt_prov_io.c b/libdtrace/dt_prov_io.c
> > +
> > +	/* Handle the non-XFS wait-done flavor. */
> > +	if (strcmp(prp->desc->prb, "wait-done") == 0) {
> > +		/*
> > +		 * We need instrument submit_bio_wait(struct bio *):
> > +		 *   - on entry, store the bio pointer into a TLS var
> > +		 *   - on return, retrieve the pointer (and clear the TLS var)
> > +		 * We use a TLS var to distinguish among possible concurrent
> > +		 * submit_bio_wait() on the CPU.
> > +		 */
> 
> We need instrument...
> ->
> We need to instrument...

I meant to fix that (it was like this in your original patch and I noticed it
too - but forgot to fix it).
> 
> > diff --git a/test/unittest/io/dump_io_probe_args.d b/test/unittest/io/dump_io_probe_args.d
> > +io:::wait-start,
> > +io:::wait-done,
> > +io:::start,
> > +io:::done
> > +{
> > +	printf("%s: %s: %s: %11s %d %3x  %9d %9d   %p %d %d  %5d %5d    %p   %d %d %d   %d %d %d %s %s %s\n",
> > +	    probeprov, probemod, probefunc, probename,
> > +	    arg1,
> 
> I think that should be arg2.  args[1] is also being dumped.  Here, we're
> trying to check that arg2==0.

No, it needs to be arg1.  The args[n] arguments are the *translated* arguments
whereas argN are the *raw* arguments.  The io probes all take two *raw*
arguments (struct bio * and struct file *), but they expose three *translated*
arguments (struct bio *, devinfo_t *, fileinfo_t *).

But translated types only allow access to members - not the main type itself,
so you cannot print args[2] here because that is a dynamic type.  Therefore,
we need to use arg1 (because the argument translation mapping maps arg1 to
args[2], with type translation).

> Also, I think you changed some wording in check_io_probe_args.sh.  I guess
> that's okay, but in light of the fact that we're checking arg2 here rather
> than args[2], the original wording might be better.

Again, due to the translated arg thing.

> > +
> > +	    args[0]->b_flags,
> > +
> > +	    args[0]->b_bcount,
> > +	    args[0]->b_bufsize,
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list