forked from mirrors/gecko-dev
Backed out 3 changesets (bug 1894703) for causing failures related to DOCSHELL logging. CLOSED TREE
Backed out changeset f9a8141501a7 (bug 1894703) Backed out changeset e8eb7ab47374 (bug 1894703) Backed out changeset a84074f814da (bug 1894703)
This commit is contained in:
parent
6d4972be10
commit
db7f7b5ddf
9 changed files with 10 additions and 110 deletions
|
|
@ -9627,26 +9627,6 @@
|
|||
value: false
|
||||
mirror: always
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Prefs starting with "logging."
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If this pref is true, prefs in the logging.config branch will be cleared on
|
||||
# startup. This prevents unadvertedly creating huge log files that fill the disk
|
||||
# when forgetting to remove the logging preferences.
|
||||
- name: logging.config.clear_on_startup
|
||||
type: bool
|
||||
value: true
|
||||
mirror: never
|
||||
|
||||
# Allow setting log modules at runtimes easily with a MOZ_LOG string.
|
||||
# This preference is empty by default but defined, this makes it easy to use
|
||||
# especially on mobile by searching for it in about:config.
|
||||
- name: logging.config.modules
|
||||
type: String
|
||||
value: ""
|
||||
mirror: never
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Prefs starting with "mathml."
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1033,6 +1033,11 @@ pref("javascript.options.dump_stack_on_debuggee_would_run", false);
|
|||
// advanced prefs
|
||||
pref("image.animation_mode", "normal");
|
||||
|
||||
// If this pref is true, prefs in the logging.config branch will be cleared on
|
||||
// startup. This is done so that setting a log-file and log-modules at runtime
|
||||
// doesn't persist across restarts leading to huge logfile and low disk space.
|
||||
pref("logging.config.clear_on_startup", true);
|
||||
|
||||
// If there is ever a security firedrill that requires
|
||||
// us to block certian ports global, this is the pref
|
||||
// to use. Is is a comma delimited list of port numbers
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ pref_groups = [
|
|||
"javascript",
|
||||
"layers",
|
||||
"layout",
|
||||
"logging",
|
||||
"mathml",
|
||||
"media",
|
||||
"memory",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "NSPRLogModulesParser.h"
|
||||
#include "nsString.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "base/process_util.h"
|
||||
|
|
@ -24,7 +23,6 @@ static const char kLoggingPrefLogFile[] = "logging.config.LOG_FILE";
|
|||
static const char kLoggingPrefAddTimestamp[] = "logging.config.add_timestamp";
|
||||
static const char kLoggingPrefSync[] = "logging.config.sync";
|
||||
static const char kLoggingPrefStacks[] = "logging.config.profilerstacks";
|
||||
static const char kLoggingPrefLogModules[] = "logging.config.modules";
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
|
@ -87,30 +85,6 @@ static void LoadPrefValue(const char* aName) {
|
|||
} else if (prefName.EqualsLiteral(kLoggingPrefStacks)) {
|
||||
bool captureStacks = Preferences::GetBool(aName, false);
|
||||
LogModule::SetCaptureStacks(captureStacks);
|
||||
} else if (prefName.EqualsLiteral(kLoggingPrefLogModules)) {
|
||||
// The content of the preference will be parsed as a MOZ_LOG string, then
|
||||
// the corresponding log modules (if any) will be enabled, others will be
|
||||
// disabled.
|
||||
LogModule::DisableModules();
|
||||
|
||||
rv = Preferences::GetCString(aName, prefValue);
|
||||
if (NS_FAILED(rv)) {
|
||||
// If the preference is missing, there's nothing to set.
|
||||
return;
|
||||
}
|
||||
|
||||
NSPRLogModulesParser(
|
||||
prefValue.BeginReading(),
|
||||
[](const char* aName, LogLevel aLevel, int32_t aValue) mutable {
|
||||
// Only the special string "profilerstacks" is taken into account,
|
||||
// because we're especially interested in usage with the Firefox
|
||||
// Profiler.
|
||||
if (strcmp(aName, "profilerstacks") == 0) {
|
||||
LogModule::SetCaptureStacks(true);
|
||||
} else {
|
||||
LogModule::Get(aName)->SetLevel(aLevel);
|
||||
}
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -774,13 +774,6 @@ class LogModuleManager {
|
|||
}
|
||||
}
|
||||
|
||||
void DisableModules() {
|
||||
OffTheBooksMutexAutoLock guard(mModulesLock);
|
||||
for (auto& m : mModules) {
|
||||
(*(m.GetModifiableData()))->SetLevel(LogLevel::Disabled);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
OffTheBooksMutex mModulesLock;
|
||||
nsClassHashtable<nsCharPtrHashKey, LogModule> mModules;
|
||||
|
|
@ -848,8 +841,6 @@ void LogModule::SetCaptureStacks(bool aCaptureStacks) {
|
|||
sLogModuleManager->SetCaptureStacks(aCaptureStacks);
|
||||
}
|
||||
|
||||
void LogModule::DisableModules() { sLogModuleManager->DisableModules(); }
|
||||
|
||||
// This function is defined in gecko_logger/src/lib.rs
|
||||
// We mirror the level in rust code so we don't get forwarded all of the
|
||||
// rust logging and have to create an LogModule for each rust component.
|
||||
|
|
|
|||
|
|
@ -125,11 +125,6 @@ class LogModule {
|
|||
*/
|
||||
static void SetCaptureStacks(bool aCaptureStacks);
|
||||
|
||||
/**
|
||||
* Disable all log modules.
|
||||
*/
|
||||
static void DisableModules();
|
||||
|
||||
/**
|
||||
* Indicates whether or not the given log level is enabled.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ terms:
|
|||
| | | | stack for each log statement. |
|
||||
+----------------------+---------+-------------------------------------------------------------------------------------------+
|
||||
|
||||
This syntax is used for most methods of enabling logging.
|
||||
This syntax is used for most methods of enabling logging, with the exception of
|
||||
settings preferences directly, see :ref:`this section <Enabling logging using preferences>` for directions.
|
||||
|
||||
|
||||
Enabling Logging
|
||||
|
|
@ -238,14 +239,9 @@ Enabling logging using preferences
|
|||
''''''''''''''''''''''''''''''''''
|
||||
|
||||
To adjust the logging after Firefox has started, you can set prefs under the
|
||||
``logging.`` prefix. For example, setting ``logging.foo`` to ``3`` will set the log
|
||||
module ``foo`` to start logging at level 3.
|
||||
|
||||
The MOZ_LOG syntax can be used directly as well, by setting the preference
|
||||
``logging.config.modules``. All modules can be used but only the special string
|
||||
`profilerstacks` is supported.
|
||||
|
||||
A number of special prefs can be set as well, described in the table below:
|
||||
`logging.` prefix. For example, setting `logging.foo` to `3` will set the log
|
||||
module `foo` to start logging at level 3. A number of special prefs can be set,
|
||||
described in the table below:
|
||||
|
||||
+-------------------------------------+------------+-------------------------------+--------------------------------------------------------+
|
||||
| Preference name | Preference | Preference value | Description |
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const kModulesPref = "logging.config.modules";
|
||||
add_task(async () => {
|
||||
Services.prefs.setStringPref(kModulesPref, "prof:5");
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref(kModulesPref);
|
||||
});
|
||||
|
||||
const entries = 10000;
|
||||
const interval = 1;
|
||||
const threads = ["GeckoMain"];
|
||||
const features = ["nostacksampling"];
|
||||
await Services.profiler.StartProfiler(entries, interval, features, threads);
|
||||
const profileData = await Services.profiler.getProfileDataAsync();
|
||||
await Services.profiler.StopProfiler();
|
||||
const { markers, stringTable } = profileData.threads[0];
|
||||
const stringIndexForLogMessages = stringTable.indexOf("LogMessages");
|
||||
Assert.greaterOrEqual(
|
||||
stringIndexForLogMessages,
|
||||
0,
|
||||
"A string index for the string LogMessages have been found."
|
||||
);
|
||||
|
||||
// At least one log for the profiler json streaming operation should exist.
|
||||
// See https://searchfox.org/mozilla-central/rev/445a6e86233c733c5557ef44e1d33444adaddefc/mozglue/baseprofiler/core/platform.cpp#2015
|
||||
const logMessageMarkers = markers.data.filter(
|
||||
tuple => tuple[markers.schema.name] === stringIndexForLogMessages
|
||||
);
|
||||
|
||||
Assert.greaterOrEqual(
|
||||
logMessageMarkers.length,
|
||||
0,
|
||||
"At least one log message have been found."
|
||||
);
|
||||
});
|
||||
|
|
@ -58,9 +58,6 @@ fail-if = ["os == 'android'"]
|
|||
|
||||
["test_localfile.js"]
|
||||
|
||||
["test_logFromPreference.js"]
|
||||
skip-if = "(os == 'android' && release_or_beta)" # bug 1841818
|
||||
|
||||
["test_mac_bundle.js"]
|
||||
|
||||
["test_mac_xattrs.js"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue