Add a --output_file switch to report_sample.py
Bug: 268057515
Add a --output_file switch (short form: "-o") to report_sample.py.
This makes report_sample.py similar to other simpleperf scripts,
especially pprof_proto_generator.py.
Without the switch, the script output is directed to the shell's
stdout, which is the behavior prior to this change. With the switch,
the script output goes to the specified path. If the path cannot be
opened, the script throws a standard Python error.
A new unit test has been added for this switch. Run the tests with
test/test.py -p 'TestReportSample*'
Change-Id: I1913c947de4a0c551543fff0694438d9326bdcd2
2 files changed