History log of /system/extras/simpleperf/record_file_reader.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
df6333c5f5a34d4b7853c4671a53fcfd9e5a0b88 04-May-2017 Yabin Cui <yabinc@google.com> simpleperf: add META_INFO feature section in perf.data.

META_INFO section can be used to pass some small information
in perf.data.

Add simpleperf_version in META_INFO section for debugging.

Bug: http://b/37960318
Test: run simpleperf_unit_test.
Change-Id: If17a147bbc77b5af063fbf77e02ca81430afb8a5
/system/extras/simpleperf/record_file_reader.cpp
ada97db3d4336faac601663e8bb4b59835ae49a0 24-Feb-2017 Yabin Cui <yabinc@google.com> simpleperf: generate one report for each event attr.

Bug: http://b/35475170
Test: run simpleperf_unit_test.
Test: run report.py.
Change-Id: Ie9329a64c701bce38f7b440c16cb47e99e83db45
/system/extras/simpleperf/record_file_reader.cpp
044861ba8d71688940b6500f68458fae0791517c 14-Dec-2016 Yabin Cui <yabinc@google.com> simpleperf: check invalid perf.data.

Bug: http://b/33558210
Test: run simpleperf_unit_test.
Change-Id: If5a1f7fc9c436a39776f80f1e52479f1cd7ff407
/system/extras/simpleperf/record_file_reader.cpp
c24dd76c350b6880df5f1398f9a8fe0d1cff0948 11-Nov-2016 Yabin Cui <yabinc@google.com> simpleperf: fix unaligned data access on arm.

Bug: http://b/32340274
Test: run `simpleperf record --dump-symbols` manually.
Test: run simpleperf_unit_test.
Change-Id: I771a516bb644f18fafa987061ecfc76ae3521ca9
/system/extras/simpleperf/record_file_reader.cpp
010b232198b1eab7c9fcba099a5565b03faba695 05-Nov-2016 Yabin Cui <yabinc@google.com> simpleperf: make file feature section used in more report commands.

Bug: http://b/32340274
Test: run simpleperf_unit_test.
Change-Id: I0bed466c145fdbb2988308f56a031c06bad16352
/system/extras/simpleperf/record_file_reader.cpp
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/record_file_reader.cpp
0f6df013be40459a1b4013bdad8ec0a82c18ce9a 22-Oct-2016 Yabin Cui <yabinc@google.com> simpleperf: fix dumping build id.

1. Dump build id for binaries hit by callchain ips.
2. Fix a memory used after free bug in ReadBuildIdFeature().

Bug: http://b/32340274
Test: simpleperf_unit_test.
Test: check output of `simpleperf dump` manually.
Change-Id: I0132e5ce0e06096413231325e9f1d215143eedd2
/system/extras/simpleperf/record_file_reader.cpp
2cb0a666a2f3c3dd968340512cc20abf77cc670a 31-Aug-2016 Yabin Cui <yabinc@google.com> Merge "simpleperf: add python report interface on linux."
a447c0d5f1d5227af30c0cbb4320ad878bd78c43 26-Aug-2016 Yabin Cui <yabinc@google.com> simpleperf: add python report interface on linux.

1. Build libsimpleperf_report.so on host, which exports functions
to access samples.
2. Add simpleperf_report_lib.py to wrap libsimpleperf_report.so.
3. Write report_sample.py to test simpleperf_report_lib.py. The
output format of report_sample.py matches the need of building
FlameGraph.

Bug: http://b/31069528
Test: run report_sample.py on perf.data.
Test: run simpleperf_unit_test.

Change-Id: I4949f8ea506f12101a9c4fb4c896957c96676853
/system/extras/simpleperf/record_file_reader.cpp
eafa7188ac41584555d36ac0c19f3c7fc66d42cc 30-Aug-2016 Yabin Cui <yabinc@google.com> simpleperf: fix two errors.

Fix two errors when reporting perf.data generated by linux perf.
And add corresponding tests.

Test: run simpleperf_unit_test.
Change-Id: I04dd88461fdd6a85763847570bac16db1ccb81fa
/system/extras/simpleperf/record_file_reader.cpp
825e56be3a1c5310969aaa3e10a7cd1f63455189 27-Aug-2016 Yabin Cui <yabinc@google.com> simpleperf: support hotplug events in record cmd.

1. When a cpu is down, read records from event files on that cpu,
then close those event files.
2. When a cpu is up, open event files on that cpu, and create
mapped buffer for those event files to dump records.
3. Instead of creating a mapped buffer for each event type on each
cpu, we can just create a mapped buffer for all event types on
each cpu.
4. When new event files are created, store a EventIdRecord record in
perf.data to notify record_file_reader.cpp.

Bug: http://b/29245608
Test: run simpleperf record cmd and make cpu offline and online.
Test: run simpleperf_unit_test.

Change-Id: Ib97a24b6292fa143e9b35cb105bdddf1e826d60a
/system/extras/simpleperf/record_file_reader.cpp
190a848fb2d4f502372b2528c55ca1f520e90609 04-Aug-2016 Yabin Cui <yabinc@google.com> simpleperf: keep binary in class Record.

It removes memory copy and heap allocation/deallocation in
Record::BinaryFormat(), and is a preparation to remove memory
copy and heap allocation in Record constructor.

Bug: 30649868
Test: run simpleperf_unit_test.
Change-Id: Ic8dd80e43f7b547a9beaf896d726b56aeb5d55a2
/system/extras/simpleperf/record_file_reader.cpp
3e4c5950f3aafb0bf66544468d98ee3ec26b705c 27-Jul-2016 Yabin Cui <yabinc@google.com> simpleperf: use libevent in stat command.

