Index: perf_insights/perf_insights/map_traces.py |
diff --git a/perf_insights/perf_insights/map_traces.py b/perf_insights/perf_insights/map_traces.py |
index 2e90bf8437fe2b413c526dc409616fd3bb698776..51bf67820a05f555428112f2dcf950c63aef0d32 100644 |
--- a/perf_insights/perf_insights/map_traces.py |
+++ b/perf_insights/perf_insights/map_traces.py |
@@ -56,8 +56,11 @@ def Main(argv): |
choices=_CORPUS_DRIVERS.keys(), |
default=_CORPUS_DRIVER_DEFAULT) |
parser.add_argument('--query') |
- parser.add_argument('map_file') |
+ parser.add_argument('map_function_name') |
+ parser.add_argument('--map-file') |
+ parser.add_argument('--no-vulcanize', dest='vulcanize', |
+ action='store_false', default=True) |
parser.add_argument('-j', '--jobs', type=int, default=1) |
parser.add_argument('-o', '--output-file') |
parser.add_argument('-s', '--stop-on-error', |
@@ -89,7 +92,7 @@ def Main(argv): |
init_args = cls.CheckAndCreateInitArguments(parser, args) |
corpus_driver = cls(**init_args) |
- if not os.path.exists(args.map_file): |
+ if args.map_file and not os.path.exists(args.map_file): |
parser.error('Map does not exist.') |
if args.query == 'help': |
@@ -106,12 +109,16 @@ def Main(argv): |
output_formatter = json_output_formatter.JSONOutputFormatter(ofile) |
+ map_file_path = None |
+ if args.map_file: |
+ map_file_path = os.path.abspath(args.map_file) |
map_function_handle = map_function_handle_module.MapFunctionHandle( |
- filename=os.path.abspath(args.map_file)) |
+ filename=map_file_path, map_function_name=args.map_function_name) |
try: |
trace_handles = corpus_driver.GetTraceHandlesMatchingQuery(query) |
runner = map_runner.MapRunner(trace_handles, map_function_handle, |
- stop_on_error=args.stop_on_error) |
+ stop_on_error=args.stop_on_error, |
+ vulcanize=args.vulcanize) |
results = runner.Run(jobs=args.jobs, output_formatters=[output_formatter]) |
if not results.had_failures: |
return 0 |