Backed out changeset dc425d760d09 (bug 1817163) for causing dt failures on browser_interaction-between-interfaces.js CLOSED TREE

This commit is contained in:
Norisz Fay 2024-04-29 18:54:49 +03:00
parent 990a0c1450
commit b4bb722de5
22 changed files with 29 additions and 116 deletions

View file

@ -124,7 +124,7 @@ export const presets = {
"web-developer": { "web-developer": {
entries: 128 * 1024 * 1024, entries: 128 * 1024 * 1024,
interval: 1, interval: 1,
features: ["screenshots", "js", "cpu", "memory"], features: ["screenshots", "js", "cpu"],
threads: ["GeckoMain", "Compositor", "Renderer", "DOM Worker"], threads: ["GeckoMain", "Compositor", "Renderer", "DOM Worker"],
duration: 0, duration: 0,
profilerViewMode: "active-tab", profilerViewMode: "active-tab",
@ -142,15 +142,7 @@ export const presets = {
"firefox-platform": { "firefox-platform": {
entries: 128 * 1024 * 1024, entries: 128 * 1024 * 1024,
interval: 1, interval: 1,
features: [ features: ["screenshots", "js", "stackwalk", "cpu", "java", "processcpu"],
"screenshots",
"js",
"stackwalk",
"cpu",
"java",
"processcpu",
"memory",
],
threads: [ threads: [
"GeckoMain", "GeckoMain",
"Compositor", "Compositor",
@ -173,7 +165,7 @@ export const presets = {
graphics: { graphics: {
entries: 128 * 1024 * 1024, entries: 128 * 1024 * 1024,
interval: 1, interval: 1,
features: ["stackwalk", "js", "cpu", "java", "processcpu", "memory"], features: ["stackwalk", "js", "cpu", "java", "processcpu"],
threads: [ threads: [
"GeckoMain", "GeckoMain",
"Compositor", "Compositor",
@ -207,7 +199,6 @@ export const presets = {
"audiocallbacktracing", "audiocallbacktracing",
"ipcmessages", "ipcmessages",
"processcpu", "processcpu",
"memory",
], ],
threads: [ threads: [
"cubeb", "cubeb",
@ -257,7 +248,6 @@ export const presets = {
"java", "java",
"processcpu", "processcpu",
"bandwidth", "bandwidth",
"memory",
], ],
threads: [ threads: [
"Compositor", "Compositor",
@ -296,7 +286,6 @@ export const presets = {
"markersallthreads", "markersallthreads",
"power", "power",
"bandwidth", "bandwidth",
"memory",
], ],
threads: ["GeckoMain", "Renderer"], threads: ["GeckoMain", "Renderer"],
duration: 0, duration: 0,

View file

@ -414,13 +414,6 @@ const featureDescriptions = [
"Record how much CPU has been used between samples by each profiled thread.", "Record how much CPU has been used between samples by each profiled thread.",
recommended: true, recommended: true,
}, },
{
name: "Memory Tracking",
value: "memory",
title:
"Track the memory allocations and deallocations per process over time.",
recommended: true,
},
{ {
name: "Java", name: "Java",
value: "java", value: "java",

View file

@ -58,7 +58,6 @@ exports.PerfActor = class PerfActor extends Actor {
"stackwalk", "stackwalk",
"cpu", "cpu",
"responsiveness", "responsiveness",
"memory",
], ],
threads: options.threads || ["GeckoMain", "Compositor"], threads: options.threads || ["GeckoMain", "Compositor"],
activeTabID: RecordingUtils.getActiveBrowserID(), activeTabID: RecordingUtils.getActiveBrowserID(),

View file

@ -34,7 +34,6 @@ private val firefox_features = arrayOf(
"java", "java",
"processcpu", "processcpu",
"ipcmessages", "ipcmessages",
"memory",
) )
private val firefox_threads = arrayOf( private val firefox_threads = arrayOf(
"GeckoMain", "GeckoMain",
@ -44,8 +43,7 @@ private val firefox_threads = arrayOf(
"DOM Worker", "DOM Worker",
) )
private val graphics_features = private val graphics_features = arrayOf("stackwalk", "js", "cpu", "java", "processcpu", "ipcmessages")
arrayOf("stackwalk", "js", "cpu", "java", "processcpu", "ipcmessages", "memory")
private val graphics_threads = arrayOf( private val graphics_threads = arrayOf(
"GeckoMain", "GeckoMain",
"Compositor", "Compositor",
@ -66,7 +64,6 @@ private val media_features = arrayOf(
"ipcmessages", "ipcmessages",
"processcpu", "processcpu",
"java", "java",
"memory",
) )
private val media_threads = arrayOf( private val media_threads = arrayOf(
"cubeb", "audio", "BackgroundThreadPool", "camera", "capture", "Compositor", "decoder", "GeckoMain", "gmp", "cubeb", "audio", "BackgroundThreadPool", "camera", "capture", "Compositor", "decoder", "GeckoMain", "gmp",
@ -84,7 +81,6 @@ private val networking_features = arrayOf(
"processcpu", "processcpu",
"bandwidth", "bandwidth",
"ipcmessages", "ipcmessages",
"memory",
) )
private val networking_threads = arrayOf( private val networking_threads = arrayOf(

View file

@ -23,7 +23,7 @@ PRODUCTS = [PROD_FENIX, PROD_GVE]
GV_CONFIG = b"""env: GV_CONFIG = b"""env:
MOZ_PROFILER_STARTUP: 1 MOZ_PROFILER_STARTUP: 1
MOZ_PROFILER_STARTUP_INTERVAL: 5 MOZ_PROFILER_STARTUP_INTERVAL: 5
MOZ_PROFILER_STARTUP_FEATURES: js,stackwalk,leaf,screenshots,ipcmessages,java,cpu,memory MOZ_PROFILER_STARTUP_FEATURES: js,stackwalk,leaf,screenshots,ipcmessages,java,cpu
MOZ_PROFILER_STARTUP_FILTERS: GeckoMain,Compositor,Renderer,IPDL Background MOZ_PROFILER_STARTUP_FILTERS: GeckoMain,Compositor,Renderer,IPDL Background
""" """

View file

@ -720,8 +720,8 @@ pref("devtools.performance.recording.duration.remote", 0);
// explanations. Remote profiling also includes the java feature by default. // explanations. Remote profiling also includes the java feature by default.
// If the remote debuggee isn't an Android phone, then this feature will // If the remote debuggee isn't an Android phone, then this feature will
// be ignored. // be ignored.
pref("devtools.performance.recording.features", "[\"js\",\"stackwalk\",\"cpu\",\"screenshots\",\"memory\"]"); pref("devtools.performance.recording.features", "[\"js\",\"stackwalk\",\"cpu\",\"screenshots\"]");
pref("devtools.performance.recording.features.remote", "[\"js\",\"stackwalk\",\"cpu\",\"screenshots\",\"memory\",\"java\"]"); pref("devtools.performance.recording.features.remote", "[\"js\",\"stackwalk\",\"cpu\",\"screenshots\",\"java\"]");
// Threads to be captured by the profiler. // Threads to be captured by the profiler.
pref("devtools.performance.recording.threads", "[\"GeckoMain\",\"Compositor\",\"Renderer\"]"); pref("devtools.performance.recording.threads", "[\"GeckoMain\",\"Compositor\",\"Renderer\"]");
pref("devtools.performance.recording.threads.remote", "[\"GeckoMain\",\"Compositor\",\"Renderer\"]"); pref("devtools.performance.recording.threads.remote", "[\"GeckoMain\",\"Compositor\",\"Renderer\"]");

View file

@ -238,10 +238,7 @@ class MOZ_RAII AutoProfilerStats {
"every CPU core for every profiler sample.") \ "every CPU core for every profiler sample.") \
\ \
MACRO(23, "bandwidth", Bandwidth, \ MACRO(23, "bandwidth", Bandwidth, \
"Record the network bandwidth used for every profiler sample.") \ "Record the network bandwidth used for every profiler sample.")
MACRO(24, "memory", Memory, \
"Track the memory allocations and deallocations per process over " \
"time.")
// *** Synchronize with lists in ProfilerState.h and geckoProfiler.json *** // *** Synchronize with lists in ProfilerState.h and geckoProfiler.json ***
struct ProfilerFeature { struct ProfilerFeature {

View file

@ -630,7 +630,7 @@ class Browsertime(Perftest):
( (
"gecko_profile_features", "gecko_profile_features",
"--firefox.geckoProfilerParams.features", "--firefox.geckoProfilerParams.features",
"js,stackwalk,cpu,screenshots,memory", "js,stackwalk,cpu,screenshots",
), ),
( (
"gecko_profile_threads", "gecko_profile_threads",

View file

@ -2,7 +2,7 @@
alert_threshold = 2.0 alert_threshold = 2.0
apps = "firefox, chrome, safari, custom-car" apps = "firefox, chrome, safari, custom-car"
gecko_profile_interval = 1 gecko_profile_interval = 1
gecko_profile_features = "stackwalk,js,cpu,java,processcpu,memory" gecko_profile_features = "stackwalk,js,cpu,java,processcpu"
gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate" gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate"
expose_browser_profiler = true expose_browser_profiler = true
expose_chrome_trace = true expose_chrome_trace = true

View file

@ -2,7 +2,7 @@
alert_threshold = 2.0 alert_threshold = 2.0
apps = "fenix, geckoview, chrome-m, cstm-car-m" apps = "fenix, geckoview, chrome-m, cstm-car-m"
gecko_profile_interval = 1 gecko_profile_interval = 1
gecko_profile_features = "stackwalk,js,cpu,java,processcpu,memory" gecko_profile_features = "stackwalk,js,cpu,java,processcpu"
gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate" gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate"
expose_browser_profiler = true expose_browser_profiler = true
lower_is_better = false lower_is_better = false

View file

@ -2,7 +2,7 @@
alert_threshold = 2.0 alert_threshold = 2.0
apps = "firefox, chrome, safari" apps = "firefox, chrome, safari"
gecko_profile_interval = 1 gecko_profile_interval = 1
gecko_profile_features = "stackwalk,js,cpu,java,processcpu,memory" gecko_profile_features = "stackwalk,js,cpu,java,processcpu"
gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate" gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate"
expose_browser_profiler = true expose_browser_profiler = true
lower_is_better = false lower_is_better = false

View file

@ -2,7 +2,7 @@
alert_threshold = 2.0 alert_threshold = 2.0
apps = "fenix, chrome-m, geckoview" apps = "fenix, chrome-m, geckoview"
gecko_profile_interval = 1 gecko_profile_interval = 1
gecko_profile_features = "stackwalk,js,cpu,java,processcpu,memory" gecko_profile_features = "stackwalk,js,cpu,java,processcpu"
gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate" gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate"
expose_browser_profiler = true expose_browser_profiler = true
lower_is_better = false lower_is_better = false

View file

@ -2,7 +2,7 @@
alert_threshold = 2.0 alert_threshold = 2.0
apps = "firefox, chrome, safari" apps = "firefox, chrome, safari"
gecko_profile_interval = 1 gecko_profile_interval = 1
gecko_profile_features = "stackwalk,js,cpu,java,processcpu,memory" gecko_profile_features = "stackwalk,js,cpu,java,processcpu"
gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate" gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate"
expose_gecko_profiler = true expose_gecko_profiler = true
expose_chrome_trace = true expose_chrome_trace = true

View file

@ -2,7 +2,7 @@
alert_threshold = 2.0 alert_threshold = 2.0
apps = "fenix, chrome-m, geckoview" apps = "fenix, chrome-m, geckoview"
gecko_profile_interval = 1 gecko_profile_interval = 1
gecko_profile_features = "stackwalk,js,cpu,java,processcpu,memory" gecko_profile_features = "stackwalk,js,cpu,java,processcpu"
gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate" gecko_profile_threads = "GeckoMain,Compositor,Renderer,SwComposite,RenderBackend,SceneBuilder,WrWorker,CanvasWorkers,TextureUpdate"
expose_gecko_profiler = true expose_gecko_profiler = true
expose_chrome_trace = true expose_chrome_trace = true

View file

@ -4,7 +4,7 @@ alert_threshold = 2.0
browser_cycles = 1 browser_cycles = 1
custom_data = true custom_data = true
gecko_profile_entries = 131072000 # 1GB gecko_profile_entries = 131072000 # 1GB
gecko_profile_features = "js,stackwalk,cpu,memory" gecko_profile_features = "js,stackwalk,cpu"
gecko_profile_threads = "GeckoMain,DOM Worker,IndexedDB" gecko_profile_threads = "GeckoMain,DOM Worker,IndexedDB"
lower_is_better = true lower_is_better = true
measure = "cpuTime" measure = "cpuTime"

View file

@ -42,7 +42,7 @@ class GeckoProfile(object):
"gecko_profile_entries", int(128 * 1024 * 1024 / 8) "gecko_profile_entries", int(128 * 1024 * 1024 / 8)
) )
gecko_profile_features = test_config.get( gecko_profile_features = test_config.get(
"gecko_profile_features", "js,stackwalk,cpu,screenshots,memory" "gecko_profile_features", "js,stackwalk,cpu,screenshots"
) )
gecko_profile_threads = test_config.get( gecko_profile_threads = test_config.get(
"gecko_profile_threads", "GeckoMain,Compositor,Renderer" "gecko_profile_threads", "GeckoMain,Compositor,Renderer"

View file

@ -47,8 +47,7 @@
"power", "power",
"responsiveness", "responsiveness",
"cpufreq", "cpufreq",
"bandwidth", "bandwidth"
"memory"
] ]
}, },
{ {

View file

@ -584,7 +584,6 @@ BaseProfilerCount* install_memory_hooks() {
ThreadIntercept::Init(); ThreadIntercept::Init();
} else { } else {
sCounter->Clear(); sCounter->Clear();
sCounter->Register();
} }
jemalloc_replace_dynamic(replace_init); jemalloc_replace_dynamic(replace_init);
return sCounter; return sCounter;
@ -636,10 +635,4 @@ void disable_native_allocations() {
} }
} }
void unregister_memory_counter() {
if (sCounter) {
sCounter->Unregister();
}
}
} // namespace mozilla::profiler } // namespace mozilla::profiler

View file

@ -17,7 +17,6 @@ BaseProfilerCount* install_memory_hooks();
void remove_memory_hooks(); void remove_memory_hooks();
void enable_native_allocations(); void enable_native_allocations();
void disable_native_allocations(); void disable_native_allocations();
void unregister_memory_counter();
} // namespace profiler } // namespace profiler
} // namespace mozilla } // namespace mozilla

View file

@ -405,7 +405,6 @@ static uint32_t AvailableFeatures() {
} }
#else #else
// The memory hooks are not available. // The memory hooks are not available.
ProfilerFeature::ClearMemory(features);
ProfilerFeature::ClearNativeAllocations(features); ProfilerFeature::ClearNativeAllocations(features);
#endif #endif
@ -1311,11 +1310,6 @@ class ActivePS {
#undef PS_GET_FEATURE #undef PS_GET_FEATURE
static bool ShouldInstallMemoryHooks(PSLockRef) {
MOZ_ASSERT(sInstance);
return ProfilerFeature::ShouldInstallMemoryHooks(sInstance->mFeatures);
}
static uint32_t JSFlags(PSLockRef aLock) { static uint32_t JSFlags(PSLockRef aLock) {
uint32_t Flags = 0; uint32_t Flags = 0;
Flags |= Flags |=
@ -5825,16 +5819,9 @@ void profiler_init(void* aStackTop) {
profiler_mark_thread_awake(); profiler_mark_thread_awake();
#if defined(MOZ_REPLACE_MALLOC) && defined(MOZ_PROFILER_MEMORY) #if defined(MOZ_REPLACE_MALLOC) && defined(MOZ_PROFILER_MEMORY)
if (ProfilerFeature::ShouldInstallMemoryHooks(features)) { // Start counting memory allocations (outside of lock because this may call
// Start counting memory allocations (outside of lock because this may call // profiler_add_sampled_counter which would attempt to take the lock.)
// profiler_add_sampled_counter which would attempt to take the lock.) ActivePS::SetMemoryCounter(mozilla::profiler::install_memory_hooks());
ActivePS::SetMemoryCounter(mozilla::profiler::install_memory_hooks());
} else {
// Unregister the memory counter in case it was registered before. This will
// make sure that the empty memory counter from the previous profiler run is
// removed completely and we don't serialize the memory counters.
mozilla::profiler::unregister_memory_counter();
}
#endif #endif
invoke_profiler_state_change_callbacks(ProfilingState::Started); invoke_profiler_state_change_callbacks(ProfilingState::Started);
@ -6461,16 +6448,9 @@ RefPtr<GenericPromise> profiler_start(PowerOfTwo32 aCapacity, double aInterval,
} }
#if defined(MOZ_REPLACE_MALLOC) && defined(MOZ_PROFILER_MEMORY) #if defined(MOZ_REPLACE_MALLOC) && defined(MOZ_PROFILER_MEMORY)
if (ProfilerFeature::ShouldInstallMemoryHooks(aFeatures)) { // Start counting memory allocations (outside of lock because this may call
// Start counting memory allocations (outside of lock because this may call // profiler_add_sampled_counter which would attempt to take the lock.)
// profiler_add_sampled_counter which would attempt to take the lock.) ActivePS::SetMemoryCounter(mozilla::profiler::install_memory_hooks());
ActivePS::SetMemoryCounter(mozilla::profiler::install_memory_hooks());
} else {
// Unregister the memory counter in case it was registered before. This will
// make sure that the empty memory counter from the previous profiler run is
// removed completely and we don't serialize the memory counters.
mozilla::profiler::unregister_memory_counter();
}
#endif #endif
invoke_profiler_state_change_callbacks(ProfilingState::Started); invoke_profiler_state_change_callbacks(ProfilingState::Started);
@ -6594,8 +6574,7 @@ void profiler_ensure_started(PowerOfTwo32 aCapacity, double aInterval,
} }
#if defined(MOZ_REPLACE_MALLOC) && defined(MOZ_PROFILER_MEMORY) #if defined(MOZ_REPLACE_MALLOC) && defined(MOZ_PROFILER_MEMORY)
if (ActivePS::FeatureNativeAllocations(aLock) && if (ActivePS::FeatureNativeAllocations(aLock)) {
ActivePS::ShouldInstallMemoryHooks(aLock)) {
mozilla::profiler::disable_native_allocations(); mozilla::profiler::disable_native_allocations();
} }
#endif #endif

View file

@ -20,7 +20,6 @@
# include "mozilla/Assertions.h" # include "mozilla/Assertions.h"
# include "mozilla/Atomics.h" # include "mozilla/Atomics.h"
# include "mozilla/DataMutex.h"
class BaseProfilerCount; class BaseProfilerCount;
void profiler_add_sampled_counter(BaseProfilerCount* aCounter); void profiler_add_sampled_counter(BaseProfilerCount* aCounter);
@ -189,33 +188,13 @@ class ProfilerCounterTotal final : public BaseProfilerCount {
public: public:
ProfilerCounterTotal(const char* aLabel, const char* aCategory, ProfilerCounterTotal(const char* aLabel, const char* aCategory,
const char* aDescription) const char* aDescription)
: BaseProfilerCount(aLabel, &mCounter, &mNumber, aCategory, aDescription), : BaseProfilerCount(aLabel, &mCounter, &mNumber, aCategory,
mRegistered(false, "ProfilerCounterTotal::mRegistered") { aDescription) {
// Assume we're in libxul // Assume we're in libxul
Register();
}
virtual ~ProfilerCounterTotal() { Unregister(); }
void Register() {
auto registered = mRegistered.Lock();
if (*registered) {
return;
}
*registered = true;
profiler_add_sampled_counter(this); profiler_add_sampled_counter(this);
} }
void Unregister() { virtual ~ProfilerCounterTotal() { profiler_remove_sampled_counter(this); }
auto registered = mRegistered.Lock();
if (!*registered) {
return;
}
*registered = false;
profiler_remove_sampled_counter(this);
}
BaseProfilerCount& operator++() { BaseProfilerCount& operator++() {
Add(1); Add(1);
@ -229,7 +208,6 @@ class ProfilerCounterTotal final : public BaseProfilerCount {
ProfilerAtomicSigned mCounter; ProfilerAtomicSigned mCounter;
ProfilerAtomicUnsigned mNumber; ProfilerAtomicUnsigned mNumber;
mozilla::DataMutex<bool> mRegistered;
}; };
// Defines a counter that is sampled on each profiler tick, with a running // Defines a counter that is sampled on each profiler tick, with a running

View file

@ -118,10 +118,7 @@
"every CPU core for every profiler sample.") \ "every CPU core for every profiler sample.") \
\ \
MACRO(23, "bandwidth", Bandwidth, \ MACRO(23, "bandwidth", Bandwidth, \
"Record the network bandwidth used for every profiler sample.") \ "Record the network bandwidth used for every profiler sample.")
MACRO( \
24, "memory", Memory, \
"Track the memory allocations and deallocations per process over time.")
// *** Synchronize with lists in BaseProfilerState.h and geckoProfiler.json *** // *** Synchronize with lists in BaseProfilerState.h and geckoProfiler.json ***
struct ProfilerFeature { struct ProfilerFeature {
@ -141,12 +138,6 @@ struct ProfilerFeature {
PROFILER_FOR_EACH_FEATURE(DECLARE) PROFILER_FOR_EACH_FEATURE(DECLARE)
#undef DECLARE #undef DECLARE
[[nodiscard]] static constexpr bool ShouldInstallMemoryHooks(
uint32_t aFeatures) {
return ProfilerFeature::HasMemory(aFeatures) ||
ProfilerFeature::HasNativeAllocations(aFeatures);
}
}; };
// clang-format off // clang-format off