commit | 2ffd1a5d7b39627a5aa8085995ac5209e755e644 | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Tue Mar 27 01:01:30 2018 +0100 |
committer | Primiano Tucci <primiano@google.com> | Tue Mar 27 01:01:30 2018 +0100 |
tree | 345dcb2c2af8b8ac77e6c57d347a5648e0742b41 | |
parent | eb1e4f212a3416d9a6a7f5177be0a4d1f32cd38e [diff] |
Add support for long running traces This CL adds the ability to pass a file descriptor to the service when enabling tracing and periodically draining the trace buffers into that file directly from the service. This CL does not change the default behavior (which is: stream the trace over IPC) but allows to change it when setting |write_into_file|==true into the trace config. More in details this CL: - Adds new fields to the trace config to support passing the FD, as well as tuning the write period and max file size. - Adds an explicit OnTracingStop() notification to the Consumer, as it can no longer rely on OnTraceData(has_more==false) to determine when tracing ended. - Removes the OptimizeFor argument of TraceConfig, which ended up being never-used. - Adds a SIGINT signal handler to the perfetto cmdline client, allowing to gracefully stop the trace and get back the results when hitting CTRL-c once. - Stops using a temporary file when NOT using --dropbox, as the trace file will be valid even if not finalized. - Add large traces support to trace_to_text by tokenizing the packets before passing them to the protobuf decoder (which would accept at most a 64M protobuf) Matching SELinux CL: aosp/648831 Test: perfetto_unittests --gtest_filter=TracingIntegrationTest.* Bug: 73625179 Change-Id: I28043bdbef6cac730f1797b6bc5b72ecf0acac79
This project is meant to be built both as part of the Android tree and from a standalone checkout
For internal docs see this page
Android is the platform targeted in the first milestones. Right now Linux desktop and OSX are maintained best-effort.
This project uses Android AOSP Gerrit for code reviews and uses the Google C++ style. Currently targets -std=c++11
.
You can use both git cl upload
from Chromium depot tools or Android repo to upload patches.
git cl
is quite convenient as it supports code auto-formatting via git cl format
.
See https://source.android.com/source/contributing for more details about external contributions and CLA signing.
See docs/build_instructions.md
Continuous build and test coverage is available at perfetto-ci.appspot.com. Trybots: CLs uploaded to gerrit are automatically submitted to TravisCI within one minute and made available on the CI page above. The relevant code lives in the infra/ directory.
$ tools/ninja -C out/default (tracing_unittests | tracing_benchmarks) $ out/default/tracing_unittests --gtest_help
Either connect a device in ADB mode or use the bundled emulator.
To start the emulator:$ tools/run_android_emulator (arm | arm64) &
To run the tests (either on the emulator or physical device):$ tools/run_android_test out/default tracing_unittests