|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 package com.nokia.s60tools.swmtanalyser.data; |
|
18 /** |
|
19 * Stores the HEAP data from the log files. |
|
20 * |
|
21 */ |
|
22 public class HeapData { |
|
23 private String threadName; |
|
24 private String processName; |
|
25 private String baseAddr; |
|
26 private long size; |
|
27 private long maxSize; |
|
28 private long allocatedCells; |
|
29 private long freeCells; |
|
30 private long allocSpace; |
|
31 private long freeSpace; |
|
32 private long freeSlack; |
|
33 private long largestFreeCell; |
|
34 private long largestAllocCell; |
|
35 private int attrib; |
|
36 |
|
37 public void setThreadAndProcessName(String threadName) |
|
38 { |
|
39 int index = threadName.indexOf("::"); |
|
40 this.processName = threadName.substring(0, index-1); |
|
41 this.threadName = threadName; |
|
42 } |
|
43 |
|
44 public long getAllocatedCells() { |
|
45 return allocatedCells; |
|
46 } |
|
47 |
|
48 public void setAllocatedCells(String allocatedCells) { |
|
49 this.allocatedCells = Long.parseLong(allocatedCells); |
|
50 } |
|
51 |
|
52 public long getAllocSpace() { |
|
53 return allocSpace; |
|
54 } |
|
55 |
|
56 public void setAllocSpace(String allocSpace) { |
|
57 this.allocSpace = Long.parseLong(allocSpace); |
|
58 } |
|
59 |
|
60 public String getBaseAddr() { |
|
61 return baseAddr; |
|
62 } |
|
63 |
|
64 public void setBaseAddr(String baseAddr) { |
|
65 this.baseAddr = baseAddr; |
|
66 } |
|
67 |
|
68 public long getFreeCells() { |
|
69 return freeCells; |
|
70 } |
|
71 |
|
72 public void setFreeCells(String freeCells) { |
|
73 this.freeCells = Long.parseLong(freeCells); |
|
74 } |
|
75 |
|
76 public long getFreeSlack() { |
|
77 return freeSlack; |
|
78 } |
|
79 |
|
80 public void setFreeSlack(String freeSlack) { |
|
81 this.freeSlack = Long.parseLong(freeSlack); |
|
82 } |
|
83 |
|
84 public long getFreeSpace() { |
|
85 return freeSpace; |
|
86 } |
|
87 |
|
88 public void setFreeSpace(String freeSpace) { |
|
89 this.freeSpace = Long.parseLong(freeSpace); |
|
90 } |
|
91 |
|
92 public long getLargestAllocCell() { |
|
93 return largestAllocCell; |
|
94 } |
|
95 |
|
96 public void setLargestAllocCell(String largestAllocCell) { |
|
97 this.largestAllocCell = Long.parseLong(largestAllocCell); |
|
98 } |
|
99 |
|
100 public long getLargestFreeCell() { |
|
101 return largestFreeCell; |
|
102 } |
|
103 |
|
104 public void setLargestFreeCell(String largestFreeCell) { |
|
105 this.largestFreeCell = Long.parseLong(largestFreeCell); |
|
106 } |
|
107 |
|
108 public String getProcessName() { |
|
109 return processName; |
|
110 } |
|
111 |
|
112 /*public void setProcessName(String processName) { |
|
113 this.processName = processName; |
|
114 }*/ |
|
115 |
|
116 public long getSize() { |
|
117 return size; |
|
118 } |
|
119 |
|
120 public void setSize(String size) { |
|
121 this.size = Long.parseLong(size); |
|
122 } |
|
123 |
|
124 public long getMaxSize() { |
|
125 return maxSize; |
|
126 } |
|
127 |
|
128 public void setMaxSize(String maxSize) { |
|
129 this.maxSize = Long.parseLong(maxSize); |
|
130 } |
|
131 public String getThreadName() { |
|
132 return threadName; |
|
133 } |
|
134 /** |
|
135 * @param status |
|
136 * This method sets the status of this heap to New, Alive or Deleted |
|
137 */ |
|
138 public void setStatus(String status) |
|
139 { |
|
140 if(status.equals("[N]+[A]")) |
|
141 attrib = CycleData.New; |
|
142 else if (status.equals("[A]")) |
|
143 attrib = CycleData.Alive; |
|
144 else |
|
145 attrib = CycleData.Deleted; |
|
146 } |
|
147 public int getStatus() |
|
148 { |
|
149 return attrib; |
|
150 } |
|
151 |
|
152 public void setAllocatedCells(long allocatedCells) { |
|
153 this.allocatedCells = allocatedCells; |
|
154 } |
|
155 |
|
156 public void setAllocSpace(long allocSpace) { |
|
157 this.allocSpace = allocSpace; |
|
158 } |
|
159 public int getAttrib() { |
|
160 return attrib; |
|
161 } |
|
162 public void setAttrib(int attrib) { |
|
163 this.attrib = attrib; |
|
164 } |
|
165 |
|
166 public void setFreeCells(long freeCells) { |
|
167 this.freeCells = freeCells; |
|
168 } |
|
169 |
|
170 public void setFreeSlack(long freeSlack) { |
|
171 this.freeSlack = freeSlack; |
|
172 } |
|
173 public void setFreeSpace(long freeSpace) { |
|
174 this.freeSpace = freeSpace; |
|
175 } |
|
176 public void setLargestAllocCell(long largestAllocCell) { |
|
177 this.largestAllocCell = largestAllocCell; |
|
178 } |
|
179 public void setLargestFreeCell(long largestFreeCell) { |
|
180 this.largestFreeCell = largestFreeCell; |
|
181 } |
|
182 |
|
183 public void setSize(long size) { |
|
184 this.size = size; |
|
185 } |
|
186 |
|
187 } |