Allow loading about:memory data from a crash report back into the about:memory viewer

RESOLVED FIXED in mozilla35

Status

()

Toolkit
about:memory
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Benjamin Smedberg, Assigned: njn)

Tracking

unspecified
mozilla35
x86
All
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Crash reports can now contain about:memory data! dmajor would like an easy way to load this into the about:memory viewer, and filed bug 1061371, but I think it might be even easier to just load the data directly from the crash-stats API for display.

e.g. https://crash-stats.mozilla.com/api/ProcessedCrash/?crash_id=a3b212d7-505f-44c7-8f62-0d41b2140831&datatype=processed the "memory_info" key in the root object has the about:memory data.

njn do you have somebody who can whip this up?
Flags: needinfo?(n.nethercote)
(Reporter)

Updated

4 years ago
Summary: Allow loading about:memory data from a crash report → Allow loading about:memory data from a crash report back into the about:memory viewer
(Assignee)

Comment 1

4 years ago
> njn do you have somebody who can whip this up?

Hmm, if anyone, it would probably be me. I might be able to but my webdev skills aren't great.
This is similar to bug 859603. What would the UI be like -- have a text box where you can paste a URL, and then a button next to it that says "Load from URL"?

> https://crash-stats.mozilla.com/api/ProcessedCrash/?crash_id=a3b212d7-505f-
> 44c7-8f62-0d41b2140831&datatype=processed the "memory_info" key in the root
> object has the about:memory data.

I can't find "memory_info" anywhere in that page. Is that the right link?
Flags: needinfo?(n.nethercote) → needinfo?(dmajor)
It's "memory_report" but it only shows up if you have the right access bits. It would look like:

[...]
"reason": "EXCEPTION_BREAKPOINT", 
"memory_report": {
"version": 1, 
[...]
}, 
"completeddatetime": "2014-08-31 21:15:03.980248", 
[...]
Flags: needinfo?(dmajor)
I wouldn't have a huge text box taking up space when most people don't need it. Maybe make something appear after clicking a button? Do we still support prompt()? Then again my webdev skills are circa 1995, maybe you shouldn't listen to me :)
(Assignee)

Updated

4 years ago
Depends on: 1062070
(Assignee)

Comment 4

4 years ago
(In reply to David Major [:dmajor] from comment #2)
> It's "memory_report" but it only shows up if you have the right access bits.
> It would look like:
> 
> [...]
> "reason": "EXCEPTION_BREAKPOINT", 
> "memory_report": {
> "version": 1, 
> [...]
> }, 
> "completeddatetime": "2014-08-31 21:15:03.980248", 
> [...]

Ah. I guess I'll need access, then. I filed bug 1062070.

> I wouldn't have a huge text box taking up space when most people don't need it.

I'll probably implement bug 859603 at the same time, which will make the textbox more widely useful. And I can make it small.
(Assignee)

Comment 5

4 years ago
I talked with Chris Lonnen and this sounds harder that it first seemed. Because the data is restricted, to access it programmatically (e.g. via an XHR) you need a token from https://crash-stats.mozilla.com/api/tokens/. Doable -- I guess you'd specify the token as well as the URL before triggering the load -- but a complication.

Also, not every crash is processed. If you request the report in the webapp we'll process it on demand and jump it to the front of the queue, but requesting via the API might not be enough.

Here's a first step that won't be quite as convenient but should be a lot better than the current situation: modify the "Load..." and "Load and diff..." buttons to handle the crash reports format. E.g. they'd extract the |memory_report| field if present. With that in place, you could save a crash report locally and then load it in about:memory. dmajor, what do you think about that?
Flags: needinfo?(dmajor)
> Here's a first step that won't be quite as convenient but should be a lot
> better than the current situation: modify the "Load..." and "Load and
> diff..." buttons to handle the crash reports format. E.g. they'd extract the
> |memory_report| field if present. With that in place, you could save a crash
> report locally and then load it in about:memory. dmajor, what do you think
> about that?

I'd be totally fine with that.
Flags: needinfo?(dmajor)
(Assignee)

Comment 7

4 years ago
Created attachment 8483994 [details] [diff] [review]
In about:memory, allow the loading of memory reports embedded in crash dumps

This is a simple change. Immediately after parsing the JSON, we check if there
is a |memory_report| property. If so, it's presumably a crash report, and so we
can extract and work with the |memory_report| property.

I added tests for the "Load..." and "Load and diff..." functions.
Attachment #8483994 - Flags: review?(continuation)
(Assignee)

Updated

4 years ago
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Attachment #8483994 - Flags: review?(continuation) → review+
https://hg.mozilla.org/mozilla-central/rev/3de899a46769
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.