[DTrace-devel] [PATCH] The printf action without conversions was not getting printed

Kris Van Hees kris.van.hees at oracle.com
Fri Jun 19 09:48:50 PDT 2020


On Fri, Jun 19, 2020 at 08:56:52AM -0700, Eugene Loh wrote:
> Thanks for the quick fix.
> 
> I agree with the fix.
> 
> I do think the variations in nomenclature are unneeded. Specifically, 
> the actual fix speaks in terms of "arguments".  In contrast, the commit 
> title line and the test names refer to "conversions".  I understand the 
> relationship, but I think it makes more sense for the title line and 
> test names to refer to the actual source code.  And the term "arguments" 
> is perfectly sensible for a printf(format, arg1, arg2, arg3) user.  The 
> number of conversions doesn't really have much to do with anything -- 
> except indirectly in that DTrace checks that the number of conversions 
> and of arguments agree.

The difference is that the parsing of the format string (and its conversions)
drives the generation of the data structure that describes the format string,
and drives the interpretation of any data records that relate to the printf.

But in terms of ensuring that we provide the format description as an item in
the metadata, the implementation looks at whether there is an argument that
follows the format string.

That is why the title and my first paragraph talk about conversions while
the second one (focusing on the implementation) talks about arguments.  Note
also that the number of arguments and the numbr of conversions does not have
to match (not that this matters in this case since no conversions means no
argument beyond the format string).  But a conversions can require up to 3
arguments to satisfy its specification.

> And...
> 
> On 06/18/2020 06:51 PM, Kris Van Hees wrote:
> > diff --git a/test/unittest/actions/printf/tst.no-conv.only.d 
> > b/test/unittest/actions/printf/tst.no-conv.only.d
> > + * ASSERTION: The printf action supports a constant format string without
> > + *	      conversions, when it is the first only.
> s/first only/only action/

Thanks.

The corrected patch will be in 2.0-branch-dev shortly.



More information about the DTrace-devel mailing list