History log of /system/extras/simpleperf/dso.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a939245000a86f6749b10f007e3b5a38d61f67c7 13-Jan-2017 Yabin Cui <yabinc@google.com> simpleperf: fix dumpping kernel symbols.

Fix the bug that `simpleperf record --dump-symbols` doesn't dump
kernel symbols.

Test: run simpleperf_unit_test.
Change-Id: I55a2b7c5cd40395b61b062064834779a6a44a29e
/system/extras/simpleperf/dso.h
52c6369cd3bc5dfb5f05b4e3b2c66aec47065c04 29-Nov-2016 Yabin Cui <yabinc@google.com> simpleperf: add stuff in report_lib_interface.

It's a preparation to annotate binaries, containing following
changes:
1. Export build_id for binaries.
2. Export function virtual addresses.
3. Add unit tests in simpleperf_report_lib.py.

Bug: http://b/32834638
Test: simpleperf_unit_test.
Test: run `python simpleperf_report_lib.py`.
Change-Id: Ieed40935ff9ede44bf823ba9c88ad87806ffac0a
/system/extras/simpleperf/dso.h
aba7e29f163b4a332a9d3fe9973d82c7d0db148f 11-Nov-2016 Yabin Cui <yabinc@google.com> simpleperf: dump only needed symbols in file feature section.

Instead of dumping all symbols in the hit elf files, dump only
needed symbols can save a lot of space. To do so, read perf.data
after recording to collect hit file and symbol information.

Bug: http://b/32340274
Test: test using `simpleperf record --dump-symbols` manually.
Test: run simpleperf_unit_test.
Change-Id: I480f3e2e7ccebfbb5df16a597724f5f40d62c821
/system/extras/simpleperf/dso.h
16501ffbd73483c498dde1ea4ad2670da7c9df55 20-Oct-2016 Yabin Cui <yabinc@google.com> simpleperf: use file records in protobuf output.

Dump file name and symbol name for each CallChainEntry
takes too much space. So instead we store file_id and
symbol_id for each CallChainEntry, and store file
records separately.

In CallChainEntry, replace ip with vaddr_in_file, because
vaddr_in_file is more useful in finding instructions in
elf file.

Bug: http://b/32210800
Test: simpleperf_unit_test.
Change-Id: I85542db21acbaa4d81b3c3aa7f9215f2d23c4878
/system/extras/simpleperf/dso.h
c5b4a3106a0845d1bd8fd2c1b1c724eeb719ec62 24-Oct-2016 Yabin Cui <yabinc@google.com> simpleperf: dump file feature section.

For `record --dump-symbols` option, change from dumping
DsoRecord and SymbolRecord to dumping file feature section.
It is to avoid reading symbols from elf files during recording,
which takes a lot of time. And we don't want to mix optional
data (the symbol tables) with necessary data (the profiling records).

Bug: http://b/32340274
Test: run simpleperf_unit_test.
Test: run simpleperf runtest.py.

Change-Id: I0a387de243afac93486fc885f223a58060ec07f4
/system/extras/simpleperf/dso.h
78fddd140931adf704061f82e3c9fcb03362f8d0 24-Oct-2016 Yabin Cui <yabinc@google.com> simpleperf: use Dso::IsHit() to mark hit binaries.

Bug: http://b/32340274
Test: simpleperf_unit_test.
Change-Id: I074973cdc0420d28c7dfcaca80e477234bceec95
/system/extras/simpleperf/dso.h
15475e6ff1bc0273f666ef1bd6c2f7a50c4b948c 14-Jul-2016 Yabin Cui <yabinc@google.com> simpleperf: show dso[+vaddr_in_file] for unknown symbols.

It gives more information than just unknown symbols.
Add --no-show-ip option to disable this additional detail.

Bug: 29772268
Change-Id: Ie8067f95b5fdc65806044e229ee12095367d115a
Test: run simpleperf_unit_test.
/system/extras/simpleperf/dso.h
c855ecc6becfe5d1c2445094aa525856e4538f7c 12-Jul-2016 Yabin Cui <yabinc@google.com> simpleperf: add min_vaddr in DsoRecord.

