From e9d76de44453907d35b06bf8207f9f0432b52879 Mon Sep 17 00:00:00 2001 From: Stanca Serban Date: Thu, 5 Sep 2024 21:37:26 +0300 Subject: [PATCH] Backed out changeset 819d4c9682d4 (bug 1908630) as requested for working in the incorrect sandbox. CLOSED TREE --- build/templates.mozbuild | 14 -------- build/unix/moz.build | 7 ---- build/unix/profiling/moz.build | 9 ----- build/unix/profiling/profiling.cpp | 44 ------------------------ modules/libpref/init/StaticPrefList.yaml | 2 +- 5 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 build/unix/profiling/moz.build delete mode 100644 build/unix/profiling/profiling.cpp diff --git a/build/templates.mozbuild b/build/templates.mozbuild index 9ca45d5a2c58..443c706a31e2 100644 --- a/build/templates.mozbuild +++ b/build/templates.mozbuild @@ -15,23 +15,11 @@ def Binary(): OS_LIBS += ["log"] -@template -def MaybeAddProfiling(name): - if ( - CONFIG["MOZ_ENABLE_FORKSERVER"] - and CONFIG["OS_TARGET"] == "Linux" - and CONFIG["MOZ_PROFILE_GENERATE"] == "1" - ): - USE_LIBS += ["profiling"] - - @template def Program(name): """Template for program executables.""" PROGRAM = name - MaybeAddProfiling(name) - Binary() @@ -138,8 +126,6 @@ def SharedLibrary(name, output_category=None): if output_category: SHARED_LIBRARY_OUTPUT_CATEGORY = output_category - MaybeAddProfiling(name) - Binary() diff --git a/build/unix/moz.build b/build/unix/moz.build index d09cb563f4e5..4d556b6aaf2a 100644 --- a/build/unix/moz.build +++ b/build/unix/moz.build @@ -6,10 +6,3 @@ if CONFIG["USE_ELF_HACK"] or CONFIG["RELRHACK"]: DIRS += ["elfhack"] - -if ( - CONFIG["MOZ_ENABLE_FORKSERVER"] - and CONFIG["OS_TARGET"] == "Linux" - and CONFIG["MOZ_PROFILE_GENERATE"] == "1" -): - DIRS += ["profiling"] diff --git a/build/unix/profiling/moz.build b/build/unix/profiling/moz.build deleted file mode 100644 index ca0ba6825420..000000000000 --- a/build/unix/profiling/moz.build +++ /dev/null @@ -1,9 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -Library("profiling") - -SOURCES += ["profiling.cpp"] diff --git a/build/unix/profiling/profiling.cpp b/build/unix/profiling/profiling.cpp deleted file mode 100644 index b9a2edf4781e..000000000000 --- a/build/unix/profiling/profiling.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#if defined(MOZ_PROFILE_GENERATE) && defined(XP_LINUX) && !defined(ANDROID) - -# include -# include -# include -# include -# include - -# if defined(__cplusplus) -extern "C" { -# endif -void __llvm_profile_initialize(void); -void __llvm_profile_initialize_file(void); -void __llvm_profile_set_filename(const char*); - -// Use the API to force a different filename, then set back the original one. -// This will make sure the pattern is re-parsed and thus the PID properly -// updated within the lprofCurFilename struct. -static void updateFilenameAfterFork(void) { - __llvm_profile_set_filename("default.profraw"); - __llvm_profile_initialize_file(); - __llvm_profile_set_filename(getenv("LLVM_PROFILE_FILE")); - __llvm_profile_initialize_file(); -} - -static int CustomRegisterRuntime(void) { - __llvm_profile_initialize(); - if (pthread_atfork(NULL, NULL, updateFilenameAfterFork) < 0) { - fprintf(stderr, "[%d] [%s] pthread_atfork()=%d\n", getpid(), - __PRETTY_FUNCTION__, errno); - } - return 0; -} - -int __llvm_profile_runtime = CustomRegisterRuntime(); -# if defined(__cplusplus) -} -# endif -#endif // defined(MOZ_PROFILE_GENERATE) && defined(XP_LINUX) && - // !defined(ANDROID) diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 6b74fa54b8fb..f963e55bd4a0 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -2938,7 +2938,7 @@ #ifdef MOZ_ENABLE_FORKSERVER - name: dom.ipc.forkserver.enable type: bool -#if defined(MOZ_CODE_COVERAGE) || defined(MOZ_ASAN) || defined(MOZ_TSAN) || defined(MOZ_MSAN) || defined(MOZ_UBSAN) +#if defined(MOZ_CODE_COVERAGE) || defined(MOZ_ASAN) || defined(MOZ_TSAN) || defined(MOZ_MSAN) || defined(MOZ_UBSAN) || defined(MOZ_PROFILE_GENERATE) value: false #else value: false