author | Matti Laitinen <matti.t.laitinen@nokia.com> |
Thu, 11 Feb 2010 15:22:14 +0200 | |
changeset 1 | 1050670c6980 |
child 6 | f65f740e69f9 |
permissions | -rw-r--r-- |
1
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Definitions for the class BaseInfo |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
17 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
18 |
package com.nokia.s60tools.analyzetool.engine.statistic; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
19 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
20 |
import java.util.AbstractList; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
21 |
import java.util.ArrayList; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
22 |
import java.util.Hashtable; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
23 |
import java.util.Iterator; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
24 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
25 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
26 |
* Base class for {@link AllocInfo} and {@link FreeInfo} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
27 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
28 |
* @author kihe |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
29 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
30 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
31 |
public class BaseInfo { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
32 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
33 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
34 |
* Cache for callstack items. Used when allocation fragment is parsed wrong |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
35 |
* order. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
36 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
37 |
private final Hashtable<Integer, AbstractList<AllocCallstack>> callstackCache; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
38 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
39 |
/** Memory address of this memory allocation. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
40 |
private Long memoryAddress; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
41 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
42 |
/** Memory allocation process id. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
43 |
private int processID; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
44 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
45 |
/** Allocation time */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
46 |
private Long time; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
47 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
48 |
/** Total memory size at this time */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
49 |
private int totalMemory = 0; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
50 |
private int size = 0; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
51 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
52 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
53 |
* Constructor |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
54 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
55 |
public BaseInfo() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
56 |
callstackCache = new Hashtable<Integer, AbstractList<AllocCallstack>>(); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
57 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
58 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
59 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
60 |
* Sets memory allocation callstack |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
61 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
62 |
* @param callstack |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
63 |
* Memory allocation callstack |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
64 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
65 |
public void addCallstack(AbstractList<AllocCallstack> callstack) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
66 |
callstackCache.put(0, callstack); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
67 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
68 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
69 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
70 |
* Returns memory allocation callstack. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
71 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
72 |
* @return Callstack of memory allocation |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
73 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
74 |
public AbstractList<AllocCallstack> getCallstack() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
75 |
AbstractList<AllocCallstack> wholeCallstack = new ArrayList<AllocCallstack>(); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
76 |
int callstacksize = callstackCache.size(); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
77 |
for (int i = 0; i < callstacksize; i++) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
78 |
AbstractList<AllocCallstack> tempCallstack = callstackCache |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
79 |
.get(i); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
80 |
if (tempCallstack == null || tempCallstack.isEmpty()) |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
81 |
continue; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
82 |
Iterator<AllocCallstack> iterCall = tempCallstack.iterator(); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
83 |
while (iterCall.hasNext()) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
84 |
wholeCallstack.add(iterCall.next()); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
85 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
86 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
87 |
return wholeCallstack; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
88 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
89 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
90 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
91 |
* Returns memory address |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
92 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
93 |
* @return Memory address |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
94 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
95 |
public Long getMemoryAddress() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
96 |
return memoryAddress; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
97 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
98 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
99 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
100 |
* Returns process ID. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
101 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
102 |
* @return Process ID. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
103 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
104 |
public int getProcessID() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
105 |
return processID; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
106 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
107 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
108 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
109 |
* Returns time for the allocation |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
110 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
111 |
* @return Allocation time |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
112 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
113 |
public Long getTime() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
114 |
return time == null ? 0 : time; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
115 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
116 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
117 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
118 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
119 |
* Sets memory address |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
120 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
121 |
* @param newMemoryAddress |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
122 |
* Memory address |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
123 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
124 |
public void setMemoryAddress(String newMemoryAddress) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
125 |
Long lValue = Long.parseLong(newMemoryAddress, 16); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
126 |
this.memoryAddress = lValue; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
127 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
128 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
129 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
130 |
* Sets process ID. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
131 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
132 |
* @param newProcessID |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
133 |
* Process ID |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
134 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
135 |
public void setProcessID(String newProcessID) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
136 |
int iValue = Integer.parseInt(newProcessID, 16); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
137 |
this.processID = iValue; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
138 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
139 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
140 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
141 |
* Sets time for the allocation |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
142 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
143 |
* @param newTime |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
144 |
* Allocation time |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
145 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
146 |
public void setTime(String newTime) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
147 |
Long lValue = Long.parseLong(newTime, 16); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
148 |
this.time = lValue; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
149 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
150 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
151 |
public void setTime(Long newTime) |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
152 |
{ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
153 |
this.time = newTime; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
154 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
155 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
156 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
157 |
* Updates allocation fragment. Means that given callstack is addition to |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
158 |
* previous added alloc |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
159 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
160 |
* @param callstack |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
161 |
* Addition callstack items |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
162 |
* @param packetNumber |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
163 |
* AllocF id value |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
164 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
165 |
public void updateFragment(AbstractList<AllocCallstack> callstack, |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
166 |
String packetNumber) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
167 |
callstackCache.put(Integer.parseInt(packetNumber, 16), callstack); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
168 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
169 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
170 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
171 |
* set total memory used at this time. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
172 |
* @param size |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
173 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
174 |
public void setTotalMem(int newSize) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
175 |
totalMemory = newSize; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
176 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
177 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
178 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
179 |
* get total memory used at this time |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
180 |
* @return size |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
181 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
182 |
public int getTotalMem() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
183 |
return totalMemory; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
184 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
185 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
186 |
public void setSizeInt(int aSize) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
187 |
size = aSize; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
188 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
189 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
190 |
public int getSizeInt() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
191 |
return size; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
192 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
193 |
} |