clang_profiling.h 962 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2018 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_TEST_CLANG_PROFILING_H_
  5. #define BASE_TEST_CLANG_PROFILING_H_
  6. #include "base/clang_profiling_buildflags.h"
  7. #include "base/base_export.h"
  8. #if !BUILDFLAG(CLANG_PROFILING)
  9. #error "Clang profiling can only be used if CLANG_PROFILING macro is defined"
  10. #endif
  11. namespace base {
  12. // Write out the accumulated code profiling profile to the configured file.
  13. // This is used internally by e.g. base::Process and FATAL logging, to cause
  14. // profiling information to be stored even when performing an "immediate" exit
  15. // (or triggering a debug crash), where the automatic at-exit writer will not
  16. // be invoked.
  17. // This call is thread-safe, and will write profiling data at-most-once.
  18. BASE_EXPORT void WriteClangProfilingProfile();
  19. } // namespace base
  20. #endif // BASE_TEST_CLANG_PROFILING_H_