[PATCH 2/2] trim: Invert the meaning of the --calls argument.

José Fonseca jose.r.fonseca at gmail.com
Thu Sep 6 07:31:44 PDT 2012


On Tue, Sep 4, 2012 at 11:12 PM, Carl Worth <cworth at cworth.org> wrote:
> Eric Anholt <eric at anholt.net> writes:
>> When you're trying to actually do trimming, you're identifying some
>> class of things to remove ("all the rendering between the load screen
>> and the frame that had the bug" or "all the rendering after the frame
>> that had the bug"), and asking trim to remove them (like the command
>> name suggests).
>
> I agree that the command name does suggest this negative sense.
>
> Meanwhile, this change would also apply to the --frames option I have in
> my current trimming code. And with --frames I've found that it's very
> convenient to have the positive-sense option. That is, "I know frame 256
> has the bug of interest, so 'trim --frames=256' to include only this one
> frame.
>
> What we probably want here is support for both positive and negative
> call-sets and frame-sets. I actually had a case recently where I wanted
> to do something like "include frame X but exclude calls Y-Z", (but, it's
> true that I do have more specialized needs when debugging all of this
> stuff---so maybe that wouldn't be commonly needed).
>
> If we used ':' instead of '-' as the separator for first and last within
> a range, (not very unlike python's range syntax), then that would free
> up '+' and '-' to be used as prefixes to suggest whether to include or
> exclude a specific range. So "--frames=+10:20,-5" would mean frames
> 10-20 but not frame 5. That's likely more convenient than having
> separate options like --include-calls/--exclude-calls and similar for
> frames.
>
> Though, I've also recently thought it would be nice to support indexes
> measured from the end. For example, if I wanted to preserve the last 5
> frames of a trace, then "-5:" could be a convenient way to express
> that. So that makes yet a third way of overloading the poor '-'
> character.

Instead of just flipping the meaning of calls, I'd also prefer to add
a way to invert (or not) in the call spec.

Let's use '!' for negation. '-' is already used for ranges.

Jose


More information about the apitrace mailing list