92 private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID + ".address"; //$NON-NLS-1$ |
92 private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID + ".address"; //$NON-NLS-1$ |
93 |
93 |
94 public static final String ACTION_COMBINED_CPU_VIEW = "combined_cpu_view";//$NON-NLS-1$ |
94 public static final String ACTION_COMBINED_CPU_VIEW = "combined_cpu_view";//$NON-NLS-1$ |
95 public static final String ACTION_SEPARATE_CPU_VIEW = "separate_cpu_view";//$NON-NLS-1$ |
95 public static final String ACTION_SEPARATE_CPU_VIEW = "separate_cpu_view";//$NON-NLS-1$ |
96 public static final int[] TRACE_IDS_SMP = new int[]{1, 21, 41, 62}; |
96 public static final int[] TRACE_IDS_SMP = new int[]{1, 21, 41, 62}; |
|
97 public static final String PLUGIN_ID = "com.nokia.carbide.cpp.pi.address"; |
97 |
98 |
98 |
99 |
99 // private static HashMap<Integer,Long> uidToAddrThreadPeriod = new HashMap<Integer,Long>(); |
100 // private static HashMap<Integer,Long> uidToAddrThreadPeriod = new HashMap<Integer,Long>(); |
100 |
101 |
101 // There will be three graphs - one each for editor pages 0, 1, 2 |
102 // There will be three graphs - one each for editor pages 0, 1, 2 |
139 /* (non-Javadoc) |
140 /* (non-Javadoc) |
140 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IClassReplacer#getReplacedClass(java.lang.String) |
141 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IClassReplacer#getReplacedClass(java.lang.String) |
141 */ |
142 */ |
142 public Class getReplacedClass(String className) |
143 public Class getReplacedClass(String className) |
143 { |
144 { |
144 if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppTrace") != -1 //$NON-NLS-1$ |
145 if ( className.indexOf(PLUGIN_ID+".GppTrace") != -1 //$NON-NLS-1$ |
145 || className.indexOf("fi.vtt.bappea.model.GppTrace") != -1 //$NON-NLS-1$ |
146 || className.indexOf("fi.vtt.bappea.model.GppTrace") != -1 //$NON-NLS-1$ |
146 || className.indexOf("com.nokia.carbide.pi.address.GppTrace") != -1 //$NON-NLS-1$ |
147 || className.indexOf("com.nokia.carbide.pi.address.GppTrace") != -1 //$NON-NLS-1$ |
147 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppTrace") != -1) //$NON-NLS-1$ |
148 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppTrace") != -1) //$NON-NLS-1$ |
148 { |
149 { |
149 return GppTrace.class; |
150 return GppTrace.class; |
150 } |
151 } |
151 else if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppSample") != -1 //$NON-NLS-1$ |
152 else if ( className.indexOf(PLUGIN_ID+".GppSample") != -1 //$NON-NLS-1$ |
152 || className.indexOf("com.nokia.carbide.pi.address.GppSample") != -1 //$NON-NLS-1$ |
153 || className.indexOf("com.nokia.carbide.pi.address.GppSample") != -1 //$NON-NLS-1$ |
153 || className.indexOf("fi.vtt.bappea.model.GppSample") != -1 //$NON-NLS-1$ |
154 || className.indexOf("fi.vtt.bappea.model.GppSample") != -1 //$NON-NLS-1$ |
154 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppSample") != -1) //$NON-NLS-1$ |
155 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppSample") != -1) //$NON-NLS-1$ |
155 { |
156 { |
156 return GppSample.class; |
157 return GppSample.class; |
157 } |
158 } |
158 else if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppThread") != -1 //$NON-NLS-1$ |
159 else if ( className.indexOf(PLUGIN_ID+".GppThread") != -1 //$NON-NLS-1$ |
159 || className.indexOf("com.nokia.carbide.pi.address.GppThread") != -1 //$NON-NLS-1$ |
160 || className.indexOf("com.nokia.carbide.pi.address.GppThread") != -1 //$NON-NLS-1$ |
160 || className.indexOf("fi.vtt.bappea.model.GppThread") != -1 //$NON-NLS-1$ |
161 || className.indexOf("fi.vtt.bappea.model.GppThread") != -1 //$NON-NLS-1$ |
161 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppThread") != -1) //$NON-NLS-1$ |
162 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppThread") != -1) //$NON-NLS-1$ |
162 { |
163 { |
163 return GppThread.class; |
164 return GppThread.class; |
164 } |
165 } |
165 else if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppProcess") != -1 //$NON-NLS-1$ |
166 else if ( className.indexOf(PLUGIN_ID+".GppProcess") != -1 //$NON-NLS-1$ |
166 || className.indexOf("com.nokia.carbide.pi.address.GppProcess") != -1 //$NON-NLS-1$ |
167 || className.indexOf("com.nokia.carbide.pi.address.GppProcess") != -1 //$NON-NLS-1$ |
167 || className.indexOf("fi.vtt.bappea.model.GppProcess") != -1 //$NON-NLS-1$ |
168 || className.indexOf("fi.vtt.bappea.model.GppProcess") != -1 //$NON-NLS-1$ |
168 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppProcess") != -1) //$NON-NLS-1$ |
169 || className.indexOf("fi.vtt.bappea.gppTracePlugin.GppProcess") != -1) //$NON-NLS-1$ |
169 { |
170 { |
170 return GppProcess.class; |
171 return GppProcess.class; |
180 if (!(genericTrace instanceof GppTrace)) |
181 if (!(genericTrace instanceof GppTrace)) |
181 return; |
182 return; |
182 |
183 |
183 GppTrace trace = (GppTrace)genericTrace; |
184 GppTrace trace = (GppTrace)genericTrace; |
184 |
185 |
185 NpiInstanceRepository.getInstance().activeUidAddTrace("com.nokia.carbide.cpp.pi.address", trace); //$NON-NLS-1$ |
186 NpiInstanceRepository.getInstance().activeUidAddTrace(PLUGIN_ID, trace); //$NON-NLS-1$ |
186 |
187 |
187 // initialize the address/thread base sampling rate |
188 // initialize the address/thread base sampling rate |
188 int samplingInterval = 1; |
189 int samplingInterval = 1; |
189 if (trace.samples.size() > 2) { |
190 if (trace.samples.size() > 2) { |
190 // because of a problem in older samplers, the first address/thread sample may have been thrown out |
191 // because of a problem in older samplers, the first address/thread sample may have been thrown out |
191 samplingInterval = (int) (((GppSample) trace.samples.get(1)).sampleSynchTime - ((GppSample) trace.samples.get(0)).sampleSynchTime); |
192 samplingInterval = (int) (((GppSample) trace.samples.get(1)).sampleSynchTime - ((GppSample) trace.samples.get(0)).sampleSynchTime); |
192 } |
193 } |
193 |
194 |
194 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.samplingInterval", Integer.valueOf(samplingInterval)); //$NON-NLS-1$ |
195 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".samplingInterval", Integer.valueOf(samplingInterval)); //$NON-NLS-1$ |
195 |
196 |
196 // make sure that the sorted samples array exists |
197 // make sure that the sorted samples array exists |
197 if (trace.getSortedGppSamples() == null) |
198 if (trace.getSortedGppSamples() == null) |
198 trace.sortGppSamples(); |
199 trace.sortGppSamples(); |
199 |
200 |
203 PIPageEditor.currentPageEditor().setMaxEndTime(((double)lastSampleTime) / 1000.0f); |
204 PIPageEditor.currentPageEditor().setMaxEndTime(((double)lastSampleTime) / 1000.0f); |
204 } |
205 } |
205 |
206 |
206 public GppTrace getTrace() |
207 public GppTrace getTrace() |
207 { |
208 { |
208 return (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
209 return (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
209 } |
210 } |
210 |
211 |
211 public IGppTraceGraph getTraceGraph(int graphIndex) |
212 public IGppTraceGraph getTraceGraph(int graphIndex) |
212 { |
213 { |
213 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
214 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
214 |
215 |
215 if (trace != null) { |
216 if (trace != null) { |
216 int uid = NpiInstanceRepository.getInstance().activeUid(); |
217 int uid = NpiInstanceRepository.getInstance().activeUid(); |
217 return trace.getTraceGraph(graphIndex, uid); |
218 return trace.getTraceGraph(graphIndex, uid); |
218 } else |
219 } else |
219 return null; |
220 return null; |
220 } |
221 } |
221 |
222 |
222 public GenericTrace getTrace(int graphIndex) |
223 public GenericTrace getTrace(int graphIndex) |
223 { |
224 { |
224 return (GenericTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
225 return (GenericTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
225 } |
226 } |
226 |
227 |
227 public Integer getLastSample(int graphIndex) |
228 public Integer getLastSample(int graphIndex) |
228 { |
229 { |
229 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
230 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
230 |
231 |
231 if (trace == null) |
232 if (trace == null) |
232 return null; |
233 return null; |
233 |
234 |
234 //this sets GPP thread list visible by default |
235 //this sets GPP thread list visible by default |
255 if ( (currentPage != PIPageEditor.THREADS_PAGE) |
256 if ( (currentPage != PIPageEditor.THREADS_PAGE) |
256 && (currentPage != PIPageEditor.BINARIES_PAGE) |
257 && (currentPage != PIPageEditor.BINARIES_PAGE) |
257 && (currentPage != PIPageEditor.FUNCTIONS_PAGE)) |
258 && (currentPage != PIPageEditor.FUNCTIONS_PAGE)) |
258 return; |
259 return; |
259 |
260 |
260 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
261 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
261 |
262 |
262 if (eventString.equals("fillSelected")) //$NON-NLS-1$ |
263 if (eventString.equals("fillSelected")) //$NON-NLS-1$ |
263 { |
264 { |
264 PIEvent be = new PIEvent(null, PIEvent.SET_FILL_SELECTED_THREAD); |
265 PIEvent be = new PIEvent(null, PIEvent.SET_FILL_SELECTED_THREAD); |
265 for (int i = 0; i < getGraphCount(); i++) { |
266 for (int i = 0; i < getGraphCount(); i++) { |
266 trace.getTraceGraph(i).piEventReceived(be); |
267 trace.getTraceGraph(i).piEventReceived(be); |
267 } |
268 } |
268 |
269 |
269 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", Boolean.FALSE); //$NON-NLS-1$ |
270 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", Boolean.FALSE); //$NON-NLS-1$ |
270 } |
271 } |
271 else if (eventString.equals("fillAll")) //$NON-NLS-1$ |
272 else if (eventString.equals("fillAll")) //$NON-NLS-1$ |
272 { |
273 { |
273 PIEvent be = new PIEvent(null, PIEvent.SET_FILL_ALL_THREADS); |
274 PIEvent be = new PIEvent(null, PIEvent.SET_FILL_ALL_THREADS); |
274 for (int i = 0; i < getGraphCount(); i++) { |
275 for (int i = 0; i < getGraphCount(); i++) { |
275 trace.getTraceGraph(i).piEventReceived(be); |
276 trace.getTraceGraph(i).piEventReceived(be); |
276 } |
277 } |
277 |
278 |
278 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", Boolean.TRUE); //$NON-NLS-1$ |
279 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", Boolean.TRUE); //$NON-NLS-1$ |
279 } |
280 } |
280 else if (eventString.equals("fillNone")) //$NON-NLS-1$ |
281 else if (eventString.equals("fillNone")) //$NON-NLS-1$ |
281 { |
282 { |
282 PIEvent be = new PIEvent(null, PIEvent.SET_FILL_OFF); |
283 PIEvent be = new PIEvent(null, PIEvent.SET_FILL_OFF); |
283 for (int i = 0; i < getGraphCount(); i++) { |
284 for (int i = 0; i < getGraphCount(); i++) { |
284 trace.getTraceGraph(i).piEventReceived(be); |
285 trace.getTraceGraph(i).piEventReceived(be); |
285 } |
286 } |
286 |
287 |
287 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", Boolean.FALSE); //$NON-NLS-1$ |
288 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", Boolean.FALSE); //$NON-NLS-1$ |
288 } |
289 } |
289 else if (eventString.equals("setBarOn")) //$NON-NLS-1$ |
290 else if (eventString.equals("setBarOn")) //$NON-NLS-1$ |
290 { |
291 { |
291 PIEvent be = new PIEvent(null, PIEvent.GPP_SET_BAR_GRAPH_ON); |
292 PIEvent be = new PIEvent(null, PIEvent.GPP_SET_BAR_GRAPH_ON); |
292 for (int i = 0; i < getGraphCount(); i++) { |
293 for (int i = 0; i < getGraphCount(); i++) { |
293 trace.getTraceGraph(i).piEventReceived(be); |
294 trace.getTraceGraph(i).piEventReceived(be); |
294 } |
295 } |
295 |
296 |
296 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.bar", Boolean.TRUE); //$NON-NLS-1$ |
297 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".bar", Boolean.TRUE); //$NON-NLS-1$ |
297 } |
298 } |
298 else if (eventString.equals("setBarOff")) //$NON-NLS-1$ |
299 else if (eventString.equals("setBarOff")) //$NON-NLS-1$ |
299 { |
300 { |
300 PIEvent be = new PIEvent(null, PIEvent.GPP_SET_BAR_GRAPH_OFF); |
301 PIEvent be = new PIEvent(null, PIEvent.GPP_SET_BAR_GRAPH_OFF); |
301 for (int i = 0; i < getGraphCount(); i++) { |
302 for (int i = 0; i < getGraphCount(); i++) { |
302 trace.getTraceGraph(i).piEventReceived(be); |
303 trace.getTraceGraph(i).piEventReceived(be); |
303 } |
304 } |
304 |
305 |
305 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.bar", Boolean.FALSE); //$NON-NLS-1$ |
306 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".bar", Boolean.FALSE); //$NON-NLS-1$ |
306 } |
307 } |
307 else if (eventString.equals("resetToCurrentMode")) //$NON-NLS-1$ |
308 else if (eventString.equals("resetToCurrentMode")) //$NON-NLS-1$ |
308 { |
309 { |
309 trace.getTraceGraph(currentPage).action(eventString); |
310 trace.getTraceGraph(currentPage).action(eventString); |
310 } else if (eventString.equals(ACTION_COMBINED_CPU_VIEW) || eventString.equals(ACTION_SEPARATE_CPU_VIEW)){ |
311 } else if (eventString.equals(ACTION_COMBINED_CPU_VIEW) || eventString.equals(ACTION_SEPARATE_CPU_VIEW)){ |
395 if ( (currentPage != PIPageEditor.THREADS_PAGE) |
396 if ( (currentPage != PIPageEditor.THREADS_PAGE) |
396 && (currentPage != PIPageEditor.BINARIES_PAGE) |
397 && (currentPage != PIPageEditor.BINARIES_PAGE) |
397 && (currentPage != PIPageEditor.FUNCTIONS_PAGE)) |
398 && (currentPage != PIPageEditor.FUNCTIONS_PAGE)) |
398 return null; |
399 return null; |
399 |
400 |
400 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
401 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
401 |
402 |
402 Hashtable<Integer,Object> summary = new Hashtable<Integer,Object>(); |
403 Hashtable<Integer,Object> summary = new Hashtable<Integer,Object>(); |
403 Enumeration<ProfiledGeneric> e = trace.getSortedThreadsElements(); |
404 Enumeration<ProfiledGeneric> e = trace.getSortedThreadsElements(); |
404 while (e.hasMoreElements()) |
405 while (e.hasMoreElements()) |
405 { |
406 { |
448 if (tmpTable != null) |
449 if (tmpTable != null) |
449 { |
450 { |
450 threadName = (String)((Vector<Object>)tmpTable.get(key)).elementAt(0); |
451 threadName = (String)((Vector<Object>)tmpTable.get(key)).elementAt(0); |
451 } |
452 } |
452 |
453 |
453 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
454 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
454 |
455 |
455 Vector<GenericSample> samples = trace.getSamplesInsideTimePeriod((long)startTime, (long)endTime); |
456 Vector<GenericSample> samples = trace.getSamplesInsideTimePeriod((long)startTime, (long)endTime); |
456 Hashtable<String,Integer> functionLoad = new Hashtable<String,Integer>(); |
457 Hashtable<String,Integer> functionLoad = new Hashtable<String,Integer>(); |
457 int threadSampleAmount = 0; |
458 int threadSampleAmount = 0; |
458 |
459 |
651 }; |
652 }; |
652 |
653 |
653 Boolean bar = SessionPreferences.getInstance().getBarMode(); // default value to session preference |
654 Boolean bar = SessionPreferences.getInstance().getBarMode(); // default value to session preference |
654 |
655 |
655 Object obj; |
656 Object obj; |
656 obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.address.bar"); //$NON-NLS-1$ |
657 obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".bar"); //$NON-NLS-1$ |
657 if ((obj != null) && (obj instanceof Boolean)) |
658 if ((obj != null) && (obj instanceof Boolean)) |
658 // retrieve the current value |
659 // retrieve the current value |
659 bar = (Boolean)obj; |
660 bar = (Boolean)obj; |
660 else |
661 else |
661 // set the initial value |
662 // set the initial value |
662 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.bar", bar); //$NON-NLS-1$ |
663 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".bar", bar); //$NON-NLS-1$ |
663 |
664 |
664 action.setChecked(bar); |
665 action.setChecked(bar); |
665 action.setToolTipText("Show graph as vertical bars"); //$NON-NLS-1$ |
666 action.setToolTipText("Show graph as vertical bars"); //$NON-NLS-1$ |
666 manager.add(action); |
667 manager.add(action); |
667 |
668 |
668 // manager.add(new Separator()); |
669 // manager.add(new Separator()); |
669 |
670 |
670 Boolean fillAll = SessionPreferences.getInstance().getFillAllEnabled(); // default value to session preference |
671 Boolean fillAll = SessionPreferences.getInstance().getFillAllEnabled(); // default value to session preference |
671 |
672 |
672 // if there is a value associated with the current Analyser tab, then use it |
673 // if there is a value associated with the current Analyser tab, then use it |
673 obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.address.fillAll"); //$NON-NLS-1$ |
674 obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".fillAll"); //$NON-NLS-1$ |
674 if ((obj != null) && (obj instanceof Boolean)) |
675 if ((obj != null) && (obj instanceof Boolean)) |
675 // retrieve the current value |
676 // retrieve the current value |
676 fillAll = (Boolean)obj; |
677 fillAll = (Boolean)obj; |
677 else |
678 else |
678 // set the initial value |
679 // set the initial value |
679 NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", fillAll); //$NON-NLS-1$ |
680 NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", fillAll); //$NON-NLS-1$ |
680 |
681 |
681 action = new Action(Messages.getString("AddressPlugin.9"), IAction.AS_CHECK_BOX) { //$NON-NLS-1$ |
682 action = new Action(Messages.getString("AddressPlugin.9"), IAction.AS_CHECK_BOX) { //$NON-NLS-1$ |
682 @Override |
683 @Override |
683 public void run() { |
684 public void run() { |
684 if (this.isChecked()) { |
685 if (this.isChecked()) { |
851 * |
852 * |
852 * @param path the path |
853 * @param path the path |
853 * @return the image descriptor |
854 * @return the image descriptor |
854 */ |
855 */ |
855 public static ImageDescriptor getImageDescriptor(String path) { |
856 public static ImageDescriptor getImageDescriptor(String path) { |
856 return AbstractPiPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp.pi.address", path); //$NON-NLS-1$ |
857 return AbstractPiPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); //$NON-NLS-1$ |
857 } |
858 } |
858 |
859 |
859 /** |
860 /** |
860 * number of graphs supplied by this plugin |
861 * number of graphs supplied by this plugin |
861 */ |
862 */ |
862 public int getGraphCount() { |
863 public int getGraphCount() { |
863 final GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
864 final GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
864 int graphCount = trace.getCPUCount() > 1 ? PAGE_COUNT + trace.getCPUCount() : PAGE_COUNT; |
865 int graphCount = trace.getCPUCount() > 1 ? PAGE_COUNT + trace.getCPUCount() : PAGE_COUNT; |
865 return graphCount; |
866 return graphCount; |
866 } |
867 } |
867 |
868 |
868 // page number of each graph supplied by this plugin |
869 // page number of each graph supplied by this plugin |
1033 /* (non-Javadoc) |
1034 /* (non-Javadoc) |
1034 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IFinalizeTrace#runOnPartOpened() |
1035 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IFinalizeTrace#runOnPartOpened() |
1035 */ |
1036 */ |
1036 public void runOnPartOpened() { |
1037 public void runOnPartOpened() { |
1037 //execute the initial action; since it affects the GIU, execute in UI thread |
1038 //execute the initial action; since it affects the GIU, execute in UI thread |
1038 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$ |
1039 GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$ |
1039 |
1040 |
1040 if (trace != null && trace.getCPUCount() > 1){ |
1041 if (trace != null && trace.getCPUCount() > 1){ |
1041 boolean showCombinedCPUView = true; |
1042 boolean showCombinedCPUView = true; |
1042 |
1043 |
1043 Object obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(NpiInstanceRepository.PERSISTED_SHOW_COMBINED_CPU_VIEW); |
1044 Object obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(NpiInstanceRepository.PERSISTED_SHOW_COMBINED_CPU_VIEW); |