diff options
author | Yabin Cui <yabinc@google.com> | 2020-07-07 15:56:34 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2020-07-08 15:02:56 -0700 |
commit | acbdb2456da4837a143d096a8a0563ba1dfc0507 (patch) | |
tree | 9e07abefafc96e76fb9b065264fb67cb78c0d9ad /simpleperf/cmd_record.cpp | |
parent | 4f6808ce8d0a10cb4c8588ddd7ed275001da3154 (diff) | |
download | extras-acbdb2456da4837a143d096a8a0563ba1dfc0507.tar.gz |
simpleperf: add function to preprocess options.
Add Command::PreprocessOptions() to extracts options from the
argument list. It splits options into different types. Instead of
replying on the order in the argument list, it allows a command
choosing the order to process each option.
Also put whole command.h in simpleperf namespace.
Bug: 160701181
Test: run simpleperf_unit_test.
Change-Id: I9b20e21a94797c322c1371cbe1704b3e2ce1be28
Diffstat (limited to 'simpleperf/cmd_record.cpp')
-rw-r--r-- | simpleperf/cmd_record.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/simpleperf/cmd_record.cpp b/simpleperf/cmd_record.cpp index 2aa99407..5bb6c00b 100644 --- a/simpleperf/cmd_record.cpp +++ b/simpleperf/cmd_record.cpp @@ -1839,7 +1839,11 @@ void RecordCommand::CollectHitFileInfo(const SampleRecord& r) { } } +namespace simpleperf { + void RegisterRecordCommand() { RegisterCommand("record", [] { return std::unique_ptr<Command>(new RecordCommand()); }); } + +} // namespace simpleperf |