| Summary: | [contexts] Provide debug / trace functionality for context injection | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Oleg Besedin <ob1.eclipse> | ||||||||||||||||
| Component: | E4 | Assignee: | Project Inbox <e4.runtime-inbox> | ||||||||||||||||
| Status: | ASSIGNED --- | QA Contact: | |||||||||||||||||
| Severity: | enhancement | ||||||||||||||||||
| Priority: | P3 | CC: | bokowski, emoffatt, ob1.eclipse, pwebster, remy.suen | ||||||||||||||||
| Version: | unspecified | ||||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||||
| Hardware: | All | ||||||||||||||||||
| OS: | All | ||||||||||||||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=534612 | ||||||||||||||||||
| Whiteboard: | |||||||||||||||||||
| Attachments: |
|
||||||||||||||||||
|
Description
Oleg Besedin
Created attachment 181206 [details]
Screenshot of the tracing view
Created attachment 181207 [details]
The trace / debug view
This bundle adds the contexts trace / debug view into the "Debug" category.
Created attachment 181208 [details]
Patch that adds debug hooks to the Eclipse contexts
The "Patch that adds debug hooks to the Eclipse contexts" is applied to CVS Head; the new trace/debug bundle is shared as: e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.core.contexts.debug Any feedback is very welcome. At this point I am trying to figure out what's useful vs. what we can reasonably do, so all ideas about what information is needed to visualize context injection are very welcome. In plans: - organize links page by context keys [I'd like to change the actual EclipseContext to work that way too, for performance reasons.] - add snapshot / diff for context listeners to help catch leaks - see if we can make this into a true debug view (i.e., debugging out of process, breakpoints) Created attachment 181515 [details]
Patch: find new listeners
The patch adds a "Snapshot" for contexts and their listeners along with the code that detects new listeners created since the snapshot was taken.
Few points:
- having new listeners does not mean a leak by itself; only having new listeners after repeat operations might indicate a leak. (For example, having new listeners after context menu is shown for the first time is probably OK; having new listeners every time that context menu comes up needs to be checked);
- to reduce false positives, we only check contexts that existed both in the "snapshot" time and in the current state; we don't compare short-lived contexts created between those two points in time. While such contexts and their listeners should not affect DI operations, normal garbage collection concerns still apply.
(Patch applied to CVS Head.)
Created attachment 182162 [details] Patch: organize listeners by name Now that I've made the change for the bug 329208, this patch displays context listeners organized by the value they depend on in the context. (Patch applied to CVS Head.) Created attachment 182174 [details]
Patch: improved refresh of the context tree
The refresh of the context tree is now done in 5-second intervals (if "Auto" is enabled), or initiated by the "Refresh now" button.
The context values in the view are stored as weak references allowing proper garbage collection.
(Patch applied to CVS Head.)
Created attachment 182175 [details]
Current screenshot
|