Min virtual address of a shared library is needed when mapping ip
addresses to function symbols. So we should dump it in DsoRecord.

Bug: 28114205
Test: run simpleperf_unit_test.

Change-Id: Ib986ee598281cf60caa3a2c5408100b9e7678143
/system/extras/simpleperf/dso.h
eec606cfefcb8cb20ac0f9e3465daff09fb31ffd 07-Jul-2016 Yabin Cui <yabinc@google.com> simpleperf: fix build id check of files in symfs.

In dso.cpp, build_id_map_ should use path_ instead of GetAccessiblePath() as the key.
However, patch https://android-review.googlesource.com/#/c/175654/ wrongly used
GetAccessiblePath() as the key in build_id_map_. This patch fixes the error and add
corresponding test.

Check if file in symfs exists before using it as debug file path.
If the build id of debug file path doesn't match the one in build_id_map_, output
warning to user.

Bug: 28911532
Test: run simpleperf_unit_test.
Change-Id: I21bca508359a492245db4cba5d287005363cd465
/system/extras/simpleperf/dso.h
767dd17947f1ae9dd3d02f738d442a23ed76f2f6 03-Jun-2016 Yabin Cui <yabinc@google.com> simpleperf: add report-sample command.

1. Add report-sample command to report each sample with symbol information.
2. Add --dump-symbols option to record command to collect dso and symbol
information in perf.data.

Bug: 28114205

Change-Id: I37424ee6abd74a21ad41cd3b6c4249cf0625c201
/system/extras/simpleperf/dso.h
b42129797f17f990ea5a88c6bdc7446000cc361c 25-May-2016 Yabin Cui <yabinc@google.com> simpleperf: record kernel symbols in perf.data.

To better support kernel profiling, record kernel symbols in perf.data
when necessary. An option --no-dump-kernel-symbols is added in
record command to always avoid recording kernel symbols.
The way to handle all zero /proc/modules and /proc/kallsyms is
improved. Add Better support in finding symbols for kernel modules.

Bug: 27403614
Change-Id: I470151c54f8a45ad1c101c1b94490e33d7fd7485
/system/extras/simpleperf/dso.h
b1a885b014540a2f7798b5a35ea0f0ec150d93ee 15-Feb-2016 Yabin Cui <yabinc@google.com> simpleperf: report symbols of native libraries in apk file.

Changes included:
1. provide interface in read_apk.h to read build id and symbols.
2. report symbols of native libraries in apk file.
3. refactor code in read_elf.cpp and read_apk.cpp.
4. add verbose log.
5. add -o report_file_name option for report command.
6. add corresponding unit tests.

Bug: 26962895
Change-Id: I0d5398996e0c29dba4a6f5226692b758ca096bbd
/system/extras/simpleperf/dso.h
547c60e4dd29c5788d5948ad348acf33a55d6ed6 13-Oct-2015 Yabin Cui <yabinc@google.com> Simpleperf: fix some unknown symbols for report result.

Using debug shared libraries in /usr/lib/debug on linux host.
Match ip addresses with symbols by symbols' virtual addresses instead of
file offsets in elf file. Because symbols' file offsets in debug shared
libraries are different from those in original shared libraries.

Fix overlapped maps.

Bug: 24716851
Change-Id: I9cb64958c4de5c7a6c77c3febc5f689cf2df650f
/system/extras/simpleperf/dso.h
3c8c21345478816dd0c70c096090b564c91bd9d2 14-Aug-2015 Yabin Cui <yabinc@google.com> Simpleperf: support dwarf callgraph in report command.

Use libbacktrace for stack unwinding.

Bug: 22229391
Change-Id: Iab35cdb52936c65c4728e23423ded83050f1db76
/system/extras/simpleperf/dso.h
cc2e59e2478d330c89eaceda0dcc1f05ee32fbf8 21-Aug-2015 Yabin Cui <yabinc@google.com> Simpleperf: use OneTimeFreeAllocator to allocate symbol names.

