author | Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com> |
Wed, 21 Apr 2010 15:14:16 +0300 | |
changeset 5 | 844b047e260d |
parent 2 | b9ab3b238396 |
child 12 | ae255c9aa552 |
permissions | -rw-r--r-- |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
17 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
18 |
package com.nokia.carbide.cpp.internal.pi.model; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
19 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
20 |
import java.text.DecimalFormat; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
21 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
22 |
import org.eclipse.draw2d.geometry.PointList; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
23 |
import org.eclipse.swt.graphics.Color; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
24 |
import org.eclipse.swt.graphics.RGB; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
25 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
26 |
import com.nokia.carbide.cpp.pi.util.ColorPalette; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
27 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
28 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
29 |
* Generic class for a profiled element, such as a thread, a binary or a function |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
30 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
31 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
32 |
public abstract class ProfiledGeneric |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
33 |
{ |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
34 |
/** number of graphs */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
35 |
protected static final int GRAPH_COUNT = 3; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
36 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
37 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
38 |
* Unique ordinal for this profiled element, given on creation. The first created profiled element |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
39 |
* of this kind has an index of zero, each following is incremented by one. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
40 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
41 |
protected int index = -1; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
42 |
/** Name of this profiled element */ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
43 |
private String nameString; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
44 |
/** Colour with which this profiled element is represented in any graph or legend view*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
45 |
protected Color color; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
46 |
/** overall sample count of this profiled element in the trace */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
47 |
protected int totalSampleCount; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
48 |
/** timestamp of the first sample for this profiled element */ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
49 |
protected int firstSample = -1; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
50 |
/** timestamp of the last sample for this profiled element */ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
51 |
protected int lastSample = -1; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
52 |
|
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
53 |
// since each instance may be used by table viewers for multiple graphs, |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
54 |
// keep per graph (for a maximum of 3 graphs): |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
55 |
// whether the thread/binary/function is currently enabled |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
56 |
// sample count in the selected graph area |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
57 |
// % load in the selected graph area |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
58 |
// string version of graph percent load |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
59 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
60 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
61 |
* The cumulative list contains for each bucket the |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
62 |
* cumulative sample percentage of the same bucket of all ProfiledGenerics |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
63 |
* so far processed (not including the values of the current ProfiledGeneric). |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
64 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
65 |
* In other words it's containing the bottom or start value of this |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
66 |
* profiled element to draw on the graph (the graph drawn just underneath the |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
67 |
* graph of this profiled element) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
68 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
69 |
private float[][] cumulativeList; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
70 |
/** checkbox enabled state of this profiled element for each of the graphs */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
71 |
protected boolean[] enableValue; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
72 |
/** current sample count of this profiled element for each of the graphs, changes with enabled state, selected time frame, master filtering */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
73 |
protected int[] graphSampleCount; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
74 |
/** current sample percentage load of this profiled element for each of the graphs, changes with enabled state, selected time frame, master filtering */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
75 |
protected float[] graphPercentLoad; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
76 |
/** current sample average load of this profiled element for each of the graphs, changes with enabled state, selected time frame, master filtering */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
77 |
private String[] averageLoadValueString; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
78 |
/** PointList for each graphs polyline */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
79 |
private PointList[] pointList; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
80 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
81 |
// bucket values |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
82 |
// |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
83 |
/** holds the sample count value for all buckets, calculated as one-off when trace is first processed */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
84 |
private int[] activityN = null; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
85 |
/** holds percentage value for all buckets, calculated as one-off when trace is first processed */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
86 |
protected float[] activityP = null; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
87 |
/** holds start timestamp of all buckets, calculated as one-off when trace is first processed */ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
88 |
private int[] activityT = null; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
89 |
/** the index of the bucket currently updated */ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
90 |
protected int activityIndx = 0; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
91 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
92 |
/** total number of CPUs in the system; 1 for non-SMP trace */ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
93 |
private int cpuCount; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
94 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
95 |
//for SMP |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
96 |
protected boolean isSMP; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
97 |
protected int[] totalSampleCountSMP; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
98 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
99 |
protected float[][] activityPSMP; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
100 |
private int[][] activityNSMP; |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
101 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
102 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
103 |
* Constructor |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
104 |
* @param cpuCount number of CPUs present in the trace |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
105 |
* @param graphCount number of graphs to display |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
106 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
107 |
public ProfiledGeneric(int cpuCount, int graphCount) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
108 |
if (graphCount < 0){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
109 |
throw new IllegalArgumentException("graphCount must be greater than 0."); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
110 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
111 |
// default to light gray |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
112 |
this.color = ColorPalette.getColor(new RGB(192, 192, 192)); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
113 |
this.cpuCount = cpuCount; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
114 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
115 |
// init variables for values per graph |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
116 |
cumulativeList = new float[graphCount][]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
117 |
enableValue = new boolean[graphCount]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
118 |
graphSampleCount = new int[graphCount]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
119 |
graphPercentLoad = new float[graphCount]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
120 |
averageLoadValueString = new String[graphCount]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
121 |
pointList = new PointList[graphCount]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
122 |
for (int graph = 0; graph < graphCount; graph++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
123 |
enableValue[graph] = true; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
124 |
averageLoadValueString[graph] = ""; //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
125 |
pointList[graph] = new PointList(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
126 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
127 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
128 |
if (cpuCount > 1) { // SMP |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
129 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
130 |
isSMP = true; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
131 |
totalSampleCountSMP = new int[cpuCount]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
132 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
133 |
activityPSMP = new float[cpuCount][]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
134 |
activityNSMP = new int[cpuCount][]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
135 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
136 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
137 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
138 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
139 |
* Setter for the name of the profiled element |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
140 |
* @param nameString |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
141 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
142 |
public void setNameString(String nameString) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
143 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
144 |
this.nameString = nameString; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
145 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
146 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
147 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
148 |
* Adds a point to the PointList of the given graph |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
149 |
* @param graphIndex the graph to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
150 |
* @param x the X-coordinate of the point |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
151 |
* @param y the Y-coordinate of the point |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
152 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
153 |
public void addPointToPolyline(int graphIndex, int x, int y) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
154 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
155 |
pointList[graphIndex].addPoint(x, y); |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
156 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
157 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
158 |
public void resetPolyline(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
159 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
160 |
pointList[graphIndex].removeAllPoints(); |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
161 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
162 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
163 |
public PointList getPointList(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
164 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
165 |
return pointList[graphIndex]; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
166 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
167 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
168 |
public int getIndex() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
169 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
170 |
return this.index; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
171 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
172 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
173 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
174 |
* Creates bucket arrays. This also propagates to SMP bucket arrays. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
175 |
* @param numberOfBuckets The total number of buckets to use. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
176 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
177 |
public void createBuckets(int numberOfBuckets){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
178 |
this.activityP = new float[numberOfBuckets]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
179 |
this.activityT = new int[numberOfBuckets]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
180 |
this.activityN = new int[numberOfBuckets]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
181 |
if (isSMP){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
182 |
for (int cpu = 0; cpu < cpuCount; cpu++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
183 |
this.activityPSMP[cpu] = new float[numberOfBuckets]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
184 |
this.activityNSMP[cpu] = new int[numberOfBuckets]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
185 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
186 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
187 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
188 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
189 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
190 |
* this is intended to initialise the newly created bucket arrays |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
191 |
* @param duration length of time each bucket represents |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
192 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
193 |
public void initialiseBuckets(int duration){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
194 |
for (int i = 0; i < activityT.length; i++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
195 |
//this is important for calculating the x values later, so use mid-bucket values |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
196 |
activityT[i] = duration*i + duration / 2; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
197 |
} |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
198 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
199 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
200 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
201 |
* Updates the bucket percentage values. This requires that sample counts have |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
202 |
* already been calculated for each bucket. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
203 |
* @param bucketTotalArr Total number of samples per bucket |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
204 |
* @param bucketTotalArrSMP total number of samples per cpu and bucket. May be null for non-SMP systems. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
205 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
206 |
public void calculateBucketPercentages(int[] bucketTotalArr, int[][] bucketTotalArrSMP){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
207 |
if (activityN != null){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
208 |
for (int b = 0; b < activityN.length; b++) {//loop through sample counts per bucket |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
209 |
if (bucketTotalArr[b] > 0){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
210 |
activityP[b] = (float)activityN[b]*100/bucketTotalArr[b]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
211 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
212 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
213 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
214 |
activityIndx = activityP.length; //TODO: temporarily needed, remove later |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
215 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
216 |
if (isSMP){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
217 |
for (int cpu = 0; cpu < bucketTotalArrSMP.length; cpu++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
218 |
if (bucketTotalArrSMP[cpu][b]>0){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
219 |
activityPSMP[cpu][b] = (float)activityNSMP[cpu][b]*100/bucketTotalArrSMP[cpu][b]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
220 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
221 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
222 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
223 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
224 |
} |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
225 |
} |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
226 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
227 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
228 |
* Increases total sample count as well as sample count for the given bucket. Takes care of SMP values |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
229 |
* if SMP trace. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
230 |
* @param bucketIndex The index of the bucket to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
231 |
* @param timestamp the timestamp of the sample |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
232 |
* @param cpu the CPU number of the sample |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
233 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
234 |
public void increaseSampleCount(int bucketIndex, int timestamp, int cpu){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
235 |
//note, activityT (bucket times) is constant and has been set during initialisation |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
236 |
//activityP (bucket percentages) will be calculated after all samples have been processed |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
237 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
238 |
incTotalSampleCount(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
239 |
if (isSMP){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
240 |
incTotalSampleCountForSMP(cpu); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
241 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
242 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
243 |
this.activityN[bucketIndex]++; //increase sample count in bucket |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
244 |
if (firstSample == -1){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
245 |
firstSample = timestamp; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
246 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
247 |
lastSample = timestamp; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
248 |
if (isSMP){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
249 |
this.activityNSMP[cpu][bucketIndex]++; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
250 |
} |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
251 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
252 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
253 |
public void setupCumulativeList(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
254 |
{ |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
255 |
if (this.activityT != null && activityT.length != 0) |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
256 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
257 |
if (cumulativeList[graphIndex] == null) |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
258 |
cumulativeList[graphIndex] = new float[this.activityT.length]; |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
259 |
else |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
260 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
261 |
for (int i = 0; i < cumulativeList[graphIndex].length; i++) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
262 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
263 |
cumulativeList[graphIndex][i] = 0; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
264 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
265 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
266 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
267 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
268 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
269 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
270 |
* The cumulative list contains for each bucket the |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
271 |
* cumulative sample percentage of the same bucket of all ProfiledGenerics |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
272 |
* so far processed (not including the values of the current ProfiledGeneric). |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
273 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
274 |
* Typically used for drawing a stacked-area chart |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
275 |
* @param graphIndex the graph ordinal to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
276 |
* @return |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
277 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
278 |
public float[] getCumulativeList(int graphIndex) |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
279 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
280 |
return this.cumulativeList[graphIndex]; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
281 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
282 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
283 |
public void setCumulativeValue(int graphIndex, int index, float value) |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
284 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
285 |
this.cumulativeList[graphIndex][index] = value; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
286 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
287 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
288 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
289 |
* returns x-coordinates |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
290 |
* @return |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
291 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
292 |
public int[] getSampleList() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
293 |
{ |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
294 |
if (activityT != null){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
295 |
//Arrays.copyOf() is only supported from Java 6 |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
296 |
//return Arrays.copyOf(this.activityT, this.activityT.length); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
297 |
int[] ret = new int[activityT.length]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
298 |
for (int i = 0; i < ret.length; i++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
299 |
ret[i] = activityT[i]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
300 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
301 |
return ret; |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
302 |
} |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
303 |
return null; |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
304 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
305 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
306 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
307 |
* returns y-coordinates |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
308 |
* @return |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
309 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
310 |
public float[] getActivityList(){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
311 |
if (activityP != null){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
312 |
//Arrays.copyOf() is only supported from Java 6 |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
313 |
//return Arrays.copyOf(this.activityP, this.activityP.length); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
314 |
float[] ret = new float[activityP.length]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
315 |
for (int i = 0; i < ret.length; i++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
316 |
ret[i] = activityP[i]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
317 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
318 |
return ret; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
319 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
320 |
return null; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
321 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
322 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
323 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
324 |
* returns y-coordinates (percentage values of activity) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
325 |
* @param cpu |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
326 |
* @return |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
327 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
328 |
public float[] getActivityListForSMP(int cpu) |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
329 |
{ |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
330 |
if (isSMP && this.activityPSMP[cpu] != null){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
331 |
//Arrays.copyOf() is only supported from Java 6 |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
332 |
//return Arrays.copyOf(activityPSMP[cpu], activityPSMP[cpu].length); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
333 |
float[] ret = new float[activityPSMP[cpu].length]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
334 |
for (int i = 0; i < ret.length; i++) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
335 |
ret[i] = activityPSMP[cpu][i]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
336 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
337 |
return ret; |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
338 |
} |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
339 |
return null; |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
340 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
341 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
342 |
public int getFirstSample() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
343 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
344 |
if (this.firstSample == -1) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
345 |
return 0; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
346 |
else |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
347 |
return this.firstSample; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
348 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
349 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
350 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
351 |
public int getLastSample() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
352 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
353 |
if (this.lastSample == -1) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
354 |
return 0; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
355 |
else |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
356 |
return this.lastSample; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
357 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
358 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
359 |
public int getRealLastSample() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
360 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
361 |
return this.lastSample; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
362 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
363 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
364 |
public void setLastSample(int lastSample) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
365 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
366 |
this.lastSample = lastSample; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
367 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
368 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
369 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
370 |
* Setter for this ordinal of this profiled element |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
371 |
* @param index the ordinal to set |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
372 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
373 |
public void setIndex(int index) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
374 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
375 |
this.index = index; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
376 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
377 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
378 |
public void setAverageLoadValueString(int graphIndex, String valueString) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
379 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
380 |
this.averageLoadValueString[graphIndex] = valueString; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
381 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
382 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
383 |
public void setAverageLoadValueString(int graphIndex, float value) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
384 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
385 |
this.averageLoadValueString[graphIndex] = (new DecimalFormat(Messages.getString("ProfiledGeneric.decimalFormat"))).format(value); //$NON-NLS-1$ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
386 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
387 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
388 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
389 |
public String getAverageLoadValueString(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
390 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
391 |
return this.averageLoadValueString[graphIndex]; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
392 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
393 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
394 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
395 |
* Setter for this colour of this profiled element |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
396 |
* @param c the colour to set |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
397 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
398 |
public void setColor(Color c) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
399 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
400 |
this.color = c; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
401 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
402 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
403 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
404 |
* Sets enabled state for this profiled element in the given graph |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
405 |
* @param graphIndex the graph index to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
406 |
* @param enableValue true for enabled, false for disabled |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
407 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
408 |
public void setEnabled(int graphIndex, boolean enableValue) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
409 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
410 |
this.enableValue[graphIndex] = enableValue; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
411 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
412 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
413 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
414 |
* Checks enabled state for this profiled element in the given graph |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
415 |
* @param graphIndex the graph index to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
416 |
* @return true if enabled, false if disabled |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
417 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
418 |
public boolean isEnabled(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
419 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
420 |
return enableValue[graphIndex]; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
421 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
422 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
423 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
424 |
* @return the colour of this profiled element |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
425 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
426 |
public Color getColor() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
427 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
428 |
return this.color; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
429 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
430 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
431 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
432 |
* @return the name of this profiled element |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
433 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
434 |
public String getNameString() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
435 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
436 |
return this.nameString; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
437 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
438 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
439 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
440 |
* @return the total sample count of this profiled element over the entire trace data |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
441 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
442 |
public int getTotalSampleCount() |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
443 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
444 |
return this.totalSampleCount; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
445 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
446 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
447 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
448 |
* Increased the total sample count of this profiled element by one |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
449 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
450 |
public void incTotalSampleCount() |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
451 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
452 |
this.totalSampleCount++; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
453 |
} |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
454 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
455 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
456 |
* returns the total sample count over the entire trace data for the given CPU |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
457 |
* @param cpu the CPU to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
458 |
* @return the total sample count for given CPU |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
459 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
460 |
public int getTotalSampleCountForSMP(int cpu) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
461 |
{ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
462 |
return this.totalSampleCountSMP[cpu]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
463 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
464 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
465 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
466 |
* Increases the total sample count for the given CPU by one |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
467 |
* @param cpu the CPU to use |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
468 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
469 |
public void incTotalSampleCountForSMP(int cpu) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
470 |
{ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
471 |
this.totalSampleCountSMP[cpu]++; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
472 |
} |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
473 |
|
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
474 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
475 |
* Getter for the given graph's sample count |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
476 |
* @param graphIndex |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
477 |
* @return |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
478 |
*/ |
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
479 |
public int getSampleCount(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
480 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
481 |
return this.graphSampleCount[graphIndex]; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
482 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
483 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
484 |
public void setSampleCount(int graphIndex, int sampleCount) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
485 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
486 |
this.graphSampleCount[graphIndex] = sampleCount; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
487 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
488 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
489 |
public void incSampleCount(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
490 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
491 |
this.graphSampleCount[graphIndex]++; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
492 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
493 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
494 |
public float getPercentLoad(int graphIndex) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
495 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
496 |
return this.graphPercentLoad[graphIndex]; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
497 |
} |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
498 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
499 |
public void setLoadAndString(int graphIndex, float percentLoad) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
500 |
{ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
501 |
this.graphPercentLoad[graphIndex] = percentLoad; |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
502 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
503 |
// doesn't hurt to set the string here, too. |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
504 |
// you may not need to set the string when you set the float |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
505 |
if (percentLoad >= 0.005f) |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
506 |
this.averageLoadValueString[graphIndex] = (new DecimalFormat(Messages.getString("ProfiledGeneric.decimalFormat"))).format(percentLoad); //$NON-NLS-1$ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
507 |
else |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
508 |
this.averageLoadValueString[graphIndex] = Messages.getString("ProfiledGeneric.zeroFormat"); //$NON-NLS-1$ |
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
509 |
} |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
2
diff
changeset
|
510 |
|
2
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
511 |
|
b9ab3b238396
Initial version of Performance Investigator under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
512 |
} |