Add --log-markers option to extract Log-type marker payloads#1
Open
alastor0325 wants to merge 3 commits intodpalmeiro:mainfrom
Open
Add --log-markers option to extract Log-type marker payloads#1alastor0325 wants to merge 3 commits intodpalmeiro:mainfrom
alastor0325 wants to merge 3 commits intodpalmeiro:mainfrom
Conversation
about:logging profiles store media log messages as instant Log-type markers. The existing --top-markers skipped these entirely because it filters out markers without an end time and zero-duration markers. Add getLogMarkers() which accesses profile.threads directly, finds all markers with data.type === "Log", and extracts their text payload from data.name (already a resolved string in the Redux store). An optional filter string restricts output by message text, module name, or thread name. Usage: profiler-cli <url> --log-markers # all log markers profiler-cli <url> --log-markers "MediaDecoder" # filter by keyword
- options.test.ts: unit tests for --log-markers parsing and validateArgs (flag accepted alone, with filter string, rejected alongside --calltree) - log-markers.test.ts: integration tests against a fixture profile with known Log markers in MediaDecoderStateMachine and MediaSupervisor threads (all markers shown, module labels, message/module/thread filtering, no-match message, chronological sort, timestamp format) - tests/fixtures/log-markers-profile.json.gz: minimal profile fixture with 4 Log markers across two media threads and one non-Log DOMEvent marker
Author
|
@dpalmeiro could you help review this? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--top-markersand--focus-markersilently skip zero-duration markers, makingabout:loggingmedia profiles unanalyzable — the log messages are stored as instantLog-type markers with no duration--log-markers [filter]which reads these markers directly fromprofile.threads, extractsdata.name/data.modulefrom eachtype:"Log"entry, and outputs them grouped by thread in chronological orderWhat
--log-markersis forWhen Firefox captures an
about:loggingprofile with the "Media playback" preset, the media pipeline log messages are stored as instantLog-type markers (zero duration, point-in-time). Examples:These are invisible to
--top-markers(which skips markers without an end time) and to--focus-marker(which filters CPU samples, not log text).Usage
Implementation notes
getLogMarkers()inprofiler.tsaccessesselectors.profile.getProfile(getState()).threadsdirectly — bypassingwindow.filteredMarkerswhich only covers the currently selected thread and skips zero-duration entriesdata.nameforLog-type markers is already a fully resolved string in the Redux store (no string table lookup needed)startTime(nottime) as the timestamp fieldTests
tests/options.test.ts: unit tests for flag parsing andvalidateArgstests/log-markers.test.ts: integration tests against a new fixture (log-markers-profile.json.gz) — covers all-markers output, module label formatting, message/module/thread filtering, no-match message, chronological sort, and timestamp format