]> git.cworth.org Git - apitrace/commitdiff
trim --prune: Look at FLAG_NO_SIDE_EFFECTS rather than FLAG_VERBOSE
authorCarl Worth <cworth@cworth.org>
Sat, 16 Feb 2013 00:31:11 +0000 (16:31 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 12 Apr 2013 20:25:13 +0000 (13:25 -0700)
The --prune option is documented precisely to prune calls with no side
effects, so that's the flag it should examine.

Previously, the trim --prune code was keying off of the VERBOSE
flag. This hasn't made a substantial difference in the past, (the
NO_SIDE_EFFECTS calls have historically all been VERBOSE as well). But
NO_SIDE_EFFECTS has the advantage that it can objectively determined,
so the set of calls that should have this flag should be
unambiguous. (Meanwhile, whether any particular call should be
classified as VERBOSE is inherently subjective.)

cli/cli_trim.cpp

index 5625a2c4f845ee2e0bccdba1cd24ed42c04b3ddb..b0cb8f167557fbe162b174a50ddf2610ce905b2b 100644 (file)
@@ -210,8 +210,8 @@ trim_trace(const char *filename, struct trim_options *options)
             goto NEXT;
         }
 
-        /* Also, prune if uninteresting (unless the user asked for no pruning. */
-        if (options->prune_uninteresting && call->flags & trace::CALL_FLAG_VERBOSE) {
+        /* Also, prune if no side effects (unless the user asked for no pruning. */
+        if (options->prune_uninteresting && call->flags & trace::CALL_FLAG_NO_SIDE_EFFECTS) {
             goto NEXT;
         }