Closed Bug 978262 Opened 10 years ago Closed 10 years ago

Ignore duplicate frames when getting stack for background hang

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(1 file)

For re-entrant pseudo-stack frames like "nsAppShell::ProcessNextNativeEvent" and "js::RunScript", it's not very helpful to have many of the same frames in a row. We should avoid that to save some memory, storage, and bandwidth.
This patch deduplicates identical, consecutive frames to save memory, storage, and bandwidth. It also allows us to better match other similar stacks.
Attachment #8383949 - Flags: review?(nfroyd)
Comment on attachment 8383949 [details] [diff] [review]
Ignore duplicate frames when getting BHR stack (v1)

Review of attachment 8383949 [details] [diff] [review]:
-----------------------------------------------------------------

This change affects not only the hang monitor, but it affects the profiler, too, right?

::: xpcom/threads/ThreadStackHelper.cpp
@@ +193,3 @@
>      }
> +    const char* const label = entry->label();
> +    if (label == prevLabel) {

This comparison can be pointer comparison rather than string comparison because this is only ever comparing pseudo-stack labels, which are essentially interned, correct?
(In reply to Nathan Froyd (:froydnj) from comment #2)
> Comment on attachment 8383949 [details] [diff] [review]
> Ignore duplicate frames when getting BHR stack (v1)
> 
> Review of attachment 8383949 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> This change affects not only the hang monitor, but it affects the profiler,
> too, right?

It only affects the hang monitor because the profiler handles the pseudo-stack internally and doesn't use ThreadStackHelper.

> ::: xpcom/threads/ThreadStackHelper.cpp
> @@ +193,3 @@
> >      }
> > +    const char* const label = entry->label();
> > +    if (label == prevLabel) {
> 
> This comparison can be pointer comparison rather than string comparison
> because this is only ever comparing pseudo-stack labels, which are
> essentially interned, correct?

Yup!
Comment on attachment 8383949 [details] [diff] [review]
Ignore duplicate frames when getting BHR stack (v1)

Review of attachment 8383949 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the clarifications!
Attachment #8383949 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/c9a37d31251e
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: