1 // Copyright 2018 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_TEST_CLANG_PROFILING_H_ 6 #define BASE_TEST_CLANG_PROFILING_H_ 7 8 #include "base/clang_profiling_buildflags.h" 9 10 #include "base/base_export.h" 11 12 #if !BUILDFLAG(CLANG_PROFILING) 13 #error "Clang profiling can only be used if CLANG_PROFILING macro is defined" 14 #endif 15 16 namespace base { 17 18 // Write out the accumulated code profiling profile to the configured file. 19 // This is used internally by e.g. base::Process and FATAL logging, to cause 20 // profiling information to be stored even when performing an "immediate" exit 21 // (or triggering a debug crash), where the automatic at-exit writer will not 22 // be invoked. 23 // This call is thread-safe, and will write profiling data at-most-once. 24 BASE_EXPORT void WriteClangProfilingProfile(); 25 26 } // namespace base 27 28 #endif // BASE_TEST_CLANG_PROFILING_H_ 29