On 11 August 2016 at 11:04, Ben Pfaff <b...@ovn.org> wrote:
> On Thu, Aug 04, 2016 at 02:58:38PM -0700, Joe Stringer wrote:
>> To assist debugging pipelines when resubmit resource checks fail, print
>> the base_flow from the translation context. This base flow can then be
>> used from ofproto/trace to figure out which parts of the pipeline lead
>> to this translation error.
>>
>> As far as I can see, the "## __VA_ARGS__" trick is a GCC thing rather
>> than part of the C standard, but it successfully compiles on GCC 6.1.1,
>> Clang 3.8.1, and the compiler that Appveyor CI uses so it seems like it
>> is widely supported.
>>
>> Signed-off-by: Joe Stringer <j...@ovn.org>
>
> It's a little extra-tricky.  Any change you'd instead be willing to use
> ds_put_format() on the local 'ds' instead?  Something like this:
>
>     struct ds ds = DS_EMPTY_INITIALIZER;
>     flow_format(&ds, &ctx->base_flow);
>     ds_put_cstr(&ds, ": ");
>     ds_put_format(&ds, __VA_LIST__);
>
> It might be slightly slower but this is not a fast path.

Ah, yes I didn't think to use ds_put_format() with the variable
arguments. This allows us to drop the ugly XLATE_REORDER cludge too.
I'll send a v2 soon.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to