simpleperf: Improve Callgraph.
1. Reduce columns used by callgraph by reducing spaces between
entries from 11 to 4. This helps to show more entries in the limited screen width.
2. Add [hit-in-function] line for each entry, so we know the percentage
of samples hit in the function and samples hit in the children functions.
3. Add --kallsyms option for report command.
After all, The callgraph is changed like below.
Before change:
|--99.08%-- java.lang.Thread.run
| void com.example.cyb.tappydefender.TDView.run()
| |
| | |--95.63%-- void com.example.cyb.tappydefender.TDView.draw()
After change:
|--98.85%-- java.lang.Thread.run
| void com.example.cyb.tappydefender.TDView.run()
| |--0.09%-- [hit in function]
| |
| |--95.54%-- void com.example.cyb.tappydefender.TDView.draw()
Bug: http://b/33356538
Test: run simpleperf_unit_test.
Test: run simpleperf report -g manually.
Change-Id: Ifc1846d4ee7469cadbcc727cae6bf59552d919d5
diff --git a/simpleperf/cmd_report_test.cpp b/simpleperf/cmd_report_test.cpp
index f34be5c..16b2f69 100644
--- a/simpleperf/cmd_report_test.cpp
+++ b/simpleperf/cmd_report_test.cpp
@@ -437,6 +437,12 @@
ASSERT_NE(content.find("89.03"), std::string::npos);
}
+TEST_F(ReportCommandTest, kallsyms_option) {
+ Report(PERF_DATA, {"--kallsyms", GetTestData("kallsyms")});
+ ASSERT_TRUE(success);
+ ASSERT_NE(content.find("FakeKernelSymbol"), std::string::npos);
+}
+
#if defined(__linux__)
#include "event_selection_set.h"