1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
192 { |
192 { |
193 if( checkedModules.containsKey(moduleName)) { |
193 if( checkedModules.containsKey(moduleName)) { |
194 return checkedModules.get(moduleName); |
194 return checkedModules.get(moduleName); |
195 } |
195 } |
196 else if (!modules.isEmpty()) { |
196 else if (!modules.isEmpty()) { |
197 boolean build = Util.chechModuleBuildState(modules, moduleName); |
197 boolean build = Util.checkModuleBuildState(modules, moduleName); |
198 if( !build ) { |
198 if( !build ) { |
199 checkedModules.put(moduleName, build); |
199 checkedModules.put(moduleName, build); |
200 } |
200 } |
201 return build; |
201 return build; |
202 } |
202 } |
356 */ |
356 */ |
357 public final TreeParent getCallstack(final AnalysisItem item, AbstractList<MMPInfo> modules) { |
357 public final TreeParent getCallstack(final AnalysisItem item, AbstractList<MMPInfo> modules) { |
358 |
358 |
359 // get active logging mode |
359 // get active logging mode |
360 String reportLevel = store.getString(Constants.REPORT_LEVEL); |
360 String reportLevel = store.getString(Constants.REPORT_LEVEL); |
361 |
361 |
362 // create tree parent for test runs |
362 // create tree parent for test runs |
363 TreeParent testRuns = new TreeParent(Constants.ITEM_TREE_MEM_LEAKS |
363 String title = null; |
364 + item.getID() + " " + item.getMemoryLeakTime()); |
364 if( item.getCallstackItems() != null ) { |
365 |
365 title = Constants.ITEM_TREE_MEM_LEAKS |
|
366 + item.getID() + " - " + item.getMemoryLeakTime() +" - Callstack size: " +item.getCallstackItems().size(); |
|
367 } |
|
368 else { |
|
369 title = Constants.ITEM_TREE_MEM_LEAKS + item.getID() + " - " + item.getMemoryLeakTime(); |
|
370 } |
|
371 TreeParent testRuns = new TreeParent(title); |
|
372 |
366 // get callstack items |
373 // get callstack items |
367 Iterator<CallstackItem> stackItems = item.getCallstackItems() |
374 Iterator<CallstackItem> stackItems = item.getCallstackItems().iterator(); |
368 .iterator(); |
|
369 |
375 |
370 // is one know line printed |
376 // is one know line printed |
371 boolean printed = false; |
377 boolean printed = false; |
372 |
378 |
373 // thru call stack items |
379 // thru call stack items |
449 testRuns.addChild(to); |
455 testRuns.addChild(to); |
450 printed = true; |
456 printed = true; |
451 } |
457 } |
452 |
458 |
453 } |
459 } |
454 |
460 |
|
461 Object[] childs = testRuns.getChildren(); |
|
462 int childCount = 0; |
|
463 if( childs != null ) { |
|
464 childCount = childs.length; |
|
465 } |
|
466 int callstackCount = item.getCallstackItems().size(); |
|
467 |
|
468 if( callstackCount != childCount ) { |
|
469 title = Constants.ITEM_TREE_MEM_LEAKS |
|
470 + item.getID() + " - " + item.getMemoryLeakTime() +" - Callstack size: " +callstackCount +" ("+(callstackCount - childCount)+" filtered)"; |
|
471 testRuns.setName(title); |
|
472 } |
455 TreeParent incRoot; |
473 TreeParent incRoot; |
456 incRoot = new TreeParent(Constants.ANALYZE_TOOL_TITLE); |
474 incRoot = new TreeParent(Constants.ANALYZE_TOOL_TITLE); |
457 incRoot.addChild(testRuns); |
475 incRoot.addChild(testRuns); |
458 return incRoot; |
476 return incRoot; |
459 } |
477 } |