This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Improve the new profiler architecture to reflect the Java ME Profiler requirements | ||
---|---|---|---|
Product: | profiler | Reporter: | alexander.burdukov |
Component: | Base | Assignee: | Jiri Sedlacek <jis> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | 8.1 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
alexander.burdukov
2016-03-17 18:59:18 UTC
You're right that the implementation of ProjectSensitivePerformer.perform() is too Java SE specific - in fact the containing module provides a concrete Java SE and Java EE profiler implementation. It shouldn't be modified to enable Java ME Profiler integration with different UI and workflow. Ideally a new module with Java ME profiler implementation should be created. It will provide the correct UI and workflow for your needs. The Java SE profiler implementation should be disabled in this case as well as other modules which are not needed (Profiling Points). This is currently not possible. The Insert Profiling Point... menu item can be hidden by editing the layer.xml file of one of your modules. In case it needs to be project-specific a new API for this menu item needs to be introduced. Please, note that in case of Java ME most probably it is impossible to create generic Java ME profiler implementation since Java ME profiler is specific to particular Java ME platform implementation (Java ME SDK in our case). On other hand currently we are able to re-use the most of required functionality from Java SE profiler. Basically following features are required for us: 1. Enable/disable profiler per project. At the moment it is covered by ProjectProfilingSupportProvider.isProfilingSupported. 2. Check if the project is modified for profiler, modify project for profiler (if not modified yet and if permitted by the project) and launch it if modified. Currently it is covered by ProjectProfilingSupportProvider.checkProjectIsModifiedForProfiler which we invoke from our action provider. This is only solution with the current profiler API, but probably it is better to separate these 3 actions (check, integrate, launch) from API point of view. Note, that launch action in this case must run custom action contributed by our plugin. 3. Unintegrate profiler if permitted by the project. It is covered by ProjectProfilingSupportProvider.supportsUnintegrate and ProjectProfilingSupportProvider.unintegrateProfiler. However, I do not see this feature in NetBeans UI anymore, so probably these methods just have to be removed from API. Also, we reuse NetBeans Profiler UI to display CPU profiler results by extending classes like CPUCCTContainer, CPUResultsSnapshot, PrestimeCPUCCTNodeBacked Addressed by http://hg.netbeans.org/profiler-main/rev/80011f6df639: Before starting the profiling session the ProjectProfilingSupport.checkProjectCanBeProfiled() method is called. This is the right place to integrate the ME profiler with the project if needed. When starting the profiling session, you can take control of what will happen by implementing ProjectProfilingSupport.startProfilingSession() and returning true from this method. Returning false from your ProjectProfilingSupport.areProfilingPointsSupported() will remove the ME projects from the Profiling Point wizard. There's no support for unintegrating the profiler from projects as this is no more needed by the Java profiler. You can create your own action in the Profile menu and provide your implementation for this functionality if needed. Verified the new API with manual built NetBeans. Works for me and no more modifications are needed. |