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

Carl Worth cworth at cworth.org
Tue Sep 4 15:12:50 PDT 2012


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.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20120904/02970127/attachment.pgp>


More information about the apitrace mailing list