simpleperf report takes a lot of time mallocing and freeing memory.
This change reduces the time to free memory.

Before this change:
$sudo simpleperf stat simpleperf report
Performance counter statistics:

3,258,481,203 cpu-cycles # 2.290946 GHz (80%)
4,147,660,154 instructions # 0.785619 cycles per instruction (79%)

Total test time: 1.422330 seconds.

After this change:
$sudo simpleperf stat simpleperf report
Performance counter statistics:

1,699,221,386 cpu-cycles # 2.994754 GHz (79%)
2,739,945,156 instructions # 0.620166 cycles per instruction (81%)

Total test time: 0.567399 seconds.

This change also fix a bug in record_file_test.cpp.

Bug: 23387541

Change-Id: I59fc86ca54a6c09bd08eec8ada931ccff88d3102
/system/extras/simpleperf/dso.h
c84856093e8bf4350d30fc521dc0f1c800c5270b 21-Aug-2015 Yabin Cui <yabinc@google.com> Simpleperf: refactor dso.

Having DsoEntry and DsoFactory confuses me which part code should belong to.
This change merges the two into class Dso and makes things clear.
It is also a preparation for performance optimization in Dso.

Bug: 23387541
Change-Id: I41e773406a7f1582a11a18859df252ce8ea3acfa
/system/extras/simpleperf/dso.h
b10a8fb990f71351558ed07b84b57ad5cafe993a 19-Aug-2015 Yabin Cui <yabinc@google.com> Simpleperf: demangle symbols only when necessary.

Before this change:
$sudo simpleperf record -a sleep 1
$sudo simpleperf stat simpleperf report
Total test time: 4.088779 seconds.

After this change:
$sudo simpleperf record -a sleep 1
$sudo simpleperf stat simpleperf report
Total test time: 1.226267 seconds.

Change-Id: Ifc811f432ac69f770eeb5814e4983f6f19dbc909
/system/extras/simpleperf/dso.h
ba50c4bba1c3ea7e98a475a3d2ae2e6c24ee81f2 21-Jul-2015 Yabin Cui <yabinc@google.com> Simpleperf: load symbols from dso file only when necessary.

Bug: 22630113
Change-Id: I12bb24ec02ba3ddb94bcb2a26ae2d6e7b445ed4d
/system/extras/simpleperf/dso.h
39d3caeb60a913276a2bbaa35f6a28dc3284eb52 14-Jul-2015 Yabin Cui <yabinc@google.com> Simpleperf: support --vmlinux option in report command.

Bug: 22179177
Change-Id: I633da55c6bfcb106d69de9bda6b44bce24ffca8e
/system/extras/simpleperf/dso.h
638c558339b7f1ae0ed95f64bcf7dbc5b238ed83 02-Jul-2015 Yabin Cui <yabinc@google.com> Simpleperf: check build id in report command.

1. refactor BuildId type.
2. check build id before parsing symbols in report command.

Bug: 22179177

Change-Id: Iefc797a88d4a168e109db786105120c8d6914369
/system/extras/simpleperf/dso.h
b378355f34b2b585eaf2be262bcd9baae9f3d36a 11-Jun-2015 Yabin Cui <yabinc@google.com> Simpleperf: improve symbol parsing.

Support c++ symbol demangling, and add option to disable it.
Add option to set symfs dir, so it can report on host.
Add label symbols, add add symbol length fixing for it.
Add two hacks about arm elf symbol parsing.

Bug: 19483574

Change-Id: I300d6c007c8634db382d0a50627b9cde1502df89
/system/extras/simpleperf/dso.h
ec12ed9010128483993a87d68edc02d3a89d56cf 08-Jun-2015 Yabin Cui <yabinc@google.com> Simpleperf: support symbol parsing in report command.

Also fix the storage of ProcessEntry.

Bug: 19483574
Change-Id: I2182a804f6ecbd28e7aa3c1a38a6f19b86f583c9
/system/extras/simpleperf/dso.h