commit | 355d7ba0294d439e157702a657dc3ab43e947c47 | [log] [tgz] |
---|---|---|
author | Hector Dearman <hjd@google.com> | Tue Oct 24 15:44:43 2017 +0100 |
committer | Hector Dearman <hjd@google.com> | Tue Oct 24 15:44:43 2017 +0100 |
tree | e068e402a5f2de7f4e0cc4553b9cea7a9e41e8c1 | |
parent | bd95e9b6b7961397b052ad708323695b122ac50a [diff] |
Add script to extract format files Adds a Python script which extracts all files matching: /sys/kernel/debug/tracing/events/*/*/format From an Android device into a directory named: android_productname_buildid_kernelversion (e.g. android_seed_N2F62_3.10.49) The layout of the directory matches /sys/kernel/debug/tracing/events except it only contains the 'format' files. Usage: $ .tools/extract_formats.py $ ls android_seed_N2F62_3.10.49 $ find . -type f | grep sched_switch android_seed_N2F62_3.10.49/perf_trace_counters/sched_switch_with_ctrs/format android_seed_N2F62_3.10.49/sched/sched_switch/format Change-Id: If5beb4ea98bd7f7f710bcb6ca5d33a919339a4fc
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.
All dependent libraries are self-hosted and pulled by the build/install-build-deps
script.
The only requirements on the host are python, git and a compiler (preferably clang, gcc is maintained best-effort):$ sudo apt-get update && sudo apt-get install git clang python
Then:$ git clone https://android.googlesource.com/platform/external/perfetto.git
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.
If you are a chromium developer and have depot_tools installed you can avoid the build/
prefix below and just use gn/ninja from depot_tools.
$ build/install-build-deps
to install third-party build deps (NDK etc)
$ build/gn args out/android
to generate build files and enter in the editor:
target_os = "android" # Leave empty for local testing target_cpu = "arm" or "arm64" # Only when building for Android
(See the Build Configurations section below for more)
$ build/ninja -C out/android all
TODO. The plan is to autogenerate the Android.bp build files from the master GN build files (or temporarily maintain both until we can autogenerate them).
$ build/ninja -C out/default (libtracing_unittests | libtracing_benchmarks) $ out/default/libtracing_unittests --gtest_help
Either connect a device in ADB mode or use the bundled emulator.
To start the emulator:$ build/run_android_emulator (arm | arm64) &
To run the tests (either on the emulator or physical device):$ build/run_android_test out/default libtracing_unittests
The following GN args are supported:
target_os = "android" | "linux" | "mac"
:
Defaults to the current host, set “android” to build for Android.
target_cpu = "arm" | "arm64" | "x86" | "x64"
:
Defaults to "arm"
when target_os
== "android"
, "x64"
when targeting the host. 32-bit host builds are not supported.
is_debug = true | false
:
Toggles Debug (default) / Release mode.
is_clang = true | false
:
Use Clang (default) / GCC. It requires clang 3.5+ to be installed on the host. Clang is the default compiler on Mac (% having installed Xcode). On Linux: sudo apt-get update && sudo apt-get install clang
cc = "gcc" / cxx = "g++"
:
Uses a different compiler binary (default: autodetected depending on is_clang).
is_asan = true
:
Enables Address Sanitizer
is_lsan = true
:
Enables Leak Sanitizer
(Linux/Mac only)
is_msan = true
:
Enables Memory Sanitizer
(Linux only)
is_tsan = true
:
Enables Thread Sanitizer
(Linux/Mac only)
is_ubsan = true
:
Enables Undefined Behavior Sanitizer