X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Foptions.ml;h=d72763ec8ba29a2277cb223530acf3716a4db5a1;hb=15925690fee382ffc7d78fa2fed8b686c180ec99;hp=07f8ffb69547e9d31f7eb0d3ee8d481632688974;hpb=7b4efbdf1b9e4e972f2b1d3c3c5c69235f7a964a;p=SXSI%2Fxpathcomp.git diff --git a/src/options.ml b/src/options.ml index 07f8ffb..d72763e 100644 --- a/src/options.ml +++ b/src/options.ml @@ -13,6 +13,11 @@ let bottom_up = ref false let no_jump = ref false let verbose = ref false let text_index_type = ref 0 +let do_perf = ref false + +(* Only valid if compiled with -DTRACE *) +let trace_file = ref "trace.dot" + let set_index_type = function | "default" -> text_index_type := 0 @@ -51,12 +56,21 @@ let spec = Arg.align "-nj", Arg.Set(no_jump), " disable jumping"; + "-p", Arg.Set(do_perf), " dump perf counters (Linux only)"; + "-index-type", Arg.Symbol ([ "default"; "swcsa"; "rlcsa" ], set_index_type), " choose text index type"; - "-v", Arg.Set(verbose), " verbose mode"; - ] + "-v", Arg.Set(verbose), " verbose mode"; ] @ +IFDEF TRACE +THEN [ + "-trace-file", Arg.Set_string(trace_file), + " save the full trace in dot format in " + ] +ELSE [] +END + let parse_cmdline() = let _ = Arg.parse spec anon_fun usage_msg