diff options
author | Yabin Cui <yabinc@google.com> | 2017-02-23 16:27:09 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2017-02-23 16:27:09 -0800 |
commit | afe99a53d3030f54fa843af3e1558852a4cb3815 (patch) | |
tree | ef9c6bb5583edeb2b948a879e835ad6cd39da217 /simpleperf/cmd_report.cpp | |
parent | d9d23181768df567d166b79a89cfc0408e086509 (diff) | |
download | extras-afe99a53d3030f54fa843af3e1558852a4cb3815.tar.gz |
simpleperf: add --raw-period option for report cmd.
Bug: http://b/35475170
Test: run simpleperf_unit_test.
Change-Id: Ib5bae0b775ac2a3e647b7724df01ce0b8deb1a38
Diffstat (limited to 'simpleperf/cmd_report.cpp')
-rw-r--r-- | simpleperf/cmd_report.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/simpleperf/cmd_report.cpp b/simpleperf/cmd_report.cpp index 3b727a5e..883b983b 100644 --- a/simpleperf/cmd_report.cpp +++ b/simpleperf/cmd_report.cpp @@ -291,6 +291,7 @@ class ReportCommand : public Command { "-o report_file_name Set report file name, default is stdout.\n" "--percent-limit <percent> Set min percentage shown when printing call graph.\n" "--pids pid1,pid2,... Report only for selected pids.\n" +"--raw-period Report period count instead of period percentage.\n" "--sort key1,key2,... Select keys used to sort and print the report. The\n" " appearance order of keys decides the order of keys used\n" " to sort and print the report.\n" @@ -324,7 +325,8 @@ class ReportCommand : public Command { print_callgraph_(false), callgraph_show_callee_(false), callgraph_max_stack_(UINT32_MAX), - callgraph_percent_limit_(0) {} + callgraph_percent_limit_(0), + raw_period_(false) {} bool Run(const std::vector<std::string>& args); @@ -355,6 +357,7 @@ class ReportCommand : public Command { bool callgraph_show_callee_; uint32_t callgraph_max_stack_; double callgraph_percent_limit_; + bool raw_period_; std::string report_filename_; }; @@ -491,7 +494,8 @@ bool ReportCommand::ParseOptions(const std::vector<std::string>& args) { } filter.insert(id); } - + } else if (args[i] == "--raw-period") { + raw_period_ = true; } else if (args[i] == "--sort") { if (!NextArgumentOrError(args, &i)) { return false; @@ -536,10 +540,19 @@ bool ReportCommand::ParseOptions(const std::vector<std::string>& args) { SampleComparator<SampleEntry> comparator; if (accumulate_callchain_) { - displayer.AddDisplayFunction("Children", DisplayAccumulatedOverhead); - displayer.AddDisplayFunction("Self", DisplaySelfOverhead); + if (raw_period_) { + displayer.AddDisplayFunction("Children", DisplayAccumulatedPeriod); + displayer.AddDisplayFunction("Self", DisplaySelfPeriod); + } else { + displayer.AddDisplayFunction("Children", DisplayAccumulatedOverhead); + displayer.AddDisplayFunction("Self", DisplaySelfOverhead); + } } else { - displayer.AddDisplayFunction("Overhead", DisplaySelfOverhead); + if (raw_period_) { + displayer.AddDisplayFunction("Overhead", DisplaySelfPeriod); + } else { + displayer.AddDisplayFunction("Overhead", DisplaySelfOverhead); + } } if (print_sample_count) { displayer.AddDisplayFunction("Sample", DisplaySampleCount); |