Bug 1771213 - mozilla::baseprofiler::baseprofiler_save_profile_to_file now has prefix "base" to avoid lldb call ambiguity - r=mstange

Calling `profiler_save_profile_to_file` from lldb errored with "call to 'profiler_save_profile_to_file' is ambiguous", even though they're in different namespaces.

Differential Revision: https://phabricator.services.mozilla.com/D148360
This commit is contained in:
Gerald Squelart 2022-06-06 00:43:59 +00:00
parent 94ea7b0820
commit 4d5e7d05a7
3 changed files with 7 additions and 4 deletions

View File

@ -3015,8 +3015,8 @@ static void locked_profiler_save_profile_to_file(PSLockRef aLock,
}
}
void profiler_save_profile_to_file(const char* aFilename) {
LOG("profiler_save_profile_to_file(%s)", aFilename);
void baseprofiler_save_profile_to_file(const char* aFilename) {
LOG("baseprofiler_save_profile_to_file(%s)", aFilename);
MOZ_RELEASE_ASSERT(CorePS::Exists());

View File

@ -422,7 +422,9 @@ MFBT_API bool profiler_stream_json_for_this_process(
// Get the profile and write it into a file. A no-op if the profile is
// inactive.
MFBT_API void profiler_save_profile_to_file(const char* aFilename);
// Prefixed with "base" to avoid clashing with Gecko Profiler's extern "C"
// profiler_save_profile_to_file when called from debugger.
MFBT_API void baseprofiler_save_profile_to_file(const char* aFilename);
//---------------------------------------------------------------------------
// RAII classes

View File

@ -4781,7 +4781,8 @@ void TestProfiler() {
// are done in gtest's.
printf("baseprofiler_save_profile_to_file()...\n");
baseprofiler::profiler_save_profile_to_file("TestProfiler_profile.json");
baseprofiler::baseprofiler_save_profile_to_file(
"TestProfiler_profile.json");
printf("profiler_stop()...\n");
baseprofiler::profiler_stop();