Let each log module be configured to record its profiler markers or not
Categories
(Core :: XPCOM, enhancement)
Tracking
()
People
(Reporter: dcarver, Assigned: dcarver)
References
(Depends on 2 open bugs, Blocks 2 open bugs)
Details
Attachments
(4 external files)
Bug 2069963 will filter profiler markers by the log module that emits them. Before that, each log module needs a setting saying whether its markers should be recorded, and a way to configure it.
The setting is separate from the level: turning markers on must not send the module's statements to the log. Each module has a default, which configuration can override or restore.
Bug 2080769 adds flags to the MOZ_LOG syntax, and this bug adds the first one, m: nsHttp:5+m, nsHttp:-m or nsHttp:~m. The logging.<name> prefs, about:logging and the profiler presets can set it too.
Nothing reads the setting yet, so no marker is filtered: bug 2069963 does that.
| Assignee | ||
Comment 1•24 days ago
|
||
Profiler markers are going to be filtered by log module (bug 2069963), and
whether a module can emit markers is a separate state from its level: turning
markers on must not send the module's statements to the log. MOZ_LOG sets it
with the m flag, as in nsHttp:5+m, nsHttp:-m or nsHttp:~m.
Each module has a default that MOZ_LOG can override in either direction or
restore. It is phrased as being filtered out so that false, the value of a
module that does not say anything, means emitting markers as today. Nothing
can declare a module as filtered out yet.
| Assignee | ||
Comment 2•24 days ago
|
||
MOZ_LOG can now turn the profiler markers of a log module on or off with the m
flag, so parseLogModules reports it for each module, so that front-end code can
set it as MOZ_LOG does.
| Assignee | ||
Comment 3•24 days ago
|
||
A logging.<name> pref could only set a level, so about:logging, which
configures modules through these prefs, couldn't set the markers flag that
MOZ_LOG has. A string pref can now hold the settings of a module as MOZ_LOG
writes them after the colon, such as "5+m" or "+m", which the pref watcher
reads with the MOZ_LOG parser. Level names such as "verbose", which these
prefs already took, go through the parser too, so that a pref can combine
them with flags, as in "verbose+m". about:logging keeps a level alone in an
int pref and writes settings with flags in a string pref.
A pref is the whole configuration of its module, so what it doesn't write goes
back to its default instead of staying unchanged as in MOZ_LOG: otherwise
going from "5+m" to 5, or clearing the pref, would leave markers on. An
invalid value writes nothing, so it gives the defaults too, as an unknown
level name already did, and the parent process now reports the error with
NS_WARNING and in the Browser Console.
| Assignee | ||
Comment 4•24 days ago
|
||
A module with flags in the MOZ_LOG string of a preset, such as "nsHttp:5+m", is
set in a string pref, as about:logging does, so that a preset can turn the
profiler markers of a log module on or off.
Description
•