Wrap libevent in IOEventLoop, use IOEventLoop in stat command.
Add corresponding tests.

Bug: http://b/30405638
Change-Id: I78b79e0eff1365ab46dde29c2a24a2def586af79
Test: run simpleperf_unit_test.
/system/extras/simpleperf/record_file_reader.cpp
1761a271faf98050891ba6e918993225782c811a 24-Jun-2016 Yabin Cui <yabinc@google.com> Simpleperf: Add SPLIT and SPLIT_END records to handle big records.

Previously we split KernelSymbolRecord because it is > 65535. Then
I found TracingDataRecord can also be > 65535. So it is better to
handle big records when reading and writing perf.data.
record_file_writer.cpp splits a big record into multiple SPLIT
records followed by a SPLIT_END record, and record_file_reader.cpp
restores the big record when reading SPLIT and SPLIT_END records.
Also Add RecordHeader to represent record having size > 65535.

Bug: 29581559
Change-Id: I0b4556988f77b3431c7f1a28fce65cf225d6a067
Test: run simpleperf_unit_test.
/system/extras/simpleperf/record_file_reader.cpp
4f41df6f68efc3b9b534014a8cfb6ee8ac4d5c91 02-Jun-2016 Yabin Cui <yabinc@google.com> simpleperf: dump tracing data when needed.

When monitoring tracepoint events, dump tracing data to perf.data
can enable reporting on a different machine.

Bug: 27403614
Change-Id: Ie1af624717a245cacbeb44b4c1bcd499fc9ad8db
/system/extras/simpleperf/record_file_reader.cpp
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/record_file_reader.cpp
2d6efe4b167da4e6b77f168b1820239ee65599e2 02-Apr-2016 Yabin Cui <yabinc@google.com> simpleperf: support reporting more than one event type.

When sampling kernel trace points, it is like to sample more than
one even type. Like `simpleperf record -e kmem:mm_page_alloc,kmem:mm_page_free`.

1. change record command to dump event_id for all records.
2. change report command and record reader to support multiple
event attrs.
3. hide record_cache inside EventSelectionSet.
4. add test to report multiple event types.

Bug: 27403614
Change-Id: Ic22a5527d68e7a843e3cf95e85381f8ad6bcb196
/system/extras/simpleperf/record_file_reader.cpp
dd2ae2878b7e5ac1754da55a08cbcdacadf53d78 16-Feb-2016 Yabin Cui <yabinc@google.com> simpleperf: accept different perf_attr sizes.

The size of perf_attr can be increased as new features are added. And
we can accept different perf_attr sizes in perf.data, and ignore
unknown features.

Change-Id: Ia42617f92acb3ab6ae56eb91aa0d7b73efc0b8af
/system/extras/simpleperf/record_file_reader.cpp
ffaa912ca48e87d25d516780c15cdd7c50de43db 16-Jan-2016 Yabin Cui <yabinc@google.com> Simpleperf: support build for windows.

Change-Id: I31554f36ee97eb0ae27bda9b77e29410776925e2
/system/extras/simpleperf/record_file_reader.cpp
66dd09e8e2407082ce93bf0784de641298131912 04-Dec-2015 Elliott Hughes <enh@google.com> Track rename from base/ to android-base/.

Change-Id: Ic15d4778c7accd1382de0b440a437aba2cf67016
/system/extras/simpleperf/record_file_reader.cpp
b7f481f59126456b0e708a76f40fa88224f3531b 24-Oct-2015 Yabin Cui <yabinc@google.com> Simpleperf: Don't load whole perf.data into memory.

perf.data can be too large to be loaded into memory.
To avoid this, use fread() instead of mmap() to read perf.data,
and always use RecordCache to sort records.

Fix unit tests failure caused by previous change.

Bug: 25194400

Change-Id: If29dc0bb0ed992ba34202c2cb1a204a1d9123b7a
/system/extras/simpleperf/record_file_reader.cpp
73d8078e6e5ef92b2301386ce96260bd99efacbb 24-Jul-2015 Yabin Cui <yabinc@google.com> Simpleperf: use ThreadTree when getting hit files in record command.

The new method is more accurate and has lower time complexity.

Bug: 22229391
Change-Id: I8b3016798b8a0e20335adeb7ec5dda0068044142
/system/extras/simpleperf/record_file_reader.cpp
f1732eeda661c221ce52a1d9506e9e52db8bf377 14-Jul-2015 Yabin Cui <yabinc@google.com> Merge "Simpleperf: Support dwarf callgraph recording."
76769e502d8f0ebf5d2c81b00246727fb0a59925 13-Jul-2015 Yabin Cui <yabinc@google.com> Simpleperf: Support dwarf callgraph recording.

1. add OS_RELEASE and ARCH feature in perf.data. ARCH feature is used when parsing
recorded user registers.
2. support `--call-graph dwarf` option in record command.

Bug: 22229391
Change-Id: I56dbdd101338658ce6a9b59aa8be90e712e007f5
/system/extras/simpleperf/record_file_reader.cpp
c8ffe576f0c099c4c94ebf28a3afd58dee1cc330 13-Jul-2015 Yabin Cui <yabinc@google.com> Simpleperf: remove unnecessary std::move.

Bug: 19483574
Change-Id: I2b49ded640c799058b448ddce7f92b5cecd86de3
/system/extras/simpleperf/record_file_reader.cpp
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/record_file_reader.cpp
9fd3cc1048a3d0338df4a48760dfd655560992a1 26-Jun-2015 Yabin Cui <yabinc@google.com> Simpleperf: support build on mac.

Bug: 19483574
Change-Id: I6c28541944bc0a4e6fc07d7ea5a8fb5f71890510
/system/extras/simpleperf/record_file_reader.cpp