+enum {
+ CALLS_OPT = CHAR_MAX + 1,
+ FRAMES_OPT,
+ DEPS_OPT,
+ PRUNE_OPT,
+ THREAD_OPT,
+ PRINT_CALLSET_OPT,
+};
+
+const static char *
+shortOptions = "aho:x";
+
+const static struct option
+longOptions[] = {
+ {"help", no_argument, 0, 'h'},
+ {"calls", required_argument, 0, CALLS_OPT},
+ {"frames", required_argument, 0, FRAMES_OPT},
+ {"deps", no_argument, 0, DEPS_OPT},
+ {"prune", no_argument, 0, PRUNE_OPT},
+ {"auto", no_argument, 0, 'a'},
+ {"thread", required_argument, 0, THREAD_OPT},
+ {"output", required_argument, 0, 'o'},
+ {"print-callset", no_argument, 0, PRINT_CALLSET_OPT},
+ {0, 0, 0, 0}
+};
+
+struct stringCompare {
+ bool operator() (const char *a, const char *b) const {
+ return strcmp(a, b) < 0;
+ }
+};
+
+struct trim_options {
+ /* Calls to be included in trace. */
+ trace::CallSet calls;
+
+ /* Frames to be included in trace. */
+ trace::CallSet frames;
+
+ /* Whether dependency analysis should be performed. */
+ bool dependency_analysis;
+
+ /* Whether uninteresting calls should be pruned.. */
+ bool prune_uninteresting;
+
+ /* Output filename */
+ std::string output;
+
+ /* Emit only calls from this thread (-1 == all threads) */
+ int thread;
+
+ /* Print resulting callset */
+ int print_callset;
+};
+