Carl Worth [Mon, 13 Aug 2012 21:35:43 +0000 (14:35 -0700)]
trim: Trim most drawing operations outside of the user-specified range
Care is taken to consider a glBegin/glEnd block as a single drawing
operation, (so that it will enitrely included or entirely trimmed).
We're also careful to avoid trimming any drawing operation when there
are active side effects (other than rendering to the default
framebuffer). For example, if there is an active binding of
GL_FRAMEBUFFER or GL_DRAW_FRAMEBUFFER to any buffer object, or if we
are withing a glBeginTransformFeedback/glEndTransformFeedback block;
in any of these cases the drawing operation will not be trimmed.
Carl Worth [Sat, 11 Aug 2012 18:46:54 +0000 (11:46 -0700)]
trim: Add a more condensed usage message for error cases.
When explicitly asking for help, ("apitrace help trim" or "apitrace
trim --help"), the complete help message is still provided.
But when an error case triggers a usage message, (such as an invalid
command-line argument), a more compact usage message is provided so as
to not overwhelm the error message (such as "invalid argument:
--foo").
Carl Worth [Sat, 11 Aug 2012 18:33:12 +0000 (11:33 -0700)]
trim: Prune uninteresting calls while trimming (unless --no-prune is passed)
Examine the CALL_FLAG_UNINTERESTING flag and leave out these calls
when trimming. These calls are generally the calls that have no side
effects, (such as query functions). Some calls without side effects
might be considered interesting, (such as glGetError returning a
non-zero error).
This pruning behavior can be avoided by passing the new --no-prune
option (or the new --exact option which is identical to passing both
--no-prune and -no-deps).
Carl Worth [Tue, 4 Sep 2012 23:48:00 +0000 (16:48 -0700)]
trim: Complain if given extraneous arguments.
Previously additional arguments were silently ignored, (which can lead
to confusion if the user expects to be able to specify a bare callset
on the command line rather than specifying a --calls option).
Carl Worth [Fri, 10 Aug 2012 17:15:30 +0000 (10:15 -0700)]
trim: Add framework for performing dependency analysis while trimming
The current analysis is as brain-dead as possible. All calls are
interpreted as affecting the current "state" resource, and all calls
are also interpreted as depending on the current "state". In other
words, no calls at all will be trimmed. Obviously, this is not useful
analysis, but all the framewok is now present for easily doing more
interesting things.
A new --no-deps option is now made available to "apitrace trim" so
that users can avoid all dependency analysis and still get the prior
behavior where only calls explicitly included in the --calls option
are included in the trim output.
Carl Worth [Mon, 20 Aug 2012 16:45:27 +0000 (09:45 -0700)]
cli: Add a simple "apitrace replay" sub-command.
This calls out to glretrace in order to replay a trace. Currently it
only supports the -w,--wait option, (and not yet any of the profiling
support).
With this command and the existing "apitrace dump-images", we're quite
close to being able to relegate glretrace to an implementation detail
used by the apitrace program, (such that soon, it won't be necessary
to provide glretrace on the user's PATH).
Carl Worth [Sun, 12 Aug 2012 23:36:48 +0000 (16:36 -0700)]
dump-images: Execute glretrace from source dir when running uninstalled
Previously, we've had code to carefully find wrappers and scripts
relative to an apitrace binary being run from an uninstalled
directory. This is extremely useful while testing an experimental
feature before installing said experimental code.
Similarly, provide a findProgram function to do the same thing for an
executable program and use it within "apitrace dump-images" when
invoking glretrace.
Carl Worth [Sun, 12 Aug 2012 23:01:09 +0000 (16:01 -0700)]
Move trace::findWrapper to trace_resource.cpp
It's not actually used outside of trace_tools_trace.cpp, but it is so
similar to the existing trace::findScript in trace_resource.cpp that
there are benefits to having them defined in the same file.
Carl Worth [Sun, 12 Aug 2012 19:44:50 +0000 (12:44 -0700)]
glretrace: Use getopt rather than manual parsing of command-line options
This allows for better consistency with other apitrace command-line
interface. It also provids for several new full-name options where
previously only a single-letter option was available,
(--snapshot-prefix for -s, --verbose for -v, et.).
We use getopt_long_only here to maintain compatibility with the older
style of long options with one dash (-core) as well as providing the
double-dash version )--core).
It would now be quite convenient to regularize the command-line
interface to glretrace in several ways. None of these are performed in
this commit to avoid breaking compatibility with existing scripts,
etc.:
* Combine related options under a single name (--pcpu and --pgpu
could be something like --profile=cpu,gpu).
* Combine options with the same meaning that would never be used
independently. Snapshot generation and snapshot comparison are
different modes. Meanwhile, prefix selection and call selection
should apply identically to either mode. So both modes can use a
single set of options (--prefix and --calls) rather than having
separate --snapshot-prefix and --snapshot options.
Carl Worth [Sun, 12 Aug 2012 23:48:10 +0000 (16:48 -0700)]
Move static boolOption function to trace::boolOption
Other programs will also want to be able to parse Boolean command-line
options, so we should share this code in order to easily get
consistent behavior.