summaryrefslogtreecommitdiff
path: root/simpleperf/report_lib_interface.cpp
AgeCommit message (Collapse)Author
2020-10-23simpleperf: enable .clang-formatThiƩbaud Weksteen
Use the 2-space configuration by default and disable any formatting for the demo/ subdirectory. The following command was used to generate this change: $ find . \( -name \*.cpp -o -name \*.h \) -exec clang-format \ --style=file -i {} \; Test: mm Change-Id: I89ec1f18f6e352f40cfa1a770087f3b586b1d7cb
2020-09-09simpleperf: fix tests broken by jit symfile path change.Yabin Cui
Simpleperf checks if a path is JIT symfile by looking for a colon symbol in it. But a normal path on windows can contain colon symbols. Thus two windows tests are broken. This CL fixs them by adding a function in JITDebugReader class to check JIT symfile paths. Also fix python test TestReportLib.test_merge_java_methods. It was broken by report_lib_interface.cpp dropping support for old jit symfile paths. This CL added the support back. Also add a new test TestReportLib.test_jited_java_methods to test new jit symfile path. Bug: 167604389 Test: run simpleperf_unit_test. Test: run test.py. Change-Id: Ic0f69d224069f708fe20d79d0ce61cf63bd17e5f
2020-08-25simpleperf: export is_dynamic field in report_lib_interface.Yabin Cui
Bug: 165708389 Test: run test.py. Change-Id: I4563855ca4ae42ccee7dafdc14c8423b2e9df698
2020-08-24simpleperf: Support parsing dynamic string field of tracepoint events.Yabin Cui
Also disable hardware counter testing for cf_x86_64 targets. Bug: 165708389 Test: run simpleperf_unit_test Change-Id: Ie2f5c4c96239077d5d55023c8f2d0ffd9b838653
2020-07-28simpleperf: dump jit symfiles to a single file.Yabin Cui
Currently, each jit symfile is dumped to a distinct temporary file. This creates many temporary files, having two drawbacks: 1. It leaves many junk files if simpleperf is killed in the middle. 2. The names of the temporary files change in different recording files, making them harder to compare. This CL fixes it by making changes below: 1. Store jit symfiles in a single file. The location of a symfile is passed via a special path format: <file_path>:<file_start>-<file_end>. So the unwinder and ElfFile class can read it correctly. 2. Add Dso::GetReportPath() to give a unified name for jit symfiles. And use it in different reporting methods. Also split JITDebugReader::ReadProcess() into smaller functions. Bug: 159155297 Test: run simpleperf_unit_test Test: run simpleperf manually Change-Id: I37cd1888b855b4b88bb83e453e39230b96fb304f
2019-10-08simpleperf: merge jitted and interpreted java methods.Yabin Cui
Bug: 132370901 Test: run test.py TestReportLib.test_merge_java_methods. Change-Id: I9e2cc9a0db6a6f94611947c4f146a51aff85d593
2019-09-04simpleperf: support profiling art interpreter on linux host.Yabin Cui
Bug: 140300587 Test: run simpleperf_unit_test. Test: run simpleperf on host. Change-Id: Ia2e21cabf2661c82bb611c525d5277b1e4d13a23
2019-07-18simpleperf: set scoped arch and event types in RecordFileReader.Yabin Cui
To record on device and report on host, simpleperf keeps arch type and event types in perf.data. Currently, RecordFileReader needs its users to read and set the arch type and event types properly. This patch changes to let RecordFileReader set arch type and event types. It avoids repeating the effort in users of RecordFileReader. Bug: none Test: run simpleperf_unit_test. Test: run simpleperf record on device, and report it on host. Change-Id: Ief637ca6e2c3acfbf74b6447ef7ff0679439ca1d
2018-08-14simpleperf: fix removing ART frames.Yabin Cui
ART frames can also exist before or after JITed Java methods. Bug: none Test: run report_html.py manually, and check that ART frames Test: near JITed Java methods are removed. Change-Id: I771cb7503bb62e8d0fc71167bfd887abe069554f
2018-06-19simpleperf: export tracing info in python interface.Yabin Cui
Also use property methods instead of wrapper classes to convert bytes to str in python3. Bug: 110233215 Test: run test.py. Change-Id: I396786d35df7642707df17bbd86e76508e2fa4e9
2018-04-13simpleperf: remove Java interpreter frames by default.Yabin Cui
In the callchains of interpreted Java code, two Java frames are separated by several interpreter frames, which make it harder for users to find Java frames. So this patch removes Java interpreter frames by default in report-sample command output and report_lib_interface. But it also provides the ability to show Java interpreter frames via --show-art-frames option. Bug: http://b/73126888 Test: run simpleperf_unit_test. Test: run test.py. Change-Id: I9a89e2f6679dc1455df8c669628fce198ae7d576
2017-11-08simpleperf: fix parsing perf.data generated by --trace-offcpu option.Yabin Cui
When parsing perf.data generated by --trace-offcpu option, report_lib_interface mixes all samples from cpu-cycles (or other events) and sched:sched_switch, and uses timestamp difference as sample period. However, it still shows both event names. This makes report_html.py generate sample table for each event name separately. To fix this, this CL uses event name cpu-cycles for all samples. Bug: http://b/66914187 Test: run report_html.py on perf.data generated by --trace-offcpu. Test: run python test.py TestReportLib.test_offcpu. Change-Id: Ic5f2e64564355f860283085fc691ead4134affa1
2017-10-17simpleperf: export symbol_len in report lib interface.Yabin Cui
It helps to set the range of a function when annotating source code and disassemble code. Also add comments in simpleperf_report_lib.py to make the meaning of the structures clear. Bug: http://b/66914187 Test: run test.py TestReportLib. Change-Id: I1be996df8062ddb6759e9f98e0400f3a4df7efb6
2017-08-14simpleperf: export more info through report_lib_interface.Yabin Cui
Make below changes to better suppport inferno: 1. Save product properties of device in perf.data. 2. Add a python/c api GetFeatureSection. It is used to support reading record cmd and meta info from perf.data. 3. Remove old api GetNextMetaInfo, because meta info can be exported by GetFeatureSection more easily. 4. When reading perf.data in record_file_reader.cpp, remove callchain at and below ip == 0 to avoid caller's effort. Also move to use android-base/properties.h. Bug: http://b/64035530 Test: run simpleperf_unit_test and test.py. Change-Id: Ib6743a09167e2b7cd65a12f17d991bc1ac628588
2017-07-25simpleperf: support reporting trace offcpu data in simpleperf_report_lib.Yabin Cui
Export python interface for reading meta info. Change sample.period to sample time difference when trace_offcpu is true. Add unit tests. Bug: http://b/37572306 Test: run python test.py. Change-Id: Ic144314184d115cc55630d3c69b66a0d8594721a
2017-03-17simpleperf: add script to generate proto data used by pprof.Yabin Cui
Also change Addr2Line to support inline functions. Bug: http://b/35726123 Test: run gen_pprof_proto.py manually. Change-Id: Ia2f84ac142e7075ea902f3456235db24567e4fcd
2017-02-23simpleperf: generate one report for each event attr.Yabin Cui
Bug: http://b/35475170 Test: run simpleperf_unit_test. Test: run report.py. Change-Id: Ie9329a64c701bce38f7b440c16cb47e99e83db45
2016-11-29simpleperf: add stuff in report_lib_interface.Yabin Cui
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
2016-11-16Support to use kallsymsDaniel Friederich
Also: - Adapt to use with Python 3 (where str is a wide type but our C API's expect 8 bit character strings) - Use OS specific so names (e.g. simpleperf_report.dll on Windows) - On Windows as we use mingw to build, preload libwinpthread-1.dll. Test: with manual incovation using report_sample.py Change-Id: Id973c463608c520b8eec229026c74dc5e8144cf8
2016-11-14Support for multiple instancesDaniel Friederich
Allows to use separate instances for separate perf.datai files (and possibly also separate instances on separate threads) Test: Tested by running report_sample.py Change-Id: I0ebdb3c650a4540f07237b515d451d69ec3810e6
2016-11-04simpleperf: make file feature section used in more report commands.Yabin Cui
Bug: http://b/32340274 Test: run simpleperf_unit_test. Change-Id: I0bed466c145fdbb2988308f56a031c06bad16352
2016-09-29Simpleperf: don't expose EventSelection.Yabin Cui
And some tiny improvements. Bug: http://b/30974760 Test: run simpleperf_unit_test. Change-Id: Ie2d46c8ab9ee763d107527c9a54590f845569da4
2016-08-30simpleperf: add python report interface on linux.Yabin Cui
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