reached_code_profiler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_ANDROID_REACHED_CODE_PROFILER_H_
  5. #define BASE_ANDROID_REACHED_CODE_PROFILER_H_
  6. #include "base/android/library_loader/library_loader_hooks.h"
  7. #include "base/base_export.h"
  8. namespace base {
  9. namespace android {
  10. // Initializes and starts the reached code profiler for |library_process_type|.
  11. // Reached symbols are not recorded before calling this function, so it has to
  12. // be called as early in startup as possible. This has to be called before the
  13. // process creates any thread.
  14. // TODO(crbug.com/916263): Currently, the reached code profiler must be
  15. // initialized before the tracing profiler. If we want to start it at later
  16. // point, we need to check that the tracing profiler isn't initialized first.
  17. BASE_EXPORT void InitReachedCodeProfilerAtStartup(
  18. LibraryProcessType library_process_type);
  19. // Returns whether the reached code profiler is enabled.
  20. BASE_EXPORT bool IsReachedCodeProfilerEnabled();
  21. // Returns whether the reached code profiler can be possibly enabled for the
  22. // current build configuration.
  23. BASE_EXPORT bool IsReachedCodeProfilerSupported();
  24. } // namespace android
  25. } // namespace base
  26. #endif // BASE_ANDROID_REACHED_CODE_PROFILER_H_