Closed Bug 1152400 Opened 9 years ago Closed 2 years ago

Flag scripts from other tabs as such

Categories

(DevTools :: Performance Tools (Profiler/Timeline), defect, P3)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: paul, Unassigned)

References

Details

(Whiteboard: [devtools-platform])

If I'm profiling TAB_1, I might see scripts from TAB_2. This is how Gecko works, so it's not a bug, but we need to make it clear that such script is not part of the current tab. We should make them as "Other tab activity".
We'll have to get this from the profiler itself. Anyway to do this currently, or what would need to be done?

On the front end, we can have a new category, "Other Tab", like you said Paul, and it's just generalized as a meta node, unless "show platform data" is on.
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #1)
> We'll have to get this from the profiler itself. Anyway to do this
> currently, or what would need to be done?

I don't know.

Victor, any idea?
Flags: needinfo?(vporof)
This is a hard thing to achieve. I bounced some ideas around with djvj last year, but it will take some considerable hacking.

The profiler backend needs to be informed at sample time what's the current "owner" of the activity performed for each frame. This is a little bit complicated to accurately define in some corner cases.
Flags: needinfo?(vporof)
(In reply to Victor Porof [:vporof][:vp] from comment #3)
> This is a hard thing to achieve. I bounced some ideas around with djvj last
> year, but it will take some considerable hacking.
> 
> The profiler backend needs to be informed at sample time what's the current
> "owner" of the activity performed for each frame. This is a little bit
> complicated to accurately define in some corner cases.

Can it be done client side?
Thought about that; one naive way would be matching frame URLs to script tags. False positives from cdns or multiple windows open on the same page, but a good start. Not sure if that's "good enough" or what, because I cant think of another way of differentiating an origin (two windows of soundcloud for example) solely on the client. 

Another crude, but more robust, would be tracking inner window IDs per frame in SPS profiler. Would clear up what is definitely chrome code too.
Although scoping by script tags that exist on the page, we can label other frames as "other domain" or something, rather than "other tab"
When playing around with getting source maps working in bug 923396, we can use the debugger's TabSources which can represent all sources loaded in that tab. There may be some edge cases I'm not considering, but this should be a good start on figuring out what samples are for the current tab. This would still however run into the issue where another tab on another page has the same sources and is doing some activity (as the location in the samples would still find a valid source for the current tab).
Whiteboard: [devtools-platform]
There is a Zone per tab. If we identify the Zone of the currently profiled tab, we can filter in the backend, or just pass along the Zone that each JS frame belongs to in the profiler JSON.
Triaging. Filter on ADRENOCORTICOTROPIC (yes).
OS: Windows NT → Unspecified
Hardware: x86_64 → Unspecified
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3

This report is related to the old DevTools Profiler.
The Performance panel now points to the new Firefox profiler available at profiler.firefox.com
Closing as Invalid bug

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.