The UMA startup profiler works on Win and Mac, and code lives in base/profiler. This needs be supported on Android. We need to fix stack unwinding on devices and symbolization of the frames.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/buildtools/+/4ae75c1f8188282a68ecdcc28231585181af4a19 commit 4ae75c1f8188282a68ecdcc28231585181af4a19 Author: Siddhartha <ssid@chromium.org> Date: Thu Jul 12 17:57:45 2018 Add components/tracing in visibility for libunwind This is used for sampling profiler to unwind android arm stack frames. Bug: 859260 Change-Id: I907f321c19aec76fad82793f84f380402b4c3d08 [modify] https://crrev.com/4ae75c1f8188282a68ecdcc28231585181af4a19/third_party/libunwind/BUILD.gn
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c commit e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c Author: Siddhartha <ssid@chromium.org> Date: Tue Jul 31 22:29:06 2018 Implement stack unwinder for sampling on Android The CFI unwinder only works for chrome stack frames. Write a hybrid unwinder which can use libunwind for android and CFI unwinder for chrome. Does not support unwinding in x86 and arm 64bit builds. It supports pausing a different thread and unwinding frames on that thread. This will be useful for UMA sampling profiler and tracing profiler. BUG=859260 Change-Id: I208b9b21c8f6a73a4d593f1446095da92c0cb848 Reviewed-on: https://chromium-review.googlesource.com/1132144 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Reviewed-by: David Turner <digit@chromium.org> Cr-Commit-Position: refs/heads/master@{#579598} [modify] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/base/trace_event/cfi_backtrace_android.cc [modify] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/base/trace_event/cfi_backtrace_android.h [modify] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/base/trace_event/cfi_backtrace_android_unittest.cc [modify] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/components/BUILD.gn [modify] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/components/tracing/BUILD.gn [add] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/components/tracing/common/stack_unwinder_android.cc [add] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/components/tracing/common/stack_unwinder_android.h [add] https://crrev.com/e8c7ab52a28546aa4968fa5e92ba3cce0ee9731c/components/tracing/common/stack_unwinder_android_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a9b9c6044da99115c7e66804fd29b22db5e7772a commit a9b9c6044da99115c7e66804fd29b22db5e7772a Author: Siddhartha <ssid@chromium.org> Date: Fri Aug 17 04:46:05 2018 Android: Add preference enabling for startup tracing This CL sets up a preference for enabling startup tracing if needed. Early java tracing is enabled if the preference is set. This will be used by background tracing to setup startup tracing. BUG=859260 Change-Id: Idf2c6cbfb8c2a4d5e1765a1d2c3256abe69368fe Reviewed-on: https://chromium-review.googlesource.com/1159116 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Tommy Nyquist <nyquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#583963} [modify] https://crrev.com/a9b9c6044da99115c7e66804fd29b22db5e7772a/base/BUILD.gn [modify] https://crrev.com/a9b9c6044da99115c7e66804fd29b22db5e7772a/base/android/early_trace_event_binding.cc [add] https://crrev.com/a9b9c6044da99115c7e66804fd29b22db5e7772a/base/android/early_trace_event_binding.h [modify] https://crrev.com/a9b9c6044da99115c7e66804fd29b22db5e7772a/base/android/java/src/org/chromium/base/EarlyTraceEvent.java [modify] https://crrev.com/a9b9c6044da99115c7e66804fd29b22db5e7772a/base/android/javatests/src/org/chromium/base/EarlyTraceEventTest.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe commit 34f5ae8cad2a760f105478f6e4d0c68af4ff11fe Author: Siddhartha <ssid@chromium.org> Date: Sat Aug 18 05:21:48 2018 Get useful startup traces from background tracing on Android The startup category in background tracing is not useful to trigger with a histogram since it has to start early at startup for getting useful information. The startup category will set a flag in app preferences and start tracing next time chrome starts and upload a report. We can keep having session consistency for the trials, with startup traces being uploaded one session after the config was seen. BUG=859260 Change-Id: I588cb5ebd21e96abe9230718f69775d271f827f5 Reviewed-on: https://chromium-review.googlesource.com/1155996 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: oysteine <oysteine@chromium.org> Cr-Commit-Position: refs/heads/master@{#584303} [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/chrome/browser/tracing/background_tracing_field_trial.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/chrome/browser/tracing/background_tracing_field_trial_unittest.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/components/tracing/common/trace_startup.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/components/tracing/common/trace_startup_config.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/components/tracing/common/trace_startup_config.h [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/BUILD.gn [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/browser_main_runner_impl.cc [add] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/tracing/background_startup_tracing_observer.cc [add] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/tracing/background_startup_tracing_observer.h [add] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/tracing/background_startup_tracing_observer_unittest.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/tracing/background_tracing_manager_browsertest.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/tracing/background_tracing_manager_impl.cc [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/browser/tracing/background_tracing_manager_impl.h [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/content/test/BUILD.gn [modify] https://crrev.com/34f5ae8cad2a760f105478f6e4d0c68af4ff11fe/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/24c207be70b03c5fc4064059220ab752c002631e commit 24c207be70b03c5fc4064059220ab752c002631e Author: Siddhartha <ssid@chromium.org> Date: Tue Aug 21 04:53:35 2018 Make trace buffer size configurable Add a config param to limit the total trace buffer size BUG=859260 Change-Id: Ic15e5aa0d381273eadcdad270d955441386cd288 Reviewed-on: https://chromium-review.googlesource.com/1182510 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: oysteine <oysteine@chromium.org> Cr-Commit-Position: refs/heads/master@{#584654} [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/base/trace_event/trace_config.cc [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/base/trace_event/trace_config.h [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/base/trace_event/trace_config_unittest.cc [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/base/trace_event/trace_event_unittest.cc [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/base/trace_event/trace_log.cc [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/base/trace_event/trace_log.h [modify] https://crrev.com/24c207be70b03c5fc4064059220ab752c002631e/components/tracing/common/trace_startup_config.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1b78eb279c14a33128e4cd9149935c9154fca73f commit 1b78eb279c14a33128e4cd9149935c9154fca73f Author: Siddhartha <ssid@chromium.org> Date: Tue Aug 28 00:35:17 2018 Write wrapper for native stack sampler on Android The wrapper implements NativeStackSampler for sampling profiler and uses StackUnwinderAndroid internally. Add support for using custom sampler implementation in StackSamplingProfiler for being able to sample on Android. BUG=859260 Change-Id: Iee066af3f331a2378034afa34a6849cc7946dbfa Reviewed-on: https://chromium-review.googlesource.com/1187887 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Cr-Commit-Position: refs/heads/master@{#586523} [modify] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/base/profiler/stack_sampling_profiler.cc [modify] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/base/profiler/stack_sampling_profiler.h [modify] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/components/tracing/BUILD.gn [add] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/components/tracing/common/native_stack_sampler_android.cc [add] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/components/tracing/common/native_stack_sampler_android.h [modify] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/1b78eb279c14a33128e4cd9149935c9154fca73f/components/tracing/common/stack_unwinder_android.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2128571734486794d86c94e86b0d3efea079b1f8 commit 2128571734486794d86c94e86b0d3efea079b1f8 Author: Siddhartha <ssid@chromium.org> Date: Thu Aug 30 01:26:30 2018 Manage ownership of TraceLog observers in TraceLog if needed There are many TraceLog observers that are just tracing clients which add a feature to tracing. These features are expected to live as long as tracing is possible. So, make TraceLog own such observers instead of creating singletons everywhere. BUG=859260 Change-Id: Iebdaf128f11373f19a27415b66b256ef9a2c72f3 Reviewed-on: https://chromium-review.googlesource.com/1195847 Reviewed-by: oysteine <oysteine@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Reviewed-by: agrieve <agrieve@chromium.org> Commit-Queue: Siddhartha S <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#587369} [modify] https://crrev.com/2128571734486794d86c94e86b0d3efea079b1f8/base/android/trace_event_binding.cc [modify] https://crrev.com/2128571734486794d86c94e86b0d3efea079b1f8/base/trace_event/trace_event_unittest.cc [modify] https://crrev.com/2128571734486794d86c94e86b0d3efea079b1f8/base/trace_event/trace_log.cc [modify] https://crrev.com/2128571734486794d86c94e86b0d3efea079b1f8/base/trace_event/trace_log.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f568d496bc75fc567fd6371ad8209690f6b170d commit 5f568d496bc75fc567fd6371ad8209690f6b170d Author: Siddhartha <ssid@chromium.org> Date: Tue Sep 04 22:00:48 2018 Add trace event to track application state Useful to understand traces from users. BUG=859260 Change-Id: Ieece0c5726570daf5e2981f0e26f88b17083ac6d Reviewed-on: https://chromium-review.googlesource.com/1199779 Reviewed-by: Yaron Friedman <yfriedman@chromium.org> Commit-Queue: Siddhartha S <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#588665} [modify] https://crrev.com/5f568d496bc75fc567fd6371ad8209690f6b170d/base/android/application_status_listener.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f97ef33cce1692930244576b6a00a4578d43253 commit 5f97ef33cce1692930244576b6a00a4578d43253 Author: Siddhartha <ssid@chromium.org> Date: Wed Sep 12 00:32:12 2018 Setup tracing sampler profiler at early startup Store TracingSamplerProfiler in ChromeMainDelegate and make sure profiling starts early at startup if needed. Also make the observer async and thread safe. BUG=859260 Change-Id: Ic84a2bfbe832a81071b05e0cff8f77c0015a1576 Reviewed-on: https://chromium-review.googlesource.com/1197324 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Cr-Commit-Position: refs/heads/master@{#590549} [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/BUILD.gn [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/app/BUILD.gn [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/app/DEPS [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/app/chrome_main_delegate.cc [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/app/chrome_main_delegate.h [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/browser/BUILD.gn [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/chrome/browser/chrome_content_browser_client.cc [delete] https://crrev.com/f1b1920d302dbd32635179d6252db65471c9f6f7/chrome/browser/tracing/chrome_browser_main_extra_parts_tracing.cc [delete] https://crrev.com/f1b1920d302dbd32635179d6252db65471c9f6f7/chrome/browser/tracing/chrome_browser_main_extra_parts_tracing.h [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/components/tracing/BUILD.gn [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/components/tracing/common/tracing_sampler_profiler.cc [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/components/tracing/common/tracing_sampler_profiler.h [modify] https://crrev.com/5f97ef33cce1692930244576b6a00a4578d43253/components/tracing/common/tracing_sampler_profiler_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4bdd44a1cab1c63d03569ab33fbfea932eea0279 commit 4bdd44a1cab1c63d03569ab33fbfea932eea0279 Author: Siddhartha <ssid@chromium.org> Date: Wed Sep 12 16:46:10 2018 Implement tracing sampling profiler on Android StackUnwinderAndroid is no longer singleton and will be owned by Sampler impl. Use the android sampler in tracing profiler on Android. BUG=859260 Change-Id: I18805f72c1c1e3d2b6bf6b83f0a98ec063927b4c Reviewed-on: https://chromium-review.googlesource.com/1208724 Reviewed-by: Mike Wittman <wittman@chromium.org> Commit-Queue: Siddhartha S <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#590718} [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/native_stack_sampler_android.cc [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/native_stack_sampler_android.h [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/stack_unwinder_android.h [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/stack_unwinder_android_unittest.cc [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/tracing_sampler_profiler.cc [modify] https://crrev.com/4bdd44a1cab1c63d03569ab33fbfea932eea0279/components/tracing/common/tracing_sampler_profiler_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4 commit 6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4 Author: Ned Nguyen <nednguyen@google.com> Date: Wed Sep 12 16:54:13 2018 Revert "Implement tracing sampling profiler on Android" This reverts commit 4bdd44a1cab1c63d03569ab33fbfea932eea0279. Reason for revert: breaking android_arm64-builder-perf (https://ci.chromium.org/p/chrome/builders/luci.chrome.ci/android_arm64-builder-perf/4734) Original change's description: > Implement tracing sampling profiler on Android > > StackUnwinderAndroid is no longer singleton and will be owned by Sampler > impl. Use the android sampler in tracing profiler on Android. > > BUG=859260 > > Change-Id: I18805f72c1c1e3d2b6bf6b83f0a98ec063927b4c > Reviewed-on: https://chromium-review.googlesource.com/1208724 > Reviewed-by: Mike Wittman <wittman@chromium.org> > Commit-Queue: Siddhartha S <ssid@chromium.org> > Cr-Commit-Position: refs/heads/master@{#590718} TBR=wittman@chromium.org,ssid@chromium.org,etienneb@chromium.org Change-Id: I691ac31723b6d73563171ddeb45d0f54a527fa19 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 859260 Reviewed-on: https://chromium-review.googlesource.com/1222146 Reviewed-by: Ned Nguyen <nednguyen@google.com> Commit-Queue: Ned Nguyen <nednguyen@google.com> Cr-Commit-Position: refs/heads/master@{#590721} [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/native_stack_sampler_android.cc [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/native_stack_sampler_android.h [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/stack_unwinder_android.h [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/stack_unwinder_android_unittest.cc [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/tracing_sampler_profiler.cc [modify] https://crrev.com/6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4/components/tracing/common/tracing_sampler_profiler_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/52723fa0ba3f00afeba14dfe62e86ae8482e10fd commit 52723fa0ba3f00afeba14dfe62e86ae8482e10fd Author: Siddhartha <ssid@chromium.org> Date: Wed Sep 12 18:33:26 2018 Reland "Implement tracing sampling profiler on Android" This reverts commit 6a7e1a24d20af73ed0975065ee4c6b60e06ea8c4. Reason for revert: Fix build Original change's description: > Revert "Implement tracing sampling profiler on Android" > > This reverts commit 4bdd44a1cab1c63d03569ab33fbfea932eea0279. > > Reason for revert: breaking android_arm64-builder-perf (https://ci.chromium.org/p/chrome/builders/luci.chrome.ci/android_arm64-builder-perf/4734) > > Original change's description: > > Implement tracing sampling profiler on Android > > > > StackUnwinderAndroid is no longer singleton and will be owned by Sampler > > impl. Use the android sampler in tracing profiler on Android. > > > > BUG=859260 > > > > Change-Id: I18805f72c1c1e3d2b6bf6b83f0a98ec063927b4c > > Reviewed-on: https://chromium-review.googlesource.com/1208724 > > Reviewed-by: Mike Wittman <wittman@chromium.org> > > Commit-Queue: Siddhartha S <ssid@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#590718} > > TBR=wittman@chromium.org,ssid@chromium.org,etienneb@chromium.org > > Change-Id: I691ac31723b6d73563171ddeb45d0f54a527fa19 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 859260 > Reviewed-on: https://chromium-review.googlesource.com/1222146 > Reviewed-by: Ned Nguyen <nednguyen@google.com> > Commit-Queue: Ned Nguyen <nednguyen@google.com> > Cr-Commit-Position: refs/heads/master@{#590721} TBR=wittman@chromium.org,ssid@chromium.org,nednguyen@google.com,etienneb@chromium.org Change-Id: I64134f13f34d4b9252bc41bdc6a5d812a0e8373f No-Tree-Checks: true Bug: 859260 Reviewed-on: https://chromium-review.googlesource.com/1222187 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Siddhartha S <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#590757} [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/native_stack_sampler_android.cc [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/native_stack_sampler_android.h [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/stack_unwinder_android.h [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/stack_unwinder_android_unittest.cc [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/tracing_sampler_profiler.cc [modify] https://crrev.com/52723fa0ba3f00afeba14dfe62e86ae8482e10fd/components/tracing/common/tracing_sampler_profiler_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3c06a9a39ed106a0034c9aa05725bf5f4a085e3a commit 3c06a9a39ed106a0034c9aa05725bf5f4a085e3a Author: Siddhartha <ssid@chromium.org> Date: Thu Sep 13 00:59:40 2018 Symbolize PCs for Android framework stack frames on device Framework stack frames cannot be symbolized ouside device for android. So, symbolize them on device and add to the trace events. BUG=859260 Change-Id: I5a117c11b49e27ea6799ad157e2312d536e6ef34 Reviewed-on: https://chromium-review.googlesource.com/1199700 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Cr-Commit-Position: refs/heads/master@{#590880} [modify] https://crrev.com/3c06a9a39ed106a0034c9aa05725bf5f4a085e3a/components/tracing/common/tracing_sampler_profiler.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ee21cec286031da925ada8b588f71f7b219cf271 commit ee21cec286031da925ada8b588f71f7b219cf271 Author: Siddhartha <ssid@chromium.org> Date: Fri Sep 14 01:41:01 2018 Enable CPU profiling category for Android startup tracing BUG=859260 Change-Id: I9262c7b4c96fad43576d020d2a4660c2c86b81e5 Reviewed-on: https://chromium-review.googlesource.com/1222693 Reviewed-by: oysteine <oysteine@chromium.org> Commit-Queue: Siddhartha S <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#591254} [modify] https://crrev.com/ee21cec286031da925ada8b588f71f7b219cf271/components/tracing/common/trace_startup_config.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2aed5223c0ffaca9a4dbc2a58752f89ea52c005e commit 2aed5223c0ffaca9a4dbc2a58752f89ea52c005e Author: Siddhartha <ssid@chromium.org> Date: Tue Sep 18 03:13:58 2018 Android: Add chrome Build ID as metadata Bug: 859260 Change-Id: I808dd3fe090aa9ba346906160bcd2468841d07ff Reviewed-on: https://chromium-review.googlesource.com/1229195 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: oysteine <oysteine@chromium.org> Cr-Commit-Position: refs/heads/master@{#591929} [modify] https://crrev.com/2aed5223c0ffaca9a4dbc2a58752f89ea52c005e/base/trace_event/trace_log.cc [modify] https://crrev.com/2aed5223c0ffaca9a4dbc2a58752f89ea52c005e/chrome/common/trace_event_args_whitelist.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/406eb8d071e631e9bbbed0149e8d8a94b1aad033 commit 406eb8d071e631e9bbbed0149e8d8a94b1aad033 Author: Siddhartha <ssid@chromium.org> Date: Wed Sep 19 20:43:01 2018 Android: Increase stack size limit for unwinding Make the copy buffer to malloced, since 1MB could be over stack limit for sampling thread. BUG=859260 R=wittman@chromium.org Change-Id: Idc7719c79be378fec69f6a1d90b8f9300d67e132 Reviewed-on: https://chromium-review.googlesource.com/1231382 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Cr-Commit-Position: refs/heads/master@{#592540} [modify] https://crrev.com/406eb8d071e631e9bbbed0149e8d8a94b1aad033/components/tracing/common/stack_unwinder_android.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/76751481ce01baf778ee41df339b3415b6fd6ab1 commit 76751481ce01baf778ee41df339b3415b6fd6ab1 Author: Siddhartha <ssid@chromium.org> Date: Fri Sep 21 23:29:36 2018 Sampling profiler: Make option to sample more leniently In the current profiler, if a single sample takes too long then the sampling tasks get crowded and stops the main thread from running for a long time. But usually the slowest part is the stack copying for which the main thread is paused anyway. So, it is ok to take next sample after the interval time after previous sample completes, instead of strictly sampling every interval. BUG=859260 Change-Id: Ib0671b1f465f5cf98caa01aeac615648b24a1cf4 Reviewed-on: https://chromium-review.googlesource.com/1234841 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Xi Cheng <chengx@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#593375} [modify] https://crrev.com/76751481ce01baf778ee41df339b3415b6fd6ab1/base/profiler/stack_sampling_profiler.cc [modify] https://crrev.com/76751481ce01baf778ee41df339b3415b6fd6ab1/base/profiler/stack_sampling_profiler.h [modify] https://crrev.com/76751481ce01baf778ee41df339b3415b6fd6ab1/chrome/common/thread_profiler.cc [modify] https://crrev.com/76751481ce01baf778ee41df339b3415b6fd6ab1/components/tracing/common/tracing_sampler_profiler.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5ff4f2c0421141c683dc7fa2ba048f216a95673e commit 5ff4f2c0421141c683dc7fa2ba048f216a95673e Author: Siddhartha <ssid@chromium.org> Date: Sat Sep 22 01:27:11 2018 Android: Record metrics to understand why unwinding fails TBR=wittman@chromium.org BUG=859260 Change-Id: Ife938d536ca036364b20464055479e949813c75b Reviewed-on: https://chromium-review.googlesource.com/1228785 Commit-Queue: Siddhartha S <ssid@chromium.org> Reviewed-by: Steven Holte <holte@chromium.org> Cr-Commit-Position: refs/heads/master@{#593409} [modify] https://crrev.com/5ff4f2c0421141c683dc7fa2ba048f216a95673e/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/5ff4f2c0421141c683dc7fa2ba048f216a95673e/tools/metrics/histograms/enums.xml [modify] https://crrev.com/5ff4f2c0421141c683dc7fa2ba048f216a95673e/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4405902aff78633af1d2a056b9494e0b3af50cd1 commit 4405902aff78633af1d2a056b9494e0b3af50cd1 Author: Siddhartha <ssid@chromium.org> Date: Tue Oct 23 20:44:55 2018 Android: Support unwinding function prolog If the sampler stoped a thread at prolog of a chrome function, use the LR register to find the next return address. BUG=859260 Change-Id: Ic20d793ee11a8b0fe3edc9438c0f12ccc19f487c Reviewed-on: https://chromium-review.googlesource.com/c/1265560 Commit-Queue: ssid <ssid@chromium.org> Reviewed-by: Egor Pasko <pasko@chromium.org> Cr-Commit-Position: refs/heads/master@{#602077} [modify] https://crrev.com/4405902aff78633af1d2a056b9494e0b3af50cd1/base/trace_event/cfi_backtrace_android.cc [modify] https://crrev.com/4405902aff78633af1d2a056b9494e0b3af50cd1/base/trace_event/cfi_backtrace_android.h [modify] https://crrev.com/4405902aff78633af1d2a056b9494e0b3af50cd1/components/tracing/common/stack_unwinder_android.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1466e004b65f1b60d1b009de072e664c61961ba4 commit 1466e004b65f1b60d1b009de072e664c61961ba4 Author: Siddhartha <ssid@chromium.org> Date: Sat Oct 27 05:11:39 2018 Expose default thread stack size set by chrome This will be useful for stack sampling profiler to set buffer size for copying stack. BUG=859260 Change-Id: Ib87e44e82ff8d309e5ec2f7750fda9168b6906d0 Reviewed-on: https://chromium-review.googlesource.com/c/1297241 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: ssid <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#603313} [modify] https://crrev.com/1466e004b65f1b60d1b009de072e664c61961ba4/base/threading/platform_thread.h [modify] https://crrev.com/1466e004b65f1b60d1b009de072e664c61961ba4/base/threading/platform_thread_posix.cc [modify] https://crrev.com/1466e004b65f1b60d1b009de072e664c61961ba4/base/threading/platform_thread_unittest.cc [modify] https://crrev.com/1466e004b65f1b60d1b009de072e664c61961ba4/base/threading/platform_thread_win.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5dd50def3b8ba04adb401851b1886e85e16f30cb commit 5dd50def3b8ba04adb401851b1886e85e16f30cb Author: Siddhartha <ssid@chromium.org> Date: Sun Oct 28 17:11:40 2018 Add a marker on stack for JNI for unwinder, at the exit of native Adds a marker on stack so that stack unwinder is able to skip java frames to C++ directly if java frames did not emit unwind info. This happens frequently because of JIT code. BUG=859260 Change-Id: I104d2f26d89df2c706776002335b3969696fdd62 Reviewed-on: https://chromium-review.googlesource.com/c/1296827 Commit-Queue: ssid <ssid@chromium.org> Reviewed-by: Cait Phillips <caitkp@chromium.org> Reviewed-by: agrieve <agrieve@chromium.org> Cr-Commit-Position: refs/heads/master@{#603383} [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/SampleForTests_jni.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/jni_generator.py [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/jni_generator_helper.h [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testCalledByNatives.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testConstantsFromJavaP.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testFromJavaP.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testFromJavaPGenerics.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testMultipleJNIAdditionalImport.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testNativeExportsOnlyOption.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testSingleJNIAdditionalImport.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/base/android/jni_generator/testTracing.golden [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/components/BUILD.gn [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/components/tracing/BUILD.gn [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/components/tracing/DEPS [add] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/components/tracing/android/test/src/org/chromium/tracing/UnwindTestHelper.java [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/5dd50def3b8ba04adb401851b1886e85e16f30cb/components/tracing/common/stack_unwinder_android_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c67f7905aaaa633e9318aa033f594a5123ed389e commit c67f7905aaaa633e9318aa033f594a5123ed389e Author: Siddhartha <ssid@chromium.org> Date: Tue Oct 30 04:21:04 2018 Linux: Find default stack size from pthread for CPU profiler BUG=859260 Change-Id: I23044240996b52cc532de618fa0fef7164713d30 Reviewed-on: https://chromium-review.googlesource.com/c/1233233 Commit-Queue: ssid <ssid@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Cr-Commit-Position: refs/heads/master@{#603781} [modify] https://crrev.com/c67f7905aaaa633e9318aa033f594a5123ed389e/base/profiler/native_stack_sampler_posix.cc [modify] https://crrev.com/c67f7905aaaa633e9318aa033f594a5123ed389e/components/tracing/common/native_stack_sampler_android.cc [modify] https://crrev.com/c67f7905aaaa633e9318aa033f594a5123ed389e/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/c67f7905aaaa633e9318aa033f594a5123ed389e/components/tracing/common/stack_unwinder_android.h [modify] https://crrev.com/c67f7905aaaa633e9318aa033f594a5123ed389e/components/tracing/common/stack_unwinder_android_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5ca76e90ca7df192705c674627d350c19617596d commit 5ca76e90ca7df192705c674627d350c19617596d Author: Siddhartha <ssid@chromium.org> Date: Sat Nov 03 01:32:03 2018 Android: Get register context from signal handler 1. Gets the register context from signal handler and sets all registers correctly before using libunwind. This avoids crashes if registers are used for unwinding frames. 2. Removes the need for unwinding signal handler function since we get the context of the stopped function directly. BUG=859260,888434 Change-Id: Ib337f20c19e25e2f82e61b08f8e9ed4ac1195fde Reviewed-on: https://chromium-review.googlesource.com/c/1307055 Commit-Queue: ssid <ssid@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Cr-Commit-Position: refs/heads/master@{#605121} [modify] https://crrev.com/5ca76e90ca7df192705c674627d350c19617596d/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/5ca76e90ca7df192705c674627d350c19617596d/components/tracing/common/stack_unwinder_android.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2f7d5874a070f93dc004cd3b21d4b510f94556c0 commit 2f7d5874a070f93dc004cd3b21d4b510f94556c0 Author: Siddhartha <ssid@chromium.org> Date: Sat Nov 03 06:38:07 2018 Android: Scan stack for PCs if unwinding fails We have tried to unwind the stack frame and the failure rate of unwinding android framework frames with libunwind is too high to get meaningful data. So, scan the stack to find all chrome PCs if unwinding fails. We can try to sanitize the stack on the server side. BUG=859260 Change-Id: I689b59f03f6b088576e45667fbad878c67940ba2 Reviewed-on: https://chromium-review.googlesource.com/c/1308717 Commit-Queue: ssid <ssid@chromium.org> Reviewed-by: Mike Wittman <wittman@chromium.org> Cr-Commit-Position: refs/heads/master@{#605159} [modify] https://crrev.com/2f7d5874a070f93dc004cd3b21d4b510f94556c0/base/trace_event/cfi_backtrace_android.cc [modify] https://crrev.com/2f7d5874a070f93dc004cd3b21d4b510f94556c0/base/trace_event/cfi_backtrace_android.h [modify] https://crrev.com/2f7d5874a070f93dc004cd3b21d4b510f94556c0/components/tracing/common/stack_unwinder_android.cc [modify] https://crrev.com/2f7d5874a070f93dc004cd3b21d4b510f94556c0/components/tracing/common/stack_unwinder_android_unittest.cc [modify] https://crrev.com/2f7d5874a070f93dc004cd3b21d4b510f94556c0/components/tracing/common/tracing_sampler_profiler.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b3e5c45f1cadbd4d3181bbfba847cd3590d7a2d1 commit b3e5c45f1cadbd4d3181bbfba847cd3590d7a2d1 Author: Siddhartha <ssid@chromium.org> Date: Wed Dec 19 02:04:39 2018 Use tgkil instead of kill for suspending thread kill() sends signal to the given process's main thread (usually). This cannot be used to send signal to other threads if needed. kill() is also disallowed by sandbox on renderer processes. So, use tgkill() to send signal to suspend thread. BUG=859260 Change-Id: I8057b0c2b3e09895c38b9ab658ee2b60b76e8e2e Reviewed-on: https://chromium-review.googlesource.com/c/1383499 Reviewed-by: Alexandr Ilin <alexilin@chromium.org> Commit-Queue: ssid <ssid@chromium.org> Cr-Commit-Position: refs/heads/master@{#617709} [modify] https://crrev.com/b3e5c45f1cadbd4d3181bbfba847cd3590d7a2d1/components/tracing/common/stack_unwinder_android.cc
Comment 1 by ssid@chromium.org
, Jun 30